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[] = {
8080"musl/src/crypt/crypt.c",
8181"musl/src/crypt/crypt_blowfish.c",
8282"musl/src/crypt/crypt_des.c",
83"musl/src/crypt/crypt_des.h",
8483"musl/src/crypt/crypt_md5.c",
8584"musl/src/crypt/crypt_r.c",
8685"musl/src/crypt/crypt_sha256.c",
......@@ -90,7 +89,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
9089"musl/src/ctype/__ctype_get_mb_cur_max.c",
9190"musl/src/ctype/__ctype_tolower_loc.c",
9291"musl/src/ctype/__ctype_toupper_loc.c",
93"musl/src/ctype/alpha.h",
9492"musl/src/ctype/isalnum.c",
9593"musl/src/ctype/isalpha.c",
9694"musl/src/ctype/isascii.c",
......@@ -117,8 +115,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
117115"musl/src/ctype/iswupper.c",
118116"musl/src/ctype/iswxdigit.c",
119117"musl/src/ctype/isxdigit.c",
120"musl/src/ctype/nonspacing.h",
121"musl/src/ctype/punct.h",
122118"musl/src/ctype/toascii.c",
123119"musl/src/ctype/tolower.c",
124120"musl/src/ctype/toupper.c",
......@@ -126,8 +122,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
126122"musl/src/ctype/wcswidth.c",
127123"musl/src/ctype/wctrans.c",
128124"musl/src/ctype/wcwidth.c",
129"musl/src/ctype/wide.h",
130"musl/src/dirent/__dirent.h",
131125"musl/src/dirent/alphasort.c",
132126"musl/src/dirent/closedir.c",
133127"musl/src/dirent/dirfd.c",
......@@ -152,7 +146,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
152146"musl/src/env/setenv.c",
153147"musl/src/env/unsetenv.c",
154148"musl/src/errno/__errno_location.c",
155"musl/src/errno/__strerror.h",
156149"musl/src/errno/strerror.c",
157150"musl/src/exit/_Exit.c",
158151"musl/src/exit/abort.c",
......@@ -196,55 +189,18 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
196189"musl/src/fenv/sh/fenv.S",
197190"musl/src/fenv/x32/fenv.s",
198191"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",
220192"musl/src/internal/defsysinfo.c",
221"musl/src/internal/dynlink.h",
222"musl/src/internal/fdpic_crt.h",
223193"musl/src/internal/floatscan.c",
224"musl/src/internal/floatscan.h",
225"musl/src/internal/futex.h",
226194"musl/src/internal/i386/defsysinfo.s",
227195"musl/src/internal/intscan.c",
228"musl/src/internal/intscan.h",
229"musl/src/internal/ksigaction.h",
230196"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",
236197"musl/src/internal/procfdname.c",
237"musl/src/internal/pthread_impl.h",
238198"musl/src/internal/sh/__shcall.c",
239199"musl/src/internal/shgetc.c",
240"musl/src/internal/shgetc.h",
241"musl/src/internal/stdio_impl.h",
242"musl/src/internal/syscall.h",
243200"musl/src/internal/syscall_ret.c",
244201"musl/src/internal/vdso.c",
245202"musl/src/internal/version.c",
246203"musl/src/ipc/ftok.c",
247"musl/src/ipc/ipc.h",
248204"musl/src/ipc/msgctl.c",
249205"musl/src/ipc/msgget.c",
250206"musl/src/ipc/msgrcv.c",
......@@ -261,6 +217,7 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
261217"musl/src/ldso/aarch64/dlsym.s",
262218"musl/src/ldso/aarch64/tlsdesc.s",
263219"musl/src/ldso/arm/dlsym.s",
220"musl/src/ldso/arm/dlsym_time64.S",
264221"musl/src/ldso/arm/find_exidx.c",
265222"musl/src/ldso/arm/tlsdesc.S",
266223"musl/src/ldso/dl_iterate_phdr.c",
......@@ -271,18 +228,26 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
271228"musl/src/ldso/dlopen.c",
272229"musl/src/ldso/dlsym.c",
273230"musl/src/ldso/i386/dlsym.s",
231"musl/src/ldso/i386/dlsym_time64.S",
274232"musl/src/ldso/i386/tlsdesc.s",
275233"musl/src/ldso/m68k/dlsym.s",
234"musl/src/ldso/m68k/dlsym_time64.S",
276235"musl/src/ldso/microblaze/dlsym.s",
236"musl/src/ldso/microblaze/dlsym_time64.S",
277237"musl/src/ldso/mips/dlsym.s",
238"musl/src/ldso/mips/dlsym_time64.S",
278239"musl/src/ldso/mips64/dlsym.s",
279240"musl/src/ldso/mipsn32/dlsym.s",
241"musl/src/ldso/mipsn32/dlsym_time64.S",
280242"musl/src/ldso/or1k/dlsym.s",
243"musl/src/ldso/or1k/dlsym_time64.S",
281244"musl/src/ldso/powerpc/dlsym.s",
245"musl/src/ldso/powerpc/dlsym_time64.S",
282246"musl/src/ldso/powerpc64/dlsym.s",
283247"musl/src/ldso/riscv64/dlsym.s",
284248"musl/src/ldso/s390x/dlsym.s",
285249"musl/src/ldso/sh/dlsym.s",
250"musl/src/ldso/sh/dlsym_time64.S",
286251"musl/src/ldso/tlsdesc.c",
287252"musl/src/ldso/x32/dlsym.s",
288253"musl/src/ldso/x86_64/dlsym.s",
......@@ -369,30 +334,21 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
369334"musl/src/linux/xattr.c",
370335"musl/src/locale/__lctrans.c",
371336"musl/src/locale/__mo_lookup.c",
372"musl/src/locale/big5.h",
373337"musl/src/locale/bind_textdomain_codeset.c",
374338"musl/src/locale/c_locale.c",
375339"musl/src/locale/catclose.c",
376340"musl/src/locale/catgets.c",
377341"musl/src/locale/catopen.c",
378"musl/src/locale/codepages.h",
379342"musl/src/locale/dcngettext.c",
380343"musl/src/locale/duplocale.c",
381344"musl/src/locale/freelocale.c",
382"musl/src/locale/gb18030.h",
383"musl/src/locale/hkscs.h",
384345"musl/src/locale/iconv.c",
385346"musl/src/locale/iconv_close.c",
386"musl/src/locale/jis0208.h",
387"musl/src/locale/ksc.h",
388347"musl/src/locale/langinfo.c",
389"musl/src/locale/legacychars.h",
390348"musl/src/locale/locale_map.c",
391349"musl/src/locale/localeconv.c",
392350"musl/src/locale/newlocale.c",
393351"musl/src/locale/pleval.c",
394"musl/src/locale/pleval.h",
395"musl/src/locale/revjis.h",
396352"musl/src/locale/setlocale.c",
397353"musl/src/locale/strcoll.c",
398354"musl/src/locale/strfmon.c",
......@@ -401,7 +357,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
401357"musl/src/locale/uselocale.c",
402358"musl/src/locale/wcscoll.c",
403359"musl/src/locale/wcsxfrm.c",
404"musl/src/malloc/DESIGN",
405360"musl/src/malloc/aligned_alloc.c",
406361"musl/src/malloc/expand_heap.c",
407362"musl/src/malloc/lite_malloc.c",
......@@ -418,7 +373,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
418373"musl/src/math/__fpclassifyf.c",
419374"musl/src/math/__fpclassifyl.c",
420375"musl/src/math/__invtrigl.c",
421"musl/src/math/__invtrigl.h",
422376"musl/src/math/__math_divzero.c",
423377"musl/src/math/__math_divzerof.c",
424378"musl/src/math/__math_invalid.c",
......@@ -525,10 +479,8 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
525479"musl/src/math/exp2.c",
526480"musl/src/math/exp2f.c",
527481"musl/src/math/exp2f_data.c",
528"musl/src/math/exp2f_data.h",
529482"musl/src/math/exp2l.c",
530483"musl/src/math/exp_data.c",
531"musl/src/math/exp_data.h",
532484"musl/src/math/expf.c",
533485"musl/src/math/expl.c",
534486"musl/src/math/expm1.c",
......@@ -579,14 +531,9 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
579531"musl/src/math/i386/ceil.s",
580532"musl/src/math/i386/ceilf.s",
581533"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",
585534"musl/src/math/i386/exp2l.s",
586"musl/src/math/i386/expf.s",
535"musl/src/math/i386/exp_ld.s",
587536"musl/src/math/i386/expl.s",
588"musl/src/math/i386/expm1.s",
589"musl/src/math/i386/expm1f.s",
590537"musl/src/math/i386/expm1l.s",
591538"musl/src/math/i386/fabs.s",
592539"musl/src/math/i386/fabsf.s",
......@@ -673,19 +620,15 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
673620"musl/src/math/log1pl.c",
674621"musl/src/math/log2.c",
675622"musl/src/math/log2_data.c",
676"musl/src/math/log2_data.h",
677623"musl/src/math/log2f.c",
678624"musl/src/math/log2f_data.c",
679"musl/src/math/log2f_data.h",
680625"musl/src/math/log2l.c",
681626"musl/src/math/log_data.c",
682"musl/src/math/log_data.h",
683627"musl/src/math/logb.c",
684628"musl/src/math/logbf.c",
685629"musl/src/math/logbl.c",
686630"musl/src/math/logf.c",
687631"musl/src/math/logf_data.c",
688"musl/src/math/logf_data.h",
689632"musl/src/math/logl.c",
690633"musl/src/math/lrint.c",
691634"musl/src/math/lrintf.c",
......@@ -693,6 +636,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
693636"musl/src/math/lround.c",
694637"musl/src/math/lroundf.c",
695638"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",
696643"musl/src/math/modf.c",
697644"musl/src/math/modff.c",
698645"musl/src/math/modfl.c",
......@@ -710,7 +657,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
710657"musl/src/math/nexttowardl.c",
711658"musl/src/math/pow.c",
712659"musl/src/math/pow_data.c",
713"musl/src/math/pow_data.h",
714660"musl/src/math/powerpc/fabs.c",
715661"musl/src/math/powerpc/fabsf.c",
716662"musl/src/math/powerpc/fma.c",
......@@ -741,7 +687,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
741687"musl/src/math/powerpc64/truncf.c",
742688"musl/src/math/powf.c",
743689"musl/src/math/powf_data.c",
744"musl/src/math/powf_data.h",
745690"musl/src/math/powl.c",
746691"musl/src/math/remainder.c",
747692"musl/src/math/remainderf.c",
......@@ -958,7 +903,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
958903"musl/src/multibyte/c16rtomb.c",
959904"musl/src/multibyte/c32rtomb.c",
960905"musl/src/multibyte/internal.c",
961"musl/src/multibyte/internal.h",
962906"musl/src/multibyte/mblen.c",
963907"musl/src/multibyte/mbrlen.c",
964908"musl/src/multibyte/mbrtoc16.c",
......@@ -1021,12 +965,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
1021965"musl/src/network/inet_ntop.c",
1022966"musl/src/network/inet_pton.c",
1023967"musl/src/network/listen.c",
1024"musl/src/network/lookup.h",
1025968"musl/src/network/lookup_ipliteral.c",
1026969"musl/src/network/lookup_name.c",
1027970"musl/src/network/lookup_serv.c",
1028971"musl/src/network/netlink.c",
1029"musl/src/network/netlink.h",
1030972"musl/src/network/netname.c",
1031973"musl/src/network/ns_parse.c",
1032974"musl/src/network/ntohl.c",
......@@ -1070,12 +1012,10 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
10701012"musl/src/passwd/getspnam.c",
10711013"musl/src/passwd/getspnam_r.c",
10721014"musl/src/passwd/lckpwdf.c",
1073"musl/src/passwd/nscd.h",
10741015"musl/src/passwd/nscd_query.c",
10751016"musl/src/passwd/putgrent.c",
10761017"musl/src/passwd/putpwent.c",
10771018"musl/src/passwd/putspent.c",
1078"musl/src/passwd/pwf.h",
10791019"musl/src/prng/__rand48_step.c",
10801020"musl/src/prng/__seed48.c",
10811021"musl/src/prng/drand48.c",
......@@ -1083,7 +1023,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
10831023"musl/src/prng/lrand48.c",
10841024"musl/src/prng/mrand48.c",
10851025"musl/src/prng/rand.c",
1086"musl/src/prng/rand48.h",
10871026"musl/src/prng/rand_r.c",
10881027"musl/src/prng/random.c",
10891028"musl/src/prng/seed48.c",
......@@ -1095,7 +1034,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
10951034"musl/src/process/execv.c",
10961035"musl/src/process/execve.c",
10971036"musl/src/process/execvp.c",
1098"musl/src/process/fdop.h",
10991037"musl/src/process/fexecve.c",
11001038"musl/src/process/fork.c",
11011039"musl/src/process/i386/vfork.s",
......@@ -1134,7 +1072,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
11341072"musl/src/regex/regerror.c",
11351073"musl/src/regex/regexec.c",
11361074"musl/src/regex/tre-mem.c",
1137"musl/src/regex/tre.h",
11381075"musl/src/sched/affinity.c",
11391076"musl/src/sched/sched_cpucount.c",
11401077"musl/src/sched/sched_get_priority_max.c",
......@@ -1152,7 +1089,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
11521089"musl/src/search/tdestroy.c",
11531090"musl/src/search/tfind.c",
11541091"musl/src/search/tsearch.c",
1155"musl/src/search/tsearch.h",
11561092"musl/src/search/twalk.c",
11571093"musl/src/select/poll.c",
11581094"musl/src/select/pselect.c",
......@@ -1335,7 +1271,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
13351271"musl/src/stdio/fwrite.c",
13361272"musl/src/stdio/fwscanf.c",
13371273"musl/src/stdio/getc.c",
1338"musl/src/stdio/getc.h",
13391274"musl/src/stdio/getc_unlocked.c",
13401275"musl/src/stdio/getchar.c",
13411276"musl/src/stdio/getchar_unlocked.c",
......@@ -1354,7 +1289,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
13541289"musl/src/stdio/popen.c",
13551290"musl/src/stdio/printf.c",
13561291"musl/src/stdio/putc.c",
1357"musl/src/stdio/putc.h",
13581292"musl/src/stdio/putc_unlocked.c",
13591293"musl/src/stdio/putchar.c",
13601294"musl/src/stdio/putchar_unlocked.c",
......@@ -1746,7 +1680,6 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
17461680"musl/src/time/strftime.c",
17471681"musl/src/time/strptime.c",
17481682"musl/src/time/time.c",
1749"musl/src/time/time_impl.h",
17501683"musl/src/time/timegm.c",
17511684"musl/src/time/timer_create.c",
17521685"musl/src/time/timer_delete.c",
......@@ -1843,4 +1776,69 @@ static const char *ZIG_MUSL_SRC_FILES[] = {
18431776"musl/src/unistd/writev.c",
18441777"musl/src/unistd/x32/lseek.c",
18451778};
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};
18461844#endif
src/link.cpp+39-24
......@@ -983,44 +983,59 @@ static bool is_musl_arch_name(const char *name) {
983983 return false;
984984}
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
9861014static const char *build_musl(CodeGen *parent, Stage2ProgressNode *progress_node) {
9871015 CodeGen *child_gen = create_child_codegen(parent, nullptr, OutTypeLib, nullptr, "c", progress_node);
9881016
9891017 // When there is a src/<arch>/foo.* then it should substitute for src/foo.*
9901018 // Even a .s file can substitute for a .c file.
9911019
992 enum MuslSrc {
993 MuslSrcAsm,
994 MuslSrcNormal,
995 MuslSrcO3,
996 };
997
9981020 const char *target_musl_arch_name = target_arch_musl_name(parent->zig_target->arch);
9991021
10001022 HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> source_table = {};
1001 source_table.init(1800);
1023 source_table.init(2000);
10021024
10031025 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]);
1005
1006 MuslSrc src_kind;
1007 if (buf_ends_with_str(src_file, ".c")) {
1008 assert(buf_starts_with_str(src_file, "musl/src/"));
1009 bool want_O3 = buf_starts_with_str(src_file, "musl/src/malloc/") ||
1010 buf_starts_with_str(src_file, "musl/src/string/") ||
1011 buf_starts_with_str(src_file, "musl/src/internal/");
1012 src_kind = want_O3 ? MuslSrcO3 : MuslSrcNormal;
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);
1026 add_musl_src_file(source_table, ZIG_MUSL_SRC_FILES[i]);
1027 }
1028
1029 static const char *time32_compat_arch_list[] = {"arm", "i386", "mips", "powerpc"};
1030 for (size_t arch_i = 0; arch_i < array_length(time32_compat_arch_list); arch_i += 1) {
1031 if (strcmp(target_musl_arch_name, time32_compat_arch_list[arch_i]) == 0) {
1032 for (size_t i = 0; i < array_length(ZIG_MUSL_COMPAT_TIME32_FILES); i += 1) {
1033 add_musl_src_file(source_table, ZIG_MUSL_COMPAT_TIME32_FILES[i]);
1034 }
10201035 }
1021 source_table.put_unique(src_file, src_kind);
10221036 }
10231037
1038
10241039 ZigList<CFile *> c_source_files = {0};
10251040
10261041 Buf dirname = BUF_INIT;