Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'musl-gcc'

  • Loading branch information...
commit ce2c5c9122ad672ffc5fa6e39ea68addf721f6a9 2 parents 9ee730c + c13ecf6
@rofl0r rofl0r authored
Showing with 62 additions and 1 deletion.
  1. +54 −0 KEEP/musl-gcc
  2. +8 −1 pkg/musl
View
54 KEEP/musl-gcc
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+libc_prefix="PPPP/"
+ldso_pathname="PPPP/lib/ld-musl-AAAA.so.1"
+gcc=rawcc
+libc_lib=$libc_prefix/lib
+libc_inc=$libc_prefix/include
+libc_crt="$libc_lib/crt1.o"
+libc_start="$libc_lib/crti.o"
+libc_end="$libc_lib/crtn.o"
+
+tmp_specs=$HOME/.specs.tmp.$$
+printf '
+%%rename cpp_options old_cpp_options
+
+*cpp_options:
+-nostdinc -isystem %s %%(old_cpp_options)
+
+*cc1:
+%%(cc1_cpu) -nostdinc -isystem %s
+
+*link_libgcc:
+-L%s
+
+*libgcc:
+libgcc.a%%s %%:if-exists(libgcc_eh.a%%s)
+
+*startfile:
+%%{!shared: %s} %s %%{shared|pie:crtbeginS.o%%s;:crtbegin.o%%s}
+
+*endfile:
+%%{shared|pie:crtendS.o%%s;:crtend.o%%s} %s
+
+%%rename link old_link
+
+*link:
+%%(old_link) -dynamic-linker %s -nostdlib
+
+*esp_link:
+
+
+*esp_options:
+
+
+*esp_cpp_options:
+
+
+' \
+ "$libc_inc" "$libc_inc" "$libc_lib" "$libc_crt" "$libc_start" "$libc_end" "$ldso_pathname" > "$tmp_specs" || exit 1
+
+exec 3<"$tmp_specs"
+rm -f "$tmp_specs"
+
+exec "$gcc" -Werror-implicit-function-declaration -specs=/proc/self/fd/3 "$@"
View
9 pkg/musl
@@ -30,6 +30,13 @@ make clean
make CC="$TC_PATH/bin/gcc" -j$MAKE_THREADS || exit 1
make DESTDIR="$TC_PATH" install || exit 1
+musl_gcc="$TC_PATH/bin/musl-gcc"
+
+cp "$K/musl-gcc" "$musl_gcc"
+chmod +x "$musl_gcc"
+sed -i "s,AAAA,$A," "$musl_gcc"
+sed -i "s,PPPP,$R," "$musl_gcc"
+
#remove dependency on libgcc_eh, which doesnt get built
#when gcc is built using --disable-shared
-sed -i 's,-lgcc_eh ,,' $TC_PATH/bin/musl-gcc
+#sed -i 's,-lgcc_eh ,,' $TC_PATH/bin/musl-gcc
Please sign in to comment.
Something went wrong with that request. Please try again.