authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-12 17:45:25-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-12 17:45:55-04:00
log6e25ac2a2bc74aa6ec9b0d369c5583c98d6a1de8
treec570ccf6c2aa0df3df3b1f0772591706a6e3a21b
parentedd6643a26c1c54160babc9568dec9a8f7ed36d6
signaturelock-open Commit is signed but in an unrecognized format.

stage1: update musl libc building code for v1.2.0


2 files changed, 118 insertions(+), 105 deletions(-)

src/install_files.h+79-81
...@@ -80,7 +80,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -80,7 +80,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
80"musl/src/crypt/crypt.c",80"musl/src/crypt/crypt.c",
81"musl/src/crypt/crypt_blowfish.c",81"musl/src/crypt/crypt_blowfish.c",
82"musl/src/crypt/crypt_des.c",82"musl/src/crypt/crypt_des.c",
83"musl/src/crypt/crypt_des.h",
84"musl/src/crypt/crypt_md5.c",83"musl/src/crypt/crypt_md5.c",
85"musl/src/crypt/crypt_r.c",84"musl/src/crypt/crypt_r.c",
86"musl/src/crypt/crypt_sha256.c",85"musl/src/crypt/crypt_sha256.c",
...@@ -90,7 +89,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -90,7 +89,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
90"musl/src/ctype/__ctype_get_mb_cur_max.c",89"musl/src/ctype/__ctype_get_mb_cur_max.c",
91"musl/src/ctype/__ctype_tolower_loc.c",90"musl/src/ctype/__ctype_tolower_loc.c",
92"musl/src/ctype/__ctype_toupper_loc.c",91"musl/src/ctype/__ctype_toupper_loc.c",
93"musl/src/ctype/alpha.h",
94"musl/src/ctype/isalnum.c",92"musl/src/ctype/isalnum.c",
95"musl/src/ctype/isalpha.c",93"musl/src/ctype/isalpha.c",
96"musl/src/ctype/isascii.c",94"musl/src/ctype/isascii.c",
...@@ -117,8 +115,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -117,8 +115,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
117"musl/src/ctype/iswupper.c",115"musl/src/ctype/iswupper.c",
118"musl/src/ctype/iswxdigit.c",116"musl/src/ctype/iswxdigit.c",
119"musl/src/ctype/isxdigit.c",117"musl/src/ctype/isxdigit.c",
120"musl/src/ctype/nonspacing.h",
121"musl/src/ctype/punct.h",
122"musl/src/ctype/toascii.c",118"musl/src/ctype/toascii.c",
123"musl/src/ctype/tolower.c",119"musl/src/ctype/tolower.c",
124"musl/src/ctype/toupper.c",120"musl/src/ctype/toupper.c",
...@@ -126,8 +122,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -126,8 +122,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
126"musl/src/ctype/wcswidth.c",122"musl/src/ctype/wcswidth.c",
127"musl/src/ctype/wctrans.c",123"musl/src/ctype/wctrans.c",
128"musl/src/ctype/wcwidth.c",124"musl/src/ctype/wcwidth.c",
129"musl/src/ctype/wide.h",
130"musl/src/dirent/__dirent.h",
131"musl/src/dirent/alphasort.c",125"musl/src/dirent/alphasort.c",
132"musl/src/dirent/closedir.c",126"musl/src/dirent/closedir.c",
133"musl/src/dirent/dirfd.c",127"musl/src/dirent/dirfd.c",
...@@ -152,7 +146,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -152,7 +146,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
152"musl/src/env/setenv.c",146"musl/src/env/setenv.c",
153"musl/src/env/unsetenv.c",147"musl/src/env/unsetenv.c",
154"musl/src/errno/__errno_location.c",148"musl/src/errno/__errno_location.c",
155"musl/src/errno/__strerror.h",
156"musl/src/errno/strerror.c",149"musl/src/errno/strerror.c",
157"musl/src/exit/_Exit.c",150"musl/src/exit/_Exit.c",
158"musl/src/exit/abort.c",151"musl/src/exit/abort.c",
...@@ -196,55 +189,18 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -196,55 +189,18 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
196"musl/src/fenv/sh/fenv.S",189"musl/src/fenv/sh/fenv.S",
197"musl/src/fenv/x32/fenv.s",190"musl/src/fenv/x32/fenv.s",
198"musl/src/fenv/x86_64/fenv.s",191"musl/src/fenv/x86_64/fenv.s",
199"musl/src/include/arpa/inet.h",
200"musl/src/include/crypt.h",
201"musl/src/include/errno.h",
202"musl/src/include/features.h",
203"musl/src/include/langinfo.h",
204"musl/src/include/pthread.h",
205"musl/src/include/resolv.h",
206"musl/src/include/signal.h",
207"musl/src/include/stdio.h",
208"musl/src/include/stdlib.h",
209"musl/src/include/string.h",
210"musl/src/include/sys/auxv.h",
211"musl/src/include/sys/membarrier.h",
212"musl/src/include/sys/mman.h",
213"musl/src/include/sys/sysinfo.h",
214"musl/src/include/sys/time.h",
215"musl/src/include/time.h",
216"musl/src/include/unistd.h",
217"musl/src/include/wchar.h",
218"musl/src/internal/atomic.h",
219"musl/src/internal/complex_impl.h",
220"musl/src/internal/defsysinfo.c",192"musl/src/internal/defsysinfo.c",
221"musl/src/internal/dynlink.h",
222"musl/src/internal/fdpic_crt.h",
223"musl/src/internal/floatscan.c",193"musl/src/internal/floatscan.c",
224"musl/src/internal/floatscan.h",
225"musl/src/internal/futex.h",
226"musl/src/internal/i386/defsysinfo.s",194"musl/src/internal/i386/defsysinfo.s",
227"musl/src/internal/intscan.c",195"musl/src/internal/intscan.c",
228"musl/src/internal/intscan.h",
229"musl/src/internal/ksigaction.h",
230"musl/src/internal/libc.c",196"musl/src/internal/libc.c",
231"musl/src/internal/libc.h",
232"musl/src/internal/libm.h",
233"musl/src/internal/locale_impl.h",
234"musl/src/internal/lock.h",
235"musl/src/internal/malloc_impl.h",
236"musl/src/internal/procfdname.c",197"musl/src/internal/procfdname.c",
237"musl/src/internal/pthread_impl.h",
238"musl/src/internal/sh/__shcall.c",198"musl/src/internal/sh/__shcall.c",
239"musl/src/internal/shgetc.c",199"musl/src/internal/shgetc.c",
240"musl/src/internal/shgetc.h",
241"musl/src/internal/stdio_impl.h",
242"musl/src/internal/syscall.h",
243"musl/src/internal/syscall_ret.c",200"musl/src/internal/syscall_ret.c",
244"musl/src/internal/vdso.c",201"musl/src/internal/vdso.c",
245"musl/src/internal/version.c",202"musl/src/internal/version.c",
246"musl/src/ipc/ftok.c",203"musl/src/ipc/ftok.c",
247"musl/src/ipc/ipc.h",
248"musl/src/ipc/msgctl.c",204"musl/src/ipc/msgctl.c",
249"musl/src/ipc/msgget.c",205"musl/src/ipc/msgget.c",
250"musl/src/ipc/msgrcv.c",206"musl/src/ipc/msgrcv.c",
...@@ -261,6 +217,7 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -261,6 +217,7 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
261"musl/src/ldso/aarch64/dlsym.s",217"musl/src/ldso/aarch64/dlsym.s",
262"musl/src/ldso/aarch64/tlsdesc.s",218"musl/src/ldso/aarch64/tlsdesc.s",
263"musl/src/ldso/arm/dlsym.s",219"musl/src/ldso/arm/dlsym.s",
220"musl/src/ldso/arm/dlsym_time64.S",
264"musl/src/ldso/arm/find_exidx.c",221"musl/src/ldso/arm/find_exidx.c",
265"musl/src/ldso/arm/tlsdesc.S",222"musl/src/ldso/arm/tlsdesc.S",
266"musl/src/ldso/dl_iterate_phdr.c",223"musl/src/ldso/dl_iterate_phdr.c",
...@@ -271,18 +228,26 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -271,18 +228,26 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
271"musl/src/ldso/dlopen.c",228"musl/src/ldso/dlopen.c",
272"musl/src/ldso/dlsym.c",229"musl/src/ldso/dlsym.c",
273"musl/src/ldso/i386/dlsym.s",230"musl/src/ldso/i386/dlsym.s",
231"musl/src/ldso/i386/dlsym_time64.S",
274"musl/src/ldso/i386/tlsdesc.s",232"musl/src/ldso/i386/tlsdesc.s",
275"musl/src/ldso/m68k/dlsym.s",233"musl/src/ldso/m68k/dlsym.s",
234"musl/src/ldso/m68k/dlsym_time64.S",
276"musl/src/ldso/microblaze/dlsym.s",235"musl/src/ldso/microblaze/dlsym.s",
236"musl/src/ldso/microblaze/dlsym_time64.S",
277"musl/src/ldso/mips/dlsym.s",237"musl/src/ldso/mips/dlsym.s",
238"musl/src/ldso/mips/dlsym_time64.S",
278"musl/src/ldso/mips64/dlsym.s",239"musl/src/ldso/mips64/dlsym.s",
279"musl/src/ldso/mipsn32/dlsym.s",240"musl/src/ldso/mipsn32/dlsym.s",
241"musl/src/ldso/mipsn32/dlsym_time64.S",
280"musl/src/ldso/or1k/dlsym.s",242"musl/src/ldso/or1k/dlsym.s",
243"musl/src/ldso/or1k/dlsym_time64.S",
281"musl/src/ldso/powerpc/dlsym.s",244"musl/src/ldso/powerpc/dlsym.s",
245"musl/src/ldso/powerpc/dlsym_time64.S",
282"musl/src/ldso/powerpc64/dlsym.s",246"musl/src/ldso/powerpc64/dlsym.s",
283"musl/src/ldso/riscv64/dlsym.s",247"musl/src/ldso/riscv64/dlsym.s",
284"musl/src/ldso/s390x/dlsym.s",248"musl/src/ldso/s390x/dlsym.s",
285"musl/src/ldso/sh/dlsym.s",249"musl/src/ldso/sh/dlsym.s",
250"musl/src/ldso/sh/dlsym_time64.S",
286"musl/src/ldso/tlsdesc.c",251"musl/src/ldso/tlsdesc.c",
287"musl/src/ldso/x32/dlsym.s",252"musl/src/ldso/x32/dlsym.s",
288"musl/src/ldso/x86_64/dlsym.s",253"musl/src/ldso/x86_64/dlsym.s",
...@@ -369,30 +334,21 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -369,30 +334,21 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
369"musl/src/linux/xattr.c",334"musl/src/linux/xattr.c",
370"musl/src/locale/__lctrans.c",335"musl/src/locale/__lctrans.c",
371"musl/src/locale/__mo_lookup.c",336"musl/src/locale/__mo_lookup.c",
372"musl/src/locale/big5.h",
373"musl/src/locale/bind_textdomain_codeset.c",337"musl/src/locale/bind_textdomain_codeset.c",
374"musl/src/locale/c_locale.c",338"musl/src/locale/c_locale.c",
375"musl/src/locale/catclose.c",339"musl/src/locale/catclose.c",
376"musl/src/locale/catgets.c",340"musl/src/locale/catgets.c",
377"musl/src/locale/catopen.c",341"musl/src/locale/catopen.c",
378"musl/src/locale/codepages.h",
379"musl/src/locale/dcngettext.c",342"musl/src/locale/dcngettext.c",
380"musl/src/locale/duplocale.c",343"musl/src/locale/duplocale.c",
381"musl/src/locale/freelocale.c",344"musl/src/locale/freelocale.c",
382"musl/src/locale/gb18030.h",
383"musl/src/locale/hkscs.h",
384"musl/src/locale/iconv.c",345"musl/src/locale/iconv.c",
385"musl/src/locale/iconv_close.c",346"musl/src/locale/iconv_close.c",
386"musl/src/locale/jis0208.h",
387"musl/src/locale/ksc.h",
388"musl/src/locale/langinfo.c",347"musl/src/locale/langinfo.c",
389"musl/src/locale/legacychars.h",
390"musl/src/locale/locale_map.c",348"musl/src/locale/locale_map.c",
391"musl/src/locale/localeconv.c",349"musl/src/locale/localeconv.c",
392"musl/src/locale/newlocale.c",350"musl/src/locale/newlocale.c",
393"musl/src/locale/pleval.c",351"musl/src/locale/pleval.c",
394"musl/src/locale/pleval.h",
395"musl/src/locale/revjis.h",
396"musl/src/locale/setlocale.c",352"musl/src/locale/setlocale.c",
397"musl/src/locale/strcoll.c",353"musl/src/locale/strcoll.c",
398"musl/src/locale/strfmon.c",354"musl/src/locale/strfmon.c",
...@@ -401,7 +357,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -401,7 +357,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
401"musl/src/locale/uselocale.c",357"musl/src/locale/uselocale.c",
402"musl/src/locale/wcscoll.c",358"musl/src/locale/wcscoll.c",
403"musl/src/locale/wcsxfrm.c",359"musl/src/locale/wcsxfrm.c",
404"musl/src/malloc/DESIGN",
405"musl/src/malloc/aligned_alloc.c",360"musl/src/malloc/aligned_alloc.c",
406"musl/src/malloc/expand_heap.c",361"musl/src/malloc/expand_heap.c",
407"musl/src/malloc/lite_malloc.c",362"musl/src/malloc/lite_malloc.c",
...@@ -418,7 +373,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -418,7 +373,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
418"musl/src/math/__fpclassifyf.c",373"musl/src/math/__fpclassifyf.c",
419"musl/src/math/__fpclassifyl.c",374"musl/src/math/__fpclassifyl.c",
420"musl/src/math/__invtrigl.c",375"musl/src/math/__invtrigl.c",
421"musl/src/math/__invtrigl.h",
422"musl/src/math/__math_divzero.c",376"musl/src/math/__math_divzero.c",
423"musl/src/math/__math_divzerof.c",377"musl/src/math/__math_divzerof.c",
424"musl/src/math/__math_invalid.c",378"musl/src/math/__math_invalid.c",
...@@ -525,10 +479,8 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -525,10 +479,8 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
525"musl/src/math/exp2.c",479"musl/src/math/exp2.c",
526"musl/src/math/exp2f.c",480"musl/src/math/exp2f.c",
527"musl/src/math/exp2f_data.c",481"musl/src/math/exp2f_data.c",
528"musl/src/math/exp2f_data.h",
529"musl/src/math/exp2l.c",482"musl/src/math/exp2l.c",
530"musl/src/math/exp_data.c",483"musl/src/math/exp_data.c",
531"musl/src/math/exp_data.h",
532"musl/src/math/expf.c",484"musl/src/math/expf.c",
533"musl/src/math/expl.c",485"musl/src/math/expl.c",
534"musl/src/math/expm1.c",486"musl/src/math/expm1.c",
...@@ -579,14 +531,9 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -579,14 +531,9 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
579"musl/src/math/i386/ceil.s",531"musl/src/math/i386/ceil.s",
580"musl/src/math/i386/ceilf.s",532"musl/src/math/i386/ceilf.s",
581"musl/src/math/i386/ceill.s",533"musl/src/math/i386/ceill.s",
582"musl/src/math/i386/exp.s",
583"musl/src/math/i386/exp2.s",
584"musl/src/math/i386/exp2f.s",
585"musl/src/math/i386/exp2l.s",534"musl/src/math/i386/exp2l.s",
586"musl/src/math/i386/expf.s",535"musl/src/math/i386/exp_ld.s",
587"musl/src/math/i386/expl.s",536"musl/src/math/i386/expl.s",
588"musl/src/math/i386/expm1.s",
589"musl/src/math/i386/expm1f.s",
590"musl/src/math/i386/expm1l.s",537"musl/src/math/i386/expm1l.s",
591"musl/src/math/i386/fabs.s",538"musl/src/math/i386/fabs.s",
592"musl/src/math/i386/fabsf.s",539"musl/src/math/i386/fabsf.s",
...@@ -673,19 +620,15 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -673,19 +620,15 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
673"musl/src/math/log1pl.c",620"musl/src/math/log1pl.c",
674"musl/src/math/log2.c",621"musl/src/math/log2.c",
675"musl/src/math/log2_data.c",622"musl/src/math/log2_data.c",
676"musl/src/math/log2_data.h",
677"musl/src/math/log2f.c",623"musl/src/math/log2f.c",
678"musl/src/math/log2f_data.c",624"musl/src/math/log2f_data.c",
679"musl/src/math/log2f_data.h",
680"musl/src/math/log2l.c",625"musl/src/math/log2l.c",
681"musl/src/math/log_data.c",626"musl/src/math/log_data.c",
682"musl/src/math/log_data.h",
683"musl/src/math/logb.c",627"musl/src/math/logb.c",
684"musl/src/math/logbf.c",628"musl/src/math/logbf.c",
685"musl/src/math/logbl.c",629"musl/src/math/logbl.c",
686"musl/src/math/logf.c",630"musl/src/math/logf.c",
687"musl/src/math/logf_data.c",631"musl/src/math/logf_data.c",
688"musl/src/math/logf_data.h",
689"musl/src/math/logl.c",632"musl/src/math/logl.c",
690"musl/src/math/lrint.c",633"musl/src/math/lrint.c",
691"musl/src/math/lrintf.c",634"musl/src/math/lrintf.c",
...@@ -693,6 +636,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -693,6 +636,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
693"musl/src/math/lround.c",636"musl/src/math/lround.c",
694"musl/src/math/lroundf.c",637"musl/src/math/lroundf.c",
695"musl/src/math/lroundl.c",638"musl/src/math/lroundl.c",
639"musl/src/math/mips/fabs.c",
640"musl/src/math/mips/fabsf.c",
641"musl/src/math/mips/sqrt.c",
642"musl/src/math/mips/sqrtf.c",
696"musl/src/math/modf.c",643"musl/src/math/modf.c",
697"musl/src/math/modff.c",644"musl/src/math/modff.c",
698"musl/src/math/modfl.c",645"musl/src/math/modfl.c",
...@@ -710,7 +657,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -710,7 +657,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
710"musl/src/math/nexttowardl.c",657"musl/src/math/nexttowardl.c",
711"musl/src/math/pow.c",658"musl/src/math/pow.c",
712"musl/src/math/pow_data.c",659"musl/src/math/pow_data.c",
713"musl/src/math/pow_data.h",
714"musl/src/math/powerpc/fabs.c",660"musl/src/math/powerpc/fabs.c",
715"musl/src/math/powerpc/fabsf.c",661"musl/src/math/powerpc/fabsf.c",
716"musl/src/math/powerpc/fma.c",662"musl/src/math/powerpc/fma.c",
...@@ -741,7 +687,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -741,7 +687,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
741"musl/src/math/powerpc64/truncf.c",687"musl/src/math/powerpc64/truncf.c",
742"musl/src/math/powf.c",688"musl/src/math/powf.c",
743"musl/src/math/powf_data.c",689"musl/src/math/powf_data.c",
744"musl/src/math/powf_data.h",
745"musl/src/math/powl.c",690"musl/src/math/powl.c",
746"musl/src/math/remainder.c",691"musl/src/math/remainder.c",
747"musl/src/math/remainderf.c",692"musl/src/math/remainderf.c",
...@@ -958,7 +903,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -958,7 +903,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
958"musl/src/multibyte/c16rtomb.c",903"musl/src/multibyte/c16rtomb.c",
959"musl/src/multibyte/c32rtomb.c",904"musl/src/multibyte/c32rtomb.c",
960"musl/src/multibyte/internal.c",905"musl/src/multibyte/internal.c",
961"musl/src/multibyte/internal.h",
962"musl/src/multibyte/mblen.c",906"musl/src/multibyte/mblen.c",
963"musl/src/multibyte/mbrlen.c",907"musl/src/multibyte/mbrlen.c",
964"musl/src/multibyte/mbrtoc16.c",908"musl/src/multibyte/mbrtoc16.c",
...@@ -1021,12 +965,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1021,12 +965,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1021"musl/src/network/inet_ntop.c",965"musl/src/network/inet_ntop.c",
1022"musl/src/network/inet_pton.c",966"musl/src/network/inet_pton.c",
1023"musl/src/network/listen.c",967"musl/src/network/listen.c",
1024"musl/src/network/lookup.h",
1025"musl/src/network/lookup_ipliteral.c",968"musl/src/network/lookup_ipliteral.c",
1026"musl/src/network/lookup_name.c",969"musl/src/network/lookup_name.c",
1027"musl/src/network/lookup_serv.c",970"musl/src/network/lookup_serv.c",
1028"musl/src/network/netlink.c",971"musl/src/network/netlink.c",
1029"musl/src/network/netlink.h",
1030"musl/src/network/netname.c",972"musl/src/network/netname.c",
1031"musl/src/network/ns_parse.c",973"musl/src/network/ns_parse.c",
1032"musl/src/network/ntohl.c",974"musl/src/network/ntohl.c",
...@@ -1070,12 +1012,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1070,12 +1012,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1070"musl/src/passwd/getspnam.c",1012"musl/src/passwd/getspnam.c",
1071"musl/src/passwd/getspnam_r.c",1013"musl/src/passwd/getspnam_r.c",
1072"musl/src/passwd/lckpwdf.c",1014"musl/src/passwd/lckpwdf.c",
1073"musl/src/passwd/nscd.h",
1074"musl/src/passwd/nscd_query.c",1015"musl/src/passwd/nscd_query.c",
1075"musl/src/passwd/putgrent.c",1016"musl/src/passwd/putgrent.c",
1076"musl/src/passwd/putpwent.c",1017"musl/src/passwd/putpwent.c",
1077"musl/src/passwd/putspent.c",1018"musl/src/passwd/putspent.c",
1078"musl/src/passwd/pwf.h",
1079"musl/src/prng/__rand48_step.c",1019"musl/src/prng/__rand48_step.c",
1080"musl/src/prng/__seed48.c",1020"musl/src/prng/__seed48.c",
1081"musl/src/prng/drand48.c",1021"musl/src/prng/drand48.c",
...@@ -1083,7 +1023,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1083,7 +1023,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1083"musl/src/prng/lrand48.c",1023"musl/src/prng/lrand48.c",
1084"musl/src/prng/mrand48.c",1024"musl/src/prng/mrand48.c",
1085"musl/src/prng/rand.c",1025"musl/src/prng/rand.c",
1086"musl/src/prng/rand48.h",
1087"musl/src/prng/rand_r.c",1026"musl/src/prng/rand_r.c",
1088"musl/src/prng/random.c",1027"musl/src/prng/random.c",
1089"musl/src/prng/seed48.c",1028"musl/src/prng/seed48.c",
...@@ -1095,7 +1034,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1095,7 +1034,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1095"musl/src/process/execv.c",1034"musl/src/process/execv.c",
1096"musl/src/process/execve.c",1035"musl/src/process/execve.c",
1097"musl/src/process/execvp.c",1036"musl/src/process/execvp.c",
1098"musl/src/process/fdop.h",
1099"musl/src/process/fexecve.c",1037"musl/src/process/fexecve.c",
1100"musl/src/process/fork.c",1038"musl/src/process/fork.c",
1101"musl/src/process/i386/vfork.s",1039"musl/src/process/i386/vfork.s",
...@@ -1134,7 +1072,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1134,7 +1072,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1134"musl/src/regex/regerror.c",1072"musl/src/regex/regerror.c",
1135"musl/src/regex/regexec.c",1073"musl/src/regex/regexec.c",
1136"musl/src/regex/tre-mem.c",1074"musl/src/regex/tre-mem.c",
1137"musl/src/regex/tre.h",
1138"musl/src/sched/affinity.c",1075"musl/src/sched/affinity.c",
1139"musl/src/sched/sched_cpucount.c",1076"musl/src/sched/sched_cpucount.c",
1140"musl/src/sched/sched_get_priority_max.c",1077"musl/src/sched/sched_get_priority_max.c",
...@@ -1152,7 +1089,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1152,7 +1089,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1152"musl/src/search/tdestroy.c",1089"musl/src/search/tdestroy.c",
1153"musl/src/search/tfind.c",1090"musl/src/search/tfind.c",
1154"musl/src/search/tsearch.c",1091"musl/src/search/tsearch.c",
1155"musl/src/search/tsearch.h",
1156"musl/src/search/twalk.c",1092"musl/src/search/twalk.c",
1157"musl/src/select/poll.c",1093"musl/src/select/poll.c",
1158"musl/src/select/pselect.c",1094"musl/src/select/pselect.c",
...@@ -1335,7 +1271,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1335,7 +1271,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1335"musl/src/stdio/fwrite.c",1271"musl/src/stdio/fwrite.c",
1336"musl/src/stdio/fwscanf.c",1272"musl/src/stdio/fwscanf.c",
1337"musl/src/stdio/getc.c",1273"musl/src/stdio/getc.c",
1338"musl/src/stdio/getc.h",
1339"musl/src/stdio/getc_unlocked.c",1274"musl/src/stdio/getc_unlocked.c",
1340"musl/src/stdio/getchar.c",1275"musl/src/stdio/getchar.c",
1341"musl/src/stdio/getchar_unlocked.c",1276"musl/src/stdio/getchar_unlocked.c",
...@@ -1354,7 +1289,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1354,7 +1289,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1354"musl/src/stdio/popen.c",1289"musl/src/stdio/popen.c",
1355"musl/src/stdio/printf.c",1290"musl/src/stdio/printf.c",
1356"musl/src/stdio/putc.c",1291"musl/src/stdio/putc.c",
1357"musl/src/stdio/putc.h",
1358"musl/src/stdio/putc_unlocked.c",1292"musl/src/stdio/putc_unlocked.c",
1359"musl/src/stdio/putchar.c",1293"musl/src/stdio/putchar.c",
1360"musl/src/stdio/putchar_unlocked.c",1294"musl/src/stdio/putchar_unlocked.c",
...@@ -1746,7 +1680,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1746,7 +1680,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1746"musl/src/time/strftime.c",1680"musl/src/time/strftime.c",
1747"musl/src/time/strptime.c",1681"musl/src/time/strptime.c",
1748"musl/src/time/time.c",1682"musl/src/time/time.c",
1749"musl/src/time/time_impl.h",
1750"musl/src/time/timegm.c",1683"musl/src/time/timegm.c",
1751"musl/src/time/timer_create.c",1684"musl/src/time/timer_create.c",
1752"musl/src/time/timer_delete.c",1685"musl/src/time/timer_delete.c",
...@@ -1843,4 +1776,69 @@ static const char *ZIG_MUSL_SRC_FILES[] = {...@@ -1843,4 +1776,69 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1843"musl/src/unistd/writev.c",1776"musl/src/unistd/writev.c",
1844"musl/src/unistd/x32/lseek.c",1777"musl/src/unistd/x32/lseek.c",
1845};1778};
1779static const char *ZIG_MUSL_COMPAT_TIME32_FILES[] = {
1780"musl/compat/time32/__xstat.c",
1781"musl/compat/time32/adjtime32.c",
1782"musl/compat/time32/adjtimex_time32.c",
1783"musl/compat/time32/aio_suspend_time32.c",
1784"musl/compat/time32/clock_adjtime32.c",
1785"musl/compat/time32/clock_getres_time32.c",
1786"musl/compat/time32/clock_gettime32.c",
1787"musl/compat/time32/clock_nanosleep_time32.c",
1788"musl/compat/time32/clock_settime32.c",
1789"musl/compat/time32/cnd_timedwait_time32.c",
1790"musl/compat/time32/ctime32.c",
1791"musl/compat/time32/ctime32_r.c",
1792"musl/compat/time32/difftime32.c",
1793"musl/compat/time32/fstat_time32.c",
1794"musl/compat/time32/fstatat_time32.c",
1795"musl/compat/time32/ftime32.c",
1796"musl/compat/time32/futimens_time32.c",
1797"musl/compat/time32/futimes_time32.c",
1798"musl/compat/time32/futimesat_time32.c",
1799"musl/compat/time32/getitimer_time32.c",
1800"musl/compat/time32/getrusage_time32.c",
1801"musl/compat/time32/gettimeofday_time32.c",
1802"musl/compat/time32/gmtime32.c",
1803"musl/compat/time32/gmtime32_r.c",
1804"musl/compat/time32/localtime32.c",
1805"musl/compat/time32/localtime32_r.c",
1806"musl/compat/time32/lstat_time32.c",
1807"musl/compat/time32/lutimes_time32.c",
1808"musl/compat/time32/mktime32.c",
1809"musl/compat/time32/mq_timedreceive_time32.c",
1810"musl/compat/time32/mq_timedsend_time32.c",
1811"musl/compat/time32/mtx_timedlock_time32.c",
1812"musl/compat/time32/nanosleep_time32.c",
1813"musl/compat/time32/ppoll_time32.c",
1814"musl/compat/time32/pselect_time32.c",
1815"musl/compat/time32/pthread_cond_timedwait_time32.c",
1816"musl/compat/time32/pthread_mutex_timedlock_time32.c",
1817"musl/compat/time32/pthread_rwlock_timedrdlock_time32.c",
1818"musl/compat/time32/pthread_rwlock_timedwrlock_time32.c",
1819"musl/compat/time32/pthread_timedjoin_np_time32.c",
1820"musl/compat/time32/recvmmsg_time32.c",
1821"musl/compat/time32/sched_rr_get_interval_time32.c",
1822"musl/compat/time32/select_time32.c",
1823"musl/compat/time32/sem_timedwait_time32.c",
1824"musl/compat/time32/semtimedop_time32.c",
1825"musl/compat/time32/setitimer_time32.c",
1826"musl/compat/time32/settimeofday_time32.c",
1827"musl/compat/time32/sigtimedwait_time32.c",
1828"musl/compat/time32/stat_time32.c",
1829"musl/compat/time32/stime32.c",
1830"musl/compat/time32/thrd_sleep_time32.c",
1831"musl/compat/time32/time32.c",
1832"musl/compat/time32/time32gm.c",
1833"musl/compat/time32/timer_gettime32.c",
1834"musl/compat/time32/timer_settime32.c",
1835"musl/compat/time32/timerfd_gettime32.c",
1836"musl/compat/time32/timerfd_settime32.c",
1837"musl/compat/time32/timespec_get_time32.c",
1838"musl/compat/time32/utime_time32.c",
1839"musl/compat/time32/utimensat_time32.c",
1840"musl/compat/time32/utimes_time32.c",
1841"musl/compat/time32/wait3_time32.c",
1842"musl/compat/time32/wait4_time32.c",
1843};
1846#endif1844#endif
src/link.cpp+39-24
...@@ -983,44 +983,59 @@ static bool is_musl_arch_name(const char *name) {...@@ -983,44 +983,59 @@ static bool is_musl_arch_name(const char *name) {
983 return false;983 return false;
984}984}
985985
986enum MuslSrc {
987 MuslSrcAsm,
988 MuslSrcNormal,
989 MuslSrcO3,
990};
991
992static void add_musl_src_file(HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> &source_table,
993 const char *file_path)
994{
995 Buf *src_file = buf_create_from_str(file_path);
996
997 MuslSrc src_kind;
998 if (buf_ends_with_str(src_file, ".c")) {
999 bool want_O3 = buf_starts_with_str(src_file, "musl/src/malloc/") ||
1000 buf_starts_with_str(src_file, "musl/src/string/") ||
1001 buf_starts_with_str(src_file, "musl/src/internal/");
1002 src_kind = want_O3 ? MuslSrcO3 : MuslSrcNormal;
1003 } else if (buf_ends_with_str(src_file, ".s") || buf_ends_with_str(src_file, ".S")) {
1004 src_kind = MuslSrcAsm;
1005 } else {
1006 zig_unreachable();
1007 }
1008 if (ZIG_OS_SEP_CHAR != '/') {
1009 buf_replace(src_file, '/', ZIG_OS_SEP_CHAR);
1010 }
1011 source_table.put_unique(src_file, src_kind);
1012}
1013
986static const char *build_musl(CodeGen *parent, Stage2ProgressNode *progress_node) {1014static const char *build_musl(CodeGen *parent, Stage2ProgressNode *progress_node) {
987 CodeGen *child_gen = create_child_codegen(parent, nullptr, OutTypeLib, nullptr, "c", progress_node);1015 CodeGen *child_gen = create_child_codegen(parent, nullptr, OutTypeLib, nullptr, "c", progress_node);
9881016
989 // When there is a src/<arch>/foo.* then it should substitute for src/foo.*1017 // When there is a src/<arch>/foo.* then it should substitute for src/foo.*
990 // Even a .s file can substitute for a .c file.1018 // Even a .s file can substitute for a .c file.
9911019
992 enum MuslSrc {
993 MuslSrcAsm,
994 MuslSrcNormal,
995 MuslSrcO3,
996 };
997
998 const char *target_musl_arch_name = target_arch_musl_name(parent->zig_target->arch);1020 const char *target_musl_arch_name = target_arch_musl_name(parent->zig_target->arch);
9991021
1000 HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> source_table = {};1022 HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> source_table = {};
1001 source_table.init(1800);1023 source_table.init(2000);
10021024
1003 for (size_t i = 0; i < array_length(ZIG_MUSL_SRC_FILES); i += 1) {1025 for (size_t i = 0; i < array_length(ZIG_MUSL_SRC_FILES); i += 1) {
1004 Buf *src_file = buf_create_from_str(ZIG_MUSL_SRC_FILES[i]);1026 add_musl_src_file(source_table, ZIG_MUSL_SRC_FILES[i]);
10051027 }
1006 MuslSrc src_kind;1028
1007 if (buf_ends_with_str(src_file, ".c")) {1029 static const char *time32_compat_arch_list[] = {"arm", "i386", "mips", "powerpc"};
1008 assert(buf_starts_with_str(src_file, "musl/src/"));1030 for (size_t arch_i = 0; arch_i < array_length(time32_compat_arch_list); arch_i += 1) {
1009 bool want_O3 = buf_starts_with_str(src_file, "musl/src/malloc/") ||1031 if (strcmp(target_musl_arch_name, time32_compat_arch_list[arch_i]) == 0) {
1010 buf_starts_with_str(src_file, "musl/src/string/") ||1032 for (size_t i = 0; i < array_length(ZIG_MUSL_COMPAT_TIME32_FILES); i += 1) {
1011 buf_starts_with_str(src_file, "musl/src/internal/");1033 add_musl_src_file(source_table, ZIG_MUSL_COMPAT_TIME32_FILES[i]);
1012 src_kind = want_O3 ? MuslSrcO3 : MuslSrcNormal;1034 }
1013 } else if (buf_ends_with_str(src_file, ".s") || buf_ends_with_str(src_file, ".S")) {
1014 src_kind = MuslSrcAsm;
1015 } else {
1016 continue;
1017 }
1018 if (ZIG_OS_SEP_CHAR != '/') {
1019 buf_replace(src_file, '/', ZIG_OS_SEP_CHAR);
1020 }1035 }
1021 source_table.put_unique(src_file, src_kind);
1022 }1036 }
10231037
1038
1024 ZigList<CFile *> c_source_files = {0};1039 ZigList<CFile *> c_source_files = {0};
10251040
1026 Buf dirname = BUF_INIT;1041 Buf dirname = BUF_INIT;