Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • martin/relibc
  • ashton/relibc
  • vincent/relibc
  • boomshroom/relibc
  • njskalski/relibc
  • microcolonel/relibc
  • gmacd/relibc
  • feliwir/relibc
  • devnexen/relibc
  • jamesgraves/relibc
  • oddcoder/relibc
  • andar1an/relibc
  • gugz0r/relibc
  • matijaskala/relibc
  • zen3ger/relibc
  • Majoneza/relibc
  • 4lDO2/relibc
  • enygmator/relibc
  • JustAnotherDev/relibc
  • doriancodes/relibc
  • adamantinum/relibc
  • wiredtv/relibc
  • stratact/relibc
  • Ramla-I/relibc
  • bitstr0m/relibc
  • bpisch/relibc
  • henritel/relibc
  • smckay/relibc
  • xTibor/relibc
  • devajithvs/relibc
  • andypython/relibc
  • t-nil/relibc
  • DataTriny/relibc
  • SteveLauC/relibc
  • dlrobertson/relibc
  • AgostonSzepessy/relibc
  • TheDarkula/relibc
  • willnode/relibc
  • bamontan/relibc
  • redoxeon/relibc
  • darley/relibc
  • ayf/relibc
  • heghe/relibc
  • Ivan/relibc
  • hasheddan/relibc
  • dahc/relibc
  • auwardoctor/relibc
  • kodicraft/relibc
  • arthurpaulino/relibc
  • jasonhansel/relibc
  • kel/relibc
  • GrayJack/relibc
  • sahitpj/relibc
  • plimkilde/relibc
  • BjornTheProgrammer/relibc
  • defra/relibc
  • Schyrsivochter/relibc
  • ebalalic/relibc
  • josh/relibc
  • adchacon/relibc
  • aaronjanse/relibc
  • josh_williams/relibc
  • 8tab/relibc
  • athei/relibc
  • carrot93/relibc
  • RA_GM1/relibc
  • zhaozhao/relibc
  • JCake/relibc
  • KGrewal1/relibc
  • emturner/relibc
  • LuigiPiucco/relibc
  • bfrascher/relibc
  • starsheriff/relibc
  • kcired/relibc
  • jamespcfrancis/relibc
  • neallred/relibc
  • omar-mohamed-khallaf/relibc
  • jD91mZM2/relibc
  • rw_van/relibc
  • Skallwar/relibc
  • matt-vdv/relibc
  • mati865/relibc
  • SoyaOhnishi/relibc
  • ArniDagur/relibc
  • tlam/relibc
  • glongo/relibc
  • kamirr/relibc
  • abdullah/relibc
  • saeedtabrizi/relibc
  • sajattack/relibc
  • lmiskiew/relibc
  • seanpk/relibc
  • MaikuZ/relibc
  • jamadazi/relibc
  • coolreader18/relibc
  • wt/relibc
  • lebensterben/relibc
  • redox-os/relibc
  • nicoan/relibc
  • uuuvn/relibc
  • vadorovsky/relibc
  • ids1024/relibc
  • raffaeleragni/relibc
  • freewilll/relibc
  • LLeny/relibc
  • alfredoyang/relibc
  • batonius/relibc
  • TornaxO7/relibc
  • bjorn3/relibc
  • Arcterus/relibc
  • Tommoa/relibc
  • samuela/relibc
  • mindriot101/relibc
  • lygstate/relibc
114 results
Show changes
Commits on Source (87)
[submodule "openlibm"]
path = openlibm
url = https://github.com/redox-os/openlibm.git
url = https://gitlab.redox-os.org/redox-os/openlibm.git
[submodule "cbindgen"]
path = cbindgen
url = https://github.com/redox-os/cbindgen.git
url = https://gitlab.redox-os.org/redox-os/cbindgen.git
[submodule "ralloc"]
path = ralloc
url = https://github.com/redox-os/ralloc.git
url = https://gitlab.redox-os.org/redox-os/ralloc.git
[submodule "va_list"]
path = va_list
url = https://github.com/redox-os/va_list-rs.git
url = https://gitlab.redox-os.org/redox-os/va_list-rs.git
......@@ -5,6 +5,8 @@ env:
- TARGET=x86_64-unknown-redox
rust:
- nightly
install:
- if [ $TARGET == "aarch64-unknown-linux-gnu" ]; then sudo apt-get install gcc-aarch64-linux-gnu; fi
before_script:
- rustup component add rustfmt-preview
- if [ -n "$TARGET" ]; then rustup target add $TARGET; fi
......
This diff is collapsed.
......@@ -11,18 +11,19 @@ crate-type = ["staticlib"]
members = ["src/crt0"]
[build-dependencies]
cc = "1.0"
cc = "1.0.17"
[dependencies]
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false }
ctype = { path = "src/ctype" }
errno = { path = "src/errno" }
fcntl = { path = "src/fcntl" }
fenv = { path = "src/fenv" }
float = { path = "src/float" }
grp = { path = "src/grp" }
locale = { path = "src/locale" }
netinet = { path = "src/netinet" }
platform = { path = "src/platform" }
setjmp = { path = "src/setjmp" }
semaphore = { path = "src/semaphore" }
signal = { path = "src/signal" }
stdio = { path = "src/stdio" }
......@@ -38,6 +39,11 @@ time = { path = "src/time" }
unistd = { path = "src/unistd" }
wctype = { path = "src/wctype" }
[dependencies.compiler_builtins]
git = "https://github.com/rust-lang-nursery/compiler-builtins.git"
default-features = false
features = ["no-lang-items"]
[profile.dev]
panic = "abort"
......
......@@ -38,7 +38,8 @@ install: all
cp -rv "target/include"/* "$(DESTDIR)/include"
cp -v "$(BUILD)/debug/libc.a" "$(DESTDIR)/lib"
cp -v "$(BUILD)/debug/crt0.o" "$(DESTDIR)/lib"
cp -v "$(BUILD)/openlibm/libopenlibm.a" "$(DESTDIR)/lib/libm.a"
cp -rv "openlibm/include"/* "$(DESTDIR)/include"
cp -rv "openlibm/src"/*.h "$(DESTDIR)/include"
libc: $(BUILD)/debug/libc.a $(BUILD)/debug/crt0.o
......@@ -52,7 +53,7 @@ $(BUILD)/debug/libc.a: $(SRC)
touch $@
$(BUILD)/debug/crt0.o: $(SRC)
cargo rustc --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
CARGO_INCREMENTAL=0 cargo --verbose --verbose rustc --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
touch $@
$(BUILD)/release/libc.a: $(SRC)
......@@ -60,7 +61,7 @@ $(BUILD)/release/libc.a: $(SRC)
touch $@
$(BUILD)/release/crt0.o: $(SRC)
cargo rustc --release --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
CARGO_INCREMENTAL=0 cargo rustc --release --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
touch $@
$(BUILD)/openlibm: openlibm
......
......@@ -8,7 +8,7 @@ Just search for any invocation of the `unimplemented` macro, and hop in! The ci
## Supported OSes
- RedoxOS
- Redox OS
- Linux
## Supported architectures
......
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MESSAGES 3
#define LC_MONETARY 4
#define LC_NUMERIC 5
#define LC_TIME 6
#ifndef _BITS_SETJMP_H
#define _BITS_SETJMP_H
#ifdef __arch64__
typedef unsigned long jmp_buf[22];
#endif
#ifdef __arm__
typedef unsigned long long jmp_buf[32];
#endif
#ifdef __i386__
typedef unsigned long jmp_buf[6];
#endif
#ifdef __m68k__
typedef unsigned long jmp_buf[39];
#endif
#ifdef __microblaze__
typedef unsigned long jmp_buf[18];
#endif
#ifdef __mips__
typedef unsigned long long jmp_buf[13];
#endif
#ifdef __mips64__
typedef unsigned long long jmp_buf[23];
#endif
#ifdef __mipsn32__
typedef unsigned long long jmp_buf[23];
#endif
#ifdef __or1k__
typedef unsigned long jmp_buf[13];
#endif
#ifdef __powerpc__
typedef unsigned long long jmp_buf[56];
#endif
#ifdef __powerpc64__
typedef uint128_t jmp_buf[32];
#endif
#ifdef __s390x__
typedef unsigned long jmp_buf[18];
#endif
#ifdef __sh__
typedef unsigned long jmp_buf[15];
#endif
#ifdef __x32__
typedef unsigned long long jmp_buf[8];
#endif
#ifdef __x86_64__
typedef unsigned long jmp_buf[8];
#endif
int setjmp(jmp_buf buf);
void longjmp(jmp_buf buf, int value);
#endif /* _SETJMP_H */
#ifndef _BITS_STDIO_H
#define _BITS_STDIO_H
#define EOF (-1)
#define BUFSIZ 1024
#define stdin __stdin()
#define stdout __stdout()
#define stderr __stderr()
int fprintf(FILE * stream, const char * fmt, ...);
int printf(const char * fmt, ...);
int snprintf(char *s, size_t n, const char * fmt, ...);
int sprintf(char *s, const char * fmt, ...);
int fscanf(FILE * stream, const char * fmt, ...);
int scanf(const char * fmt, ...);
int sscanf(const char * input, const char * fmt, ...);
#endif /* _BITS_STDIO_H */
#ifndef _BITS_SYS_WAIT_H
#define _BITS_SYS_WAIT_H
#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
#define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#define WIFCONTINUED(s) ((s) == 0xffff)
#endif /* _BITS_SYS_WAIT_H */
#define OPENLIBM_USE_HOST_FENV_H 1
#include <openlibm.h>
......@@ -6,41 +6,105 @@
#define INT8_MAX 0x7F
typedef signed char int8_t;
#define INT_LEAST8_MIN -0x80
#define INT_LEAST8_MAX 0x7F
typedef signed char int_least8_t;
#define INT_FAST8_MIN -0x80
#define INT_FAST8_MAX 0x7F
typedef signed char int_fast8_t;
#define UINT8_C(value) ((uint8_t) value ## U)
#define UINT8_MIN 0x00
#define UINT8_MAX 0xFF
typedef unsigned char uint8_t;
#define UINT_LEAST8_MIN 0x00
#define UINT_LEAST8_MAX 0xFF
typedef unsigned char uint_least8_t;
#define UINT_FAST8_MIN 0x00
#define UINT_FAST8_MAX 0xFF
typedef unsigned char uint_fast8_t;
#define INT16_C(value) value
#define INT16_MIN -0x8000
#define INT16_MAX 0x7FFF
typedef signed short int16_t;
#define INT_LEAST16_MIN -0x8000
#define INT_LEAST16_MAX 0x7FFF
typedef signed short int_least16_t;
#define INT_FAST16_MIN -0x8000
#define INT_FAST16_MAX 0x7FFF
typedef signed short int_fast16_t;
#define UINT16_C(value) value ## U
#define UINT16_MIN 0x0000
#define UINT16_MAX 0xFFFF
typedef unsigned short uint16_t;
#define UINT_LEAST16_MIN 0x0000
#define UINT_LEAST16_MAX 0xFFFF
typedef unsigned short uint_least16_t;
#define UINT_FAST16_MIN 0x0000
#define UINT_FAST16_MAX 0xFFFF
typedef unsigned short uint_fast16_t;
#define INT32_C(value) value ## L
#define INT32_MIN -0x80000000
#define INT32_MAX 0x7FFFFFFF
typedef signed long int32_t;
#define INT_LEAST32_MIN -0x80000000
#define INT_LEAST32_MAX 0x7FFFFFFF
typedef signed long int_least32_t;
#define INT_FAST32_MIN -0x80000000
#define INT_FAST32_MAX 0x7FFFFFFF
typedef signed long int_fast32_t;
#define UINT32_C(value) value ## UL
#define UINT32_MIN 0x00000000
#define UINT32_MAX 0xFFFFFFFF
typedef unsigned long uint32_t;
#define UINT_LEAST32_MIN 0x00000000
#define UINT_LEAST32_MAX 0xFFFFFFFF
typedef unsigned long uint_least32_t;
#define UINT_FAST32_MIN 0x00000000
#define UINT_FAST32_MAX 0xFFFFFFFF
typedef unsigned long uint_fast32_t;
#define INT64_C(value) value ## LL
#define INT64_MIN -0x8000000000000000
#define INT64_MAX 0x7FFFFFFFFFFFFFFF
typedef signed long long int64_t;
#define INT_LEAST64_MIN -0x8000000000000000
#define INT_LEAST64_MAX 0x7FFFFFFFFFFFFFFF
typedef signed long long int_least64_t;
#define INT_FAST64_MIN -0x8000000000000000
#define INT_FAST64_MAX 0x7FFFFFFFFFFFFFFF
typedef signed long long int_fast64_t;
#define UINT64_C(value) value ## ULL
#define UINT64_MIN 0x0000000000000000
#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
typedef unsigned long long uint64_t;
#define UINT_LEAST64_MIN 0x0000000000000000
#define UINT_LEAST64_MAX 0xFFFFFFFFFFFFFFFF
typedef unsigned long long uint_least64_t;
#define UINT_FAST64_MIN 0x0000000000000000
#define UINT_FAST64_MAX 0xFFFFFFFFFFFFFFFF
typedef unsigned long long uint_fast64_t;
#define INTMAX_C(value) value ## LL
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
......@@ -61,4 +125,6 @@ typedef uint64_t uintptr_t;
#define SIZE_MAX UINT64_MAX
typedef int sig_atomic_t;
#endif /* _STDINT_H */
......@@ -35,6 +35,8 @@ typedef int clockid_t;
typedef void* timer_t;
typedef unsigned long int blkcnt_t;
#ifdef __linux__
#define _SC_PAGE_SIZE 30
#endif
......
Subproject commit 31b781a287748c10671a6c7e4415093d2dd4df4a
Subproject commit 311db75868ff73089a3ab46258ce8cdb2d1670f9
nightly-2018-03-04
nightly-2018-06-19
......@@ -46,3 +46,36 @@ int sprintf(char *s, const char * fmt, ...) {
va_end(ap);
return ret;
}
int vfscanf(FILE * stream, const char * fmt, va_list ap);
int fscanf(FILE * stream, const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vfscanf(stream, fmt, ap);
va_end(ap);
return ret;
}
int vscanf(const char * fmt, va_list ap);
int scanf(const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vscanf(fmt, ap);
va_end(ap);
return ret;
}
int vsscanf(const char * input, const char * fmt, va_list ap);
int sscanf(const char * input, const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vsscanf(input, fmt, ap);
va_end(ap);
return ret;
}
......@@ -2,8 +2,9 @@
#![no_std]
#![feature(asm)]
#![feature(lang_items)]
#![feature(linkage)]
#![feature(naked_functions)]
#![feature(panic_implementation)]
extern crate platform;
......@@ -59,7 +60,14 @@ pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! {
platform::exit(main(argc, argv));
}
#[lang = "panic_fmt"]
pub extern "C" fn rust_begin_unwind(_fmt: ::core::fmt::Arguments, _file: &str, _line: u32) -> ! {
loop {}
#[panic_implementation]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_fmt(format_args!("RELIBC CRT0 PANIC: {}\n", pi));
platform::exit(1);
}
sys_includes = ["sys/types.h"]
sys_includes = ["stdint.h", "sys/types.h"]
include_guard = "_FENV_H"
language = "C"
......
#![no_std]
#![feature(lang_items)]
#![feature(linkage)]
#![feature(panic_implementation)]
extern crate compiler_builtins;
//extern crate compiler_builtins;
extern crate platform;
pub extern crate ctype;
......@@ -10,8 +12,10 @@ pub extern crate fcntl;
pub extern crate fenv;
pub extern crate float;
pub extern crate grp;
pub extern crate locale;
pub extern crate netinet;
pub extern crate semaphore;
pub extern crate setjmp;
pub extern crate stdio;
pub extern crate stdlib;
pub extern crate string;
......@@ -25,22 +29,41 @@ pub extern crate time;
pub extern crate unistd;
pub extern crate wctype;
#[cfg(not(test))]
#[panic_implementation]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_fmt(format_args!("RELIBC PANIC: {}\n", pi));
platform::exit(1);
}
#[cfg(not(test))]
#[lang = "eh_personality"]
#[no_mangle]
#[linkage = "weak"]
pub extern "C" fn rust_eh_personality() {}
#[lang = "panic_fmt"]
#[cfg(not(test))]
#[lang = "oom"]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn rust_begin_unwind(fmt: ::core::fmt::Arguments, file: &str, line: u32) -> ! {
pub extern fn rust_oom(layout: ::core::alloc::Layout) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_fmt(format_args!("{}:{}: {}\n", file, line, fmt));
let _ = w.write_fmt(format_args!("RELIBC OOM: {} bytes aligned to {} bytes\n", layout.size(), layout.align()));
platform::exit(1);
}
#[cfg(not(test))]
#[allow(non_snake_case)]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn _Unwind_Resume() -> ! {
use core::fmt::Write;
......
[package]
name = "locale"
version = "0.1.0"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
build = "build.rs"
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }