Merge branch 'fix-libm' into 'master'
Strip conflicting symbols from compiler builtins See merge request redox-os/relibc!734
This commit is contained in:
@@ -201,6 +201,7 @@ $(BUILD)/debug/libc.a: $(BUILD)/debug/librelibc.a $(BUILD)/openlibm/libopenlibm.
|
||||
$(BUILD)/debug/librelibc.a: $(SRC)
|
||||
$(CARGO) rustc $(CARGOFLAGS) -- --emit link=$@ -g -C debug-assertions=no $(RUSTCFLAGS)
|
||||
./renamesyms.sh "$@" "$(BUILD)/debug/deps/"
|
||||
./stripcore.sh "$@"
|
||||
touch $@
|
||||
|
||||
$(BUILD)/debug/crt0.o: $(SRC)
|
||||
@@ -238,6 +239,7 @@ $(BUILD)/release/librelibc.a: $(SRC)
|
||||
# TODO: Better to only allow a certain whitelisted set of symbols? Perhaps
|
||||
# use some cbindgen hook, specify them manually, or grep for #[unsafe(no_mangle)].
|
||||
./renamesyms.sh "$@" "$(BUILD)/release/deps/"
|
||||
./stripcore.sh "$@"
|
||||
touch $@
|
||||
|
||||
$(BUILD)/release/crt0.o: $(SRC)
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script exists as a workaround for https://github.com/rust-lang/rust/issues/142119
|
||||
|
||||
set -e
|
||||
|
||||
target=$1
|
||||
|
||||
if [ -z "$target" ]; then
|
||||
echo "Usage:\n\t./stripcore.sh TARGET"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for sym in cbrtf ceilf copysignf fabsf fdimf floorf fmaxf fminf fmofd rintf roundf sqrtf truncf \
|
||||
cbrt ceil copysign fabs fdim floor fmax fmin fmod rint round sqrt trunc; do \
|
||||
objcopy --globalize-symbol=$sym --strip-symbol=$sym "$target"; \
|
||||
done
|
||||
Reference in New Issue
Block a user