Commit 6c98b61e authored by Yonggang Luo's avatar Yonggang Luo
Browse files

rename to RUBLIC for not conflict with relibc

parent 8a4f08cf
Pipeline #8669 failed with stages
in 1 minute and 13 seconds
......@@ -20,7 +20,7 @@ any optimisation.
## Code style
We have a `rustfmt.toml` in the root directory of relibc. Please run `./fmt.sh`
We have a `rustfmt.toml` in the root directory of rulibc. Please run `./fmt.sh`
before sending in any merge requests as it will automatically format your code.
With regards to general style:
......@@ -40,7 +40,7 @@ This is so we can guarantee that everything works across platforms. While it is
generally accepted these days that an `int` has 32 bits (which matches against
an `i32`), some platforms have `int` as having 16 bits, and others have long as
being 32 bits instead of 64. If you use the types in platform, then we can
guarantee that your code will "just work" should we port relibc to a different
guarantee that your code will "just work" should we port rulibc to a different
architecture.
### Use our internal functions
......@@ -57,7 +57,7 @@ If you have sent us a merge request, first of all, thanks for taking your time
to help us!
The first thing to note is that we do most of our development on our
[GitLab server](https://gitlab.redox-os.org/redox-os/relibc), and as such it is
[GitLab server](https://gitlab.redox-os.org/redox-os/rulibc), and as such it is
possible that none of the maintainers will see your merge request if it is
opened on GitHub.
......@@ -112,12 +112,12 @@ Running tests is an important part in trying to find bugs. Before opening a
merge request, we ask that you test on your own machine to make sure there are
no regressions.
You can run tests with `make test` in the root directory of relibc to compile
relibc, compile the tests and run them. This *will* print a lot of output to
You can run tests with `make test` in the root directory of rulibc to compile
rulibc, compile the tests and run them. This *will* print a lot of output to
stdout, so be warned!
You can test against verified correct output with `make verify` in the tests
directory. You will need to manually create the correct output and put it in the
tests/expected directory. Running any `make` commands in the tests directory
will ***not*** rebuild relibc, so you'll need to go back to the root directory
if you need to rebuild relibc.
will ***not*** rebuild rulibc, so you'll need to go back to the root directory
if you need to rebuild rulibc.
This diff is collapsed.
[package]
name = "relibc"
name = "rulibc"
version = "0.1.0"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
authors = ["Yonggang Luo <luoyonggang@gmail.com>", "Jeremy Soller <jackpot51@gmail.com>"]
edition = "2018"
[lib]
name = "relibc"
name = "rulibc"
crate-type = ["staticlib"]
bench = false
test = false
......
......@@ -117,7 +117,7 @@ test: sysroot
# Debug targets
$(BUILD)/debug/libc.a: $(BUILD)/debug/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/debug/libc.a: $(BUILD)/debug/librulibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
echo "create $@" > "$@.mri"
for lib in $^; do\
echo "addlib $$lib" >> "$@.mri"; \
......@@ -126,10 +126,10 @@ $(BUILD)/debug/libc.a: $(BUILD)/debug/librelibc.a $(BUILD)/pthreads-emb/libpthre
echo "end" >> "$@.mri"
$(AR) -M < "$@.mri"
$(BUILD)/debug/libc.so: $(BUILD)/debug/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/debug/libc.so: $(BUILD)/debug/librulibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(CC) -nostdlib -shared -Wl,--allow-multiple-definition -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,-soname,libc.so.6 -o $@
$(BUILD)/debug/librelibc.a: $(SRC)
$(BUILD)/debug/librulibc.a: $(SRC)
CARGO_INCREMENTAL=0 $(CARGO) rustc $(CARGOFLAGS) -- --emit link=$@ $(RUSTCFLAGS)
# FIXME: Remove the following line. It's only required since xargo automatically links with compiler_builtins, which conflicts with the compiler_builtins that rustc always links with.
$(OBJCOPY) $@ $(WEAKEN_SYMBOLS)
......@@ -156,7 +156,7 @@ $(BUILD)/debug/ld_so: $(BUILD)/debug/ld_so.o $(BUILD)/debug/crti.o $(BUILD)/debu
# Release targets
$(BUILD)/release/libc.a: $(BUILD)/release/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/release/libc.a: $(BUILD)/release/librulibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
echo "create $@" > "$@.mri"
for lib in $^; do\
echo "addlib $$lib" >> "$@.mri"; \
......@@ -165,10 +165,10 @@ $(BUILD)/release/libc.a: $(BUILD)/release/librelibc.a $(BUILD)/pthreads-emb/libp
echo "end" >> "$@.mri"
$(AR) -M < "$@.mri"
$(BUILD)/release/libc.so: $(BUILD)/release/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/release/libc.so: $(BUILD)/release/librulibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(CC) -nostdlib -shared -Wl,--allow-multiple-definition -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,-soname,libc.so.6 -o $@
$(BUILD)/release/librelibc.a: $(SRC)
$(BUILD)/release/librulibc.a: $(SRC)
CARGO_INCREMENTAL=0 $(CARGO) rustc --release $(CARGOFLAGS) -- --emit link=$@ $(RUSTCFLAGS)
$(OBJCOPY) $@ $(WEAKEN_SYMBOLS)
touch $@
......@@ -202,7 +202,7 @@ $(BUILD)/openlibm: openlibm
ln -s -r $@.partial $@
touch $@
$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm $(BUILD)/release/librelibc.a
$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm $(BUILD)/release/librulibc.a
$(MAKE) CC=$(CC) CPPFLAGS="-fno-stack-protector -I $(shell pwd)/include -I $(shell pwd)/target/include" -C $< libopenlibm.a
$(BUILD)/pthreads-emb: pthreads-emb
......@@ -213,5 +213,5 @@ $(BUILD)/pthreads-emb: pthreads-emb
ln -s -r $@.partial $@
touch $@
$(BUILD)/pthreads-emb/libpthread.a: $(BUILD)/pthreads-emb $(BUILD)/release/librelibc.a
$(BUILD)/pthreads-emb/libpthread.a: $(BUILD)/pthreads-emb $(BUILD)/release/librulibc.a
$(MAKE) CC=$(CC) CFLAGS="-fno-stack-protector -I $(shell pwd)/include -I $(shell pwd)/target/include" -C $< libpthread.a
......@@ -73,9 +73,9 @@ fn main() {
.expect("src/c directory missing")
.map(|res| res.expect("read_dir error").path()),
)
.compile("relibc_c");
.compile("rulibc_c");
println!("cargo:rustc-link-lib=static=relibc_c");
println!("cargo:rustc-link-lib=static=rulibc_c");
}
//
......
......@@ -12,7 +12,7 @@ pub unsafe extern "C" fn _start() {
#[cfg(target_arch = "x86_64")]
llvm_asm!("mov rdi, rsp
and rsp, 0xFFFFFFFFFFFFFFF0
call relibc_start"
call rulibc_start"
:
:
:
......@@ -20,7 +20,7 @@ pub unsafe extern "C" fn _start() {
);
#[cfg(target_arch = "aarch64")]
llvm_asm!("mov x0, sp
bl relibc_start"
bl rulibc_start"
:
:
:
......@@ -33,7 +33,7 @@ pub unsafe extern "C" fn _start() {
#[no_mangle]
pub unsafe extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
extern "C" {
fn relibc_panic(pi: &::core::panic::PanicInfo) -> !;
fn rulibc_panic(pi: &::core::panic::PanicInfo) -> !;
}
relibc_panic(pi)
rulibc_panic(pi)
}
......@@ -54,7 +54,7 @@ global_asm!(
#[no_mangle]
pub unsafe extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
extern "C" {
fn relibc_panic(pi: &::core::panic::PanicInfo) -> !;
fn rulibc_panic(pi: &::core::panic::PanicInfo) -> !;
}
relibc_panic(pi)
rulibc_panic(pi)
}
......@@ -44,7 +44,7 @@ global_asm!(
#[no_mangle]
pub unsafe extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
extern "C" {
fn relibc_panic(pi: &::core::panic::PanicInfo) -> !;
fn rulibc_panic(pi: &::core::panic::PanicInfo) -> !;
}
relibc_panic(pi)
rulibc_panic(pi)
}
sys_includes = []
include_guard = "_RELIBC_AIO_H"
include_guard = "_RULIBC_AIO_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = ["stdint.h", "sys/types.h"]
include_guard = "_RELIBC_FENV_H"
include_guard = "_RULIBC_FENV_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = []
include_guard = "_RELIBC_TEMPLATE_H"
include_guard = "_RULIBC_TEMPLATE_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = []
include_guard = "_RELIBC_WCTYPE_H"
include_guard = "_RULIBC_WCTYPE_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = ["bits/assert.h"]
include_guard = "_RELIBC_ASSERT_H"
include_guard = "_RULIBC_ASSERT_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = ["bits/ctype.h"]
include_guard = "_RELIBC_CTYPE_H"
include_guard = "_RULIBC_CTYPE_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = ["sys/types.h"]
include_guard = "_RELIBC_DIRENT_H"
include_guard = "_RULIBC_DIRENT_H"
language = "C"
style = "Both"
trailer = "#include <bits/dirent.h>"
......
sys_includes = []
include_guard = "_RELIBC_DLFCN_H"
include_guard = "_RULIBC_DLFCN_H"
language = "C"
style = "Type"
no_includes = true
......
sys_includes = ["bits/errno.h"]
include_guard = "_RELIBC_ERRNO_H"
include_guard = "_RULIBC_ERRNO_H"
language = "C"
style = "Tag"
no_includes = true
......
sys_includes = ["stdarg.h", "sys/types.h"]
include_guard = "_RELIBC_FCNTL_H"
include_guard = "_RULIBC_FCNTL_H"
trailer = "#include <bits/fcntl.h>"
language = "C"
style = "Tag"
......
sys_includes = ["sys/types.h", "bits/float.h"]
include_guard = "_RELIBC_FLOAT_H"
include_guard = "_RULIBC_FLOAT_H"
language = "C"
style = "Tag"
no_includes = true
......
include_guard = "_RELIBC_FNMATCH_H"
include_guard = "_RULIBC_FNMATCH_H"
language = "C"
style = "Tag"
no_includes = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment