• Home
  • Raw
  • Download

Lines Matching +full:binutils +full:- +full:powerpc64 +full:- +full:linux +full:- +full:gnu

3 # Script to build all cross and native compilers supported by musl-libc.
8 if [ ! -d litecross ]
10 echo Run this script in musl-cross-make directory to make "ccc" directory.
12 echo " "git clone https://github.com/richfelker/musl-cross-make
13 echo " "cd musl-cross-make
14 echo ' ~/toybox/scripts/mcm-buildall.sh'
19 # in a gcc tuple TARGET-linux-muslEXTRA with CONFIG appended to $GCC_CONFIG
20 # (and thus the gcc ./configure command line). So i686:: builds i686-linux-musl
21 # and sh2eb::fdpic:--with-cpu=mj2 builds sh2eb-linux-muslfdpic adding
22 # --with-cpu=mj2 to the gcc ./configure command line. @RENAME (if present)
26 armv4l:eabihf:"--with-arch=armv5t --with-float=soft"
27 "armv5l:eabihf:--with-arch=armv5t --with-fpu=vfpv2 --with-float=hard"
28 "armv7l:eabihf:--with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard"
29 "armv7m:eabi:--with-arch=armv7-m --with-mode=thumb --disable-libatomic --enable-default-pie"
30 armv7r:eabihf:"--with-arch=armv7-r --enable-default-pie"
32 powerpc64:: powerpc64le:: riscv32:: riscv64:: s390x::
33 sh2eb:fdpic:--with-cpu=mj2
34 sh4::--enable-incomplete-targets sh4eb::--enable-incomplete-targets
35 x86_64::--with-mtune=nocona x86_64@x32:x32:
40 : ${BOOTSTRAP:=$(uname -m)} ${OUTPUT:="$PWD/ccc"}
43 # with full instead of partial -host compiler (missing threads and NLS and such)
45 for i in $(seq 0 $((${#TARGETS[@]}-1)));
53 [ -z "$TEMP" ] && { echo unknown target "$BOOTSTRAP"; exit 1; }
57 rm -rf ccc host-* *.log # Not gonna rm -rf "$OUTPUT" blindly, could be $HOME
69 OUTPUT="$PWD/host-$TARGET"
75 [ "$TARGET" = "$HOST" ] && LP="$PWD/host-$HOST/bin:$LP" &&
76 GCC_CONFIG="--build=${TARGET%%-*}-donotmatch-linux $GCC_CONFIG"
79 LP="$OUTPUT/$HOST-cross/bin:$LP"
83 LP="$OUTPUT/${RENAME:-$TARGET}-cross/bin:$LP"
84 [ -z "$(PATH="$LP" which $TARGET-cc)" ] &&
85 echo "no $TARGET-cc in $LP" && return
87 COMMON_CONFIG="CC=\"$HOST-gcc -static --static\" CXX=\"$HOST-g++ -static --static\""
88 export -n HOST
89 OUTPUT="$OUTPUT/${RENAME:-$TARGET}-$TYPE"
93 if [ -e "$OUTPUT.sqf" ] || [ -e "$OUTPUT/bin/$TARGET-cc" ] ||
94 [ -e "$OUTPUT/bin/cc" ]
101 echo === building $TARGET-$TYPE
102 echo -en "\033]2;$TARGET-$TYPE\007"
104 rm -rf build/"$TARGET" "$OUTPUT" &&
105 set -x &&
107 …GCC_CONFIG="--disable-nls --disable-libquadmath --disable-decimal-float --disable-multilib --enabl…
108 COMMON_CONFIG="CFLAGS=\"$CFLAGS -g0 -O2\" CXXFLAGS=\"$CXXFLAGS -g0 -O2\" \
109 LDFLAGS=\"$LDFLAGS -s\" $COMMON_CONFIG" install -j$(nproc) || exit 1
111 echo -e '#ifndef __MUSL__\n#define __MUSL__ 1\n#endif' \
114 if [ ! -z "$RENAME" ] && [ "$TYPE" == cross ]
116 CONTEXT="output/$RENAME-cross/bin"
117 for i in "$CONTEXT/$TARGET-"*
119 X="$(echo $i | sed "s@.*/$TARGET-\([^-]*\)@\1@")"
120 ln -sf "$TARGET-$X" "$CONTEXT/$RENAME-$X"
126 [ -z "$TYPE" ] && {
127 [ -e musl-git-master ] && mv musl-git-master keep-this-dir
129 [ -e keep-this-dir ] && mv keep-this-dir musl-git-master
137 ln -s . "$OUTPUT/usr" || exit 1
138 [ ! -z "$(which mksquashfs 2>/dev/null)" ] &&
139 mksquashfs "$OUTPUT" "$OUTPUT.sqf" -all-root &&
140 [ -z "$CLEANUP" ] && rm -rf "$OUTPUT"
148 PART2=${1:$((${#PART1}+1)):$((${#1}-${#PART3}-${#PART1}-2))}
154 TARGET=${PART1}-linux-musl${PART2}
157 # Expand compressed target into binutils/gcc "tuple" and call make_toolchain
162 [ -z "$NOCLEAN" ] && rm -rf build
167 make_toolchain 2>&1 | tee "$OUTPUT"/log/${RENAME:-$PART1}-${TYPE}.log
173 # musl-cross-make commit fe915821b652 has been current for a year and a half,
177 sed -i 's/mirror//;s/\(LINUX_VER =\).*/\1 6.8/;s/\(GCC_VER =\).*/\1 11.2.0/' \
179 echo 'c9ab5b95c0b8e9e41290d3fc53b4e5cb2e8abb75 linux-6.8.tar.xz' > \
180 hashes/linux-6.8.tar.xz.sha1 &&
182 # and it whack-a-moles how to download kernels by version for some reason.
183 touch -d @1 hashes/linux-6.8.tar.xz.sha1 &&
184 sed -i 's/\(.*linux-\)3\(.*\)v3.x/\16\2v6.x/' Makefile &&
187 sed -i -e 's/--enable-fdpic$/& --enable-twoprocess/' \
188 -e '/or1k/!s/^\(TARGET_ARCH_MANGLED = \)\(.*\)/\1$(patsubst or1k,openrisc,\2)/' \
192 # fork() on nommu builds that always returns -ENOSYS at runtime. Rip it out.
195 PP=patches/musl-"$(sed -n 's/MUSL_VER[ \t]*=[ \t]*//p' Makefile)" &&
196 mkdir -p "$PP" &&
197 cat > "$PP"/0001-nommu.patch << 'EOF' &&
198 --- a/src/legacy/daemon.c
200 @@ -17,3 +17,3 @@
202 - switch(fork()) {
205 @@ -25,3 +25,3 @@
207 - switch(fork()) {
210 --- a/src/misc/forkpty.c
212 @@ -8,2 +8,3 @@
216 @@ -57,1 +58,2 @@
219 --- a/src/misc/wordexp.c
221 @@ -25,2 +25,3 @@
225 @@ -177,2 +178,3 @@
229 --- a/src/process/fork.c
231 @@ -7,2 +7,3 @@
235 @@ -37,1 +38,2 @@
238 --- a/Makefile
240 @@ -100,3 +100,3 @@
242 - sed -n -e s/__NR_/SYS_/p < $< >> $@
243 + sed -e s/__NR_/SYS_/ < $< >> $@
245 --- a/arch/sh/bits/syscall.h.in
247 @@ -2,3 +2,5 @@
256 tee $(for i in patches/gcc-*; do echo $i/099-vfork.patch; done) > /dev/null << 'EOF'
257 --- gcc-8.3.0/fixincludes/procopen.c 2005-08-14 19:50:43.000000000 -0500
258 +++ gcc-bak/fixincludes/procopen.c 2020-02-06 23:27:15.408071708 -0600
259 @@ -116,3 +116,3 @@
261 - ch_id = fork ();
266 # Fix a gcc bug that breaks x86-64 build in gcc 11.2.0,
267 # from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017#c20
269 PP=patches/gcc-"$(sed -n 's/GCC_VER[ \t]*=[ \t]*//p' Makefile)" &&
270 mkdir -p "$PP" &&
271 cat > "$PP"/0006-fixinc.patch << 'EOF' &&
272 diff -ruN gcc-11.2.0.orig/configure gcc-11.2.0/configure
273 --- gcc-11.2.0.orig/configure 2021-07-28 01:55:06.628278148 -0500
274 +++ gcc-11.2.0/configure 2023-11-17 03:07:53.819283027 -0600
275 @@ -16478,7 +16478,7 @@
279 -RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
280 +RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
282 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ar" >&5
284 diff -ruN gcc-11.2.0.orig/configure.ac gcc-11.2.0/configure.ac
285 --- gcc-11.2.0.orig/configure.ac 2021-07-28 01:55:06.628278148 -0500
286 +++ gcc-11.2.0/configure.ac 2023-11-17 03:08:05.975282593 -0600
287 @@ -3520,7 +3520,7 @@
291 -RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
292 +RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
294 GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
295 GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
303 mkdir -p "$OUTPUT"/log
307 # musl-libc, because glibc doesn't fully support static linking and dynamic
309 make_tuple "${TARGETS[0]}" host 2>&1 | tee -a "$OUTPUT/log/$BOOTSTRAP"-host.log
313 if [ $# -gt 0 ]
324 for i in $(seq 0 $((${#TARGETS[@]}-1)))