pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

musl-cross-make:bootstrap-0 (2489B)


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