Skip to content

Commit

Permalink
initial stab at musl-cross-make with gcc 9.2.0 and binutils 2.33.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwoodsmall committed Jan 23, 2020
1 parent 1539fcd commit 572e594
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
4 changes: 2 additions & 2 deletions musl-cross-make-confs/Makefile.arch_indep
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ endif
ARCH := $(shell uname -m | sed 's/^\(arm\).*/\1/g')

# versions
GCCVER := 8.3.0
BINUTILSVER := 2.32
GCCVER := 9.2.0
BINUTILSVER := 2.33.1
MUSLVER := 1.1.24
ISLVER := 0.21

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--- binutils-2.33.1.PRISTINE/bfd/elf32-arm.c
+++ binutils-2.33.1/bfd/elf32-arm.c
@@ -2259,7 +2259,7 @@

/* The name of the dynamic interpreter. This is put in the .interp
section. */
-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+#define ELF_DYNAMIC_INTERPRETER "/usr/local/crosware/software/statictoolchain/current/arm-linux-musleabihf/lib/ld.so"

/* FDPIC default stack size. */
#define DEFAULT_STACK_SIZE 0x8000
--- binutils-2.33.1.PRISTINE/bfd/elfnn-aarch64.c
+++ binutils-2.33.1/bfd/elfnn-aarch64.c
@@ -2266,7 +2266,7 @@

/* The name of the dynamic interpreter. This is put in the .interp
section. */
-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
+#define ELF_DYNAMIC_INTERPRETER "/usr/local/crosware/software/statictoolchain/current/aarch64-linux-musl/lib/ld.so"

#define AARCH64_MAX_FWD_BRANCH_OFFSET \
(((1 << 25) - 1) << 2)
--- binutils-2.33.1.PRISTINE/bfd/elfxx-x86.c
+++ binutils-2.33.1/bfd/elfxx-x86.c
@@ -27,8 +27,8 @@
/* The name of the dynamic interpreter. This is put in the .interp
section. */

-#define ELF32_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
-#define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
+#define ELF32_DYNAMIC_INTERPRETER "/usr/local/crosware/software/statictoolchain/current/i686-linux-musl/lib/ld.so"
+#define ELF64_DYNAMIC_INTERPRETER "/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/lib/ld.so"
#define ELFX32_DYNAMIC_INTERPRETER "/lib/ldx32.so.1"

bfd_boolean
--- binutils-2.33.1.PRISTINE/ld/emulparams/aarch64linux.sh
+++ binutils-2.33.1/ld/emulparams/aarch64linux.sh
@@ -46,4 +46,4 @@
;;
esac

-ELF_INTERPRETER_NAME=\"/lib/ld-linux-aarch64.so.1\"
+ELF_INTERPRETER_NAME=\"/usr/local/crosware/software/statictoolchain/current/aarch64-linux-musl/lib/ld.so\"
48 changes: 48 additions & 0 deletions musl-cross-make-confs/patches/9999-crosware-ldso_gcc-9.2.0.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--- gcc-9.2.0.PRISTINE/gcc/config/aarch64/aarch64-linux.h
+++ gcc-9.2.0/gcc/config/aarch64/aarch64-linux.h
@@ -21,10 +21,10 @@
#ifndef GCC_AARCH64_LINUX_H
#define GCC_AARCH64_LINUX_H

-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#define GLIBC_DYNAMIC_LINKER "/usr/local/crosware/software/statictoolchain/current/aarch64-linux-musl/lib/ld.so"

#undef MUSL_DYNAMIC_LINKER
-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#define MUSL_DYNAMIC_LINKER "/usr/local/crosware/software/statictoolchain/current/aarch64-linux-musl/lib/ld.so"

#undef ASAN_CC1_SPEC
#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
--- gcc-9.2.0.PRISTINE/gcc/config/arm/linux-eabi.h
+++ gcc-9.2.0/gcc/config/arm/linux-eabi.h
@@ -85,8 +85,7 @@
#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"
+#define MUSL_DYNAMIC_LINKER "/usr/local/crosware/software/statictoolchain/current/arm-linux-musleabihf/lib/ld.so"

/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
--- gcc-9.2.0.PRISTINE/gcc/config/i386/linux.h
+++ gcc-9.2.0/gcc/config/i386/linux.h
@@ -23,4 +23,4 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"

#undef MUSL_DYNAMIC_LINKER
-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
+#define MUSL_DYNAMIC_LINKER "/usr/local/crosware/software/statictoolchain/current/i686-linux-musl/lib/ld.so"
--- gcc-9.2.0.PRISTINE/gcc/config/i386/linux64.h
+++ gcc-9.2.0/gcc/config/i386/linux64.h
@@ -32,8 +32,8 @@
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"

#undef MUSL_DYNAMIC_LINKER32
-#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
+#define MUSL_DYNAMIC_LINKER32 "/usr/local/crosware/software/statictoolchain/current/i686-linux-musl/lib/ld.so"
#undef MUSL_DYNAMIC_LINKER64
-#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/lib/ld.so"
#undef MUSL_DYNAMIC_LINKERX32
#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"

0 comments on commit 572e594

Please sign in to comment.