musl-cross-make:bootstrap-1 (2878B)
1 {% extends "genlinks" %} 2 {%- block script %} 3 #@pragma:nosandbox 4 #@pragma:nopath 5 #+{{pkg_install_name("musl-cross-make:bootstrap-0")}} 6 #@git:{{submodule.current["musl-cross-make"]}}:musl-cross-make 7 #@sha256:ab66fc2d1c3ec0359b8e08843c9f33b63e8707efdff5e4cc5c200eae24722cbf:musl-cross-make/sources/binutils-2.33.1.tar.xz 8 #@sha256:75d5d255a2a273b6e651f82eecfabf6cbcd8eaeae70e86b417384c8f4a58d8d3:musl-cross-make/sources/config.sub 9 #@sha256:d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b:musl-cross-make/sources/gcc-11.2.0.tar.xz 10 #@sha256:5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2:musl-cross-make/sources/gmp-6.1.2.tar.bz2 11 #@sha256:dc7abf734487553644258a3822cfd429d74656749e309f2b25f09f4282e05588:musl-cross-make/sources/linux-headers-4.19.88-2.tar.xz 12 #@sha256:6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e:musl-cross-make/sources/mpc-1.1.0.tar.gz 13 #@sha256:c05e3f02d09e0e9019384cdd58e0f19c64e6db1fd6f5ecf77b4b1c61ca253acc:musl-cross-make/sources/mpfr-4.0.2.tar.bz2 14 #@sha256:a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4:musl-cross-make/sources/musl-1.2.5.tar.gz 15 16 : ${JOBS:=1} 17 bootstrap={{versions}}/musl-cross-make.{{pkg_sha256("musl-cross-make:bootstrap-0")}} 18 "$bootstrap/bin/{{triplet}}-gcc" --version 19 20 # For validating the compiler 21 printf '%s\n' 'int main(void) { return 0; }' >true.c 22 23 printf '%s\n' >musl-cross-make/config.mak \ 24 "OUTPUT=${pthbs_destdir%/}{{versions}}/$pthbs_package" \ 25 'GCC_VER=11.2.0' \ 26 "TARGET={{triplet}}" \ 27 'st=-static --static' \ 28 'fl=-g0 -O2' \ 29 "bbin=$bootstrap/bin" \ 30 'COMMON_CONFIG += CFLAGS="${fl}" CXXFLAGS="${fl}" FFLAGS="${fl}" LDFLAGS="-s ${st}"' \ 31 'COMMON_CONFIG += CC="${bbin}/{{triplet}}-gcc ${st}" CXX="${bbin}/{{triplet}}-g++ ${st}"' 32 33 touch musl-cross-make/sources/* 34 35 # Patch linker path for dynamic executables 36 make -C musl-cross-make gcc-11.2.0 37 sed -i -e 's|/lib/ld-musl-|{{versions}}/'"$pthbs_package"'/{{triplet}}/lib/ld-musl-|' musl-cross-make/gcc-11.2.0/gcc/config/*/linux*.h 38 39 export PATH="$bootstrap/bin:$PATH" 40 {{make}} -C musl-cross-make 41 make -C musl-cross-make install 42 43 # Override linker symlink 44 for linkname in "${pthbs_destdir%/}"'{{versions}}/'"$pthbs_package"'/{{triplet}}/lib/'ld-musl-*so*; do 45 ln -s -f libc.so "$linkname" 46 done 47 48 # Validate the compiler 49 "${pthbs_destdir%/}"'{{versions}}'"/$pthbs_package/bin/"'{{triplet}}-gcc' --version 50 "${pthbs_destdir%/}"'{{versions}}'"/$pthbs_package/bin/"'{{triplet}}-gcc' -o true true.c 51 "${pthbs_destdir%/}"'{{versions}}'"/$pthbs_package/bin/"'{{triplet}}-readelf' --string-dump=.interp true >true.linker 52 grep -F "$pthbs_package" true.linker 53 54 {% endblock %} 55 {% block genlinks_begin %} 56 x["./bin/{{triplet}}-g++"]=1 57 x["./bin/{{triplet}}-gcc"]=1 58 {% endblock %} 59 {% block rules %} 60 $2 == "bin" && $3 ~ /^{{triplet}}-/ { target=$3; sub("{{triplet}}-", "", target); link("./command/" target) } 61 {% endblock -%}