musl-cross-make/patches/gcc-4.9.3/arm.diff
rofl0r df82dd95d8 add patches for gcc 4.9.3
at least mips support is broken, but microblazed and possibly other
archs work.

while building mips the following error was encountered:
Mode = sf\|df
Suffix = si\|2\|3
/tmp/musl-cross-make/gcc-4.9.3/build0/./gcc/xgcc -B/tmp/musl-cross-make/gcc-4.9.3/build0/./gcc/ -B/tmp/musl-cross-make/output/mips-linux-musl/bin/ -B/tmp/musl-cross-make/output/mips-linux-musl/lib/ -isystem /tmp/musl-cross-make/output/mips-linux-musl/include -isystem /tmp/musl-cross-make/output/mips-linux-musl/sys-include    -g -O2 -O0 -g0 -minterlink-mips16 -O2  -g -O2 -O0 -g0 -minterlink-mips16 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fPIC -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include  -DHAVE_CC_TLS  -o subsf3.o -MT subsf3.o -MD -MP -MF subsf3.dep subsf3 -c ../../../libgcc/config/hardfp.c -fvisibility=hidden -DHIDE_EXPORTS -Wno-missing-prototypes
xgcc: error: subsf3: No such file or directory
make[3]: *** [subsf3.o] Error 1

this seems like a bug in a shell command that's invoked during the build,
possibly a sed command using GNU-only syntax.
2015-11-02 15:36:27 +00:00

47 lines
1.6 KiB
Diff

# HG changeset patch
# Parent 92d83561106d17ca896328fcb4ec36cd4e2e9e16
Support for arm-linux-musl.
diff -r 92d83561106d gcc/config/arm/linux-eabi.h
--- a/gcc/config/arm/linux-eabi.h Sun Jul 26 15:32:23 2015 -0400
+++ b/gcc/config/arm/linux-eabi.h Sun Jul 26 15:32:25 2015 -0400
@@ -77,6 +77,23 @@
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+/* For ARM musl currently supports four dynamic linkers:
+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
+ musl does not support the legacy OABI mode.
+ All the dynamic linkers live in /lib.
+ We default to soft-float, EL. */
+#undef MUSL_DYNAMIC_LINKER
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
+#else
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
+#endif
+#define MUSL_DYNAMIC_LINKER \
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
+
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC
diff -r 92d83561106d libitm/config/arm/hwcap.cc
--- a/libitm/config/arm/hwcap.cc Sun Jul 26 15:32:23 2015 -0400
+++ b/libitm/config/arm/hwcap.cc Sun Jul 26 15:32:25 2015 -0400
@@ -40,7 +40,11 @@
#ifdef __linux__
#include <unistd.h>
+#ifdef __GLIBC__
#include <sys/fcntl.h>
+#else
+#include <fcntl.h>
+#endif
#include <elf.h>
static void __attribute__((constructor))