Skip to content

Commit 4b2bb1c

Browse files
penznjohn-sharratt
authored andcommitted
Add a separate install target for threaded libc (WebAssembly#331)
Produce a different sysroot directory for threaded target. Restructure `expected` directory to correspond to the target.
1 parent 1055f01 commit 4b2bb1c

21 files changed

+907
-3185
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ LIBWASI_EMULATED_SIGNAL_OBJS = $(call objs,$(LIBWASI_EMULATED_SIGNAL_SOURCES))
392392

393393
# These variables describe the locations of various files and
394394
# directories in the generated sysroot tree.
395-
SYSROOT_LIB := $(SYSROOT)/lib/$(MULTIARCH_TRIPLE)
395+
SYSROOT_LIB := $(SYSROOT)/lib/$(TARGET_TRIPLE)
396396
SYSROOT_INC = $(SYSROOT)/include
397-
SYSROOT_SHARE = $(SYSROOT)/share/$(MULTIARCH_TRIPLE)
397+
SYSROOT_SHARE = $(SYSROOT)/share/$(TARGET_TRIPLE)
398398

399399
# Files from musl's include directory that we don't want to install in the
400400
# sysroot's include directory.
@@ -700,6 +700,10 @@ check-symbols: startup_files libc
700700
| grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
701701
> "$(SYSROOT_SHARE)/predefined-macros.txt"
702702

703+
# Check that the computed metadata matches the expected metadata.
704+
# This ignores whitespace because on Windows the output has CRLF line endings.
705+
diff -wur "$(CURDIR)/expected/$(TARGET_TRIPLE)" "$(SYSROOT_SHARE)"
706+
703707
install: finish
704708
mkdir -p "$(INSTALL_DIR)"
705709
cp -r "$(SYSROOT)/lib" "$(SYSROOT)/share" "$(SYSROOT)/include" "$(INSTALL_DIR)"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

expected/wasm64-wasi/posix/defined-symbols.txt renamed to expected/wasm32-wasi/defined-symbols.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ __wasi_futex_wake_all
411411
__wasi_getcwd
412412
__wasi_http_request
413413
__wasi_http_status
414+
__wasi_init_tp
414415
__wasi_path_create_directory
415416
__wasi_path_filestat_get
416417
__wasi_path_filestat_set_times
@@ -531,6 +532,7 @@ __wasilibc_nocwd_utimensat
531532
__wasilibc_open_nomode
532533
__wasilibc_pgrp
533534
__wasilibc_populate_preopens_init
535+
__wasilibc_pthread_self
534536
__wasilibc_register_preopened_fd
535537
__wasilibc_rename_newat
536538
__wasilibc_rename_oldat
@@ -1259,8 +1261,6 @@ pthread_attr_destroy
12591261
pthread_attr_getdetachstate
12601262
pthread_attr_getguardsize
12611263
pthread_attr_getinheritsched
1262-
pthread_attr_getschedparam
1263-
pthread_attr_getschedpolicy
12641264
pthread_attr_getscope
12651265
pthread_attr_getstack
12661266
pthread_attr_getstacksize
@@ -1288,7 +1288,6 @@ pthread_cond_signal
12881288
pthread_cond_timedwait
12891289
pthread_cond_wait
12901290
pthread_condattr_destroy
1291-
pthread_condattr_getclock
12921291
pthread_condattr_getpshared
12931292
pthread_condattr_init
12941293
pthread_condattr_setclock

expected/wasm32-wasi/single/predefined-macros.txt renamed to expected/wasm32-wasi/predefined-macros.txt

Lines changed: 26 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
#define AF_INET6 __WASI_ADDRESS_FAMILY_INET6
3838
#define AF_UNIX __WASI_ADDRESS_FAMILY_UNIX
3939
#define AF_UNSPEC __WASI_ADDRESS_FAMILY_UNSPEC
40-
#define AIO_ALLDONE 2
41-
#define AIO_CANCELED 0
42-
#define AIO_NOTCANCELED 1
4340
#define AI_ADDRCONFIG 0x20
4441
#define AI_ALL 0x10
4542
#define AI_CANONNAME 0x02
@@ -165,11 +162,6 @@
165162
#define BS1 0020000
166163
#define BSDLY 0020000
167164
#define BUFSIZ 1024
168-
#define BUS_ADRALN 1
169-
#define BUS_ADRERR 2
170-
#define BUS_MCEERR_AO 5
171-
#define BUS_MCEERR_AR 4
172-
#define BUS_OBJERR 3
173165
#define BYTE_ORDER __BYTE_ORDER
174166
#define CANBSIZ 255
175167
#define CBAUD 0010017
@@ -191,12 +183,6 @@
191183
#define CIBAUD 002003600000
192184
#define CINTR CTRL('c')
193185
#define CKILL CTRL('u')
194-
#define CLD_CONTINUED 6
195-
#define CLD_DUMPED 3
196-
#define CLD_EXITED 1
197-
#define CLD_KILLED 2
198-
#define CLD_STOPPED 5
199-
#define CLD_TRAPPED 4
200186
#define CLNEXT CTRL('v')
201187
#define CLOCAL 0004000
202188
#define CLOCKS_PER_SEC ((clock_t)1000000000)
@@ -236,7 +222,7 @@
236222
#define CMSPAR 010000000000
237223
#define CODESET 14
238224
#define COLL_WEIGHTS_MAX 2
239-
#define COMMON_CLOCK_H
225+
#define COMMON_CLOCK_H
240226
#define COMPLETE 2
241227
#define CONTINUE 3
242228
#define CONTTYPE '7'
@@ -1131,14 +1117,6 @@
11311117
#define FORM_C 3
11321118
#define FORM_N 1
11331119
#define FORM_T 2
1134-
#define FPE_FLTDIV 3
1135-
#define FPE_FLTINV 7
1136-
#define FPE_FLTOVF 4
1137-
#define FPE_FLTRES 6
1138-
#define FPE_FLTSUB 8
1139-
#define FPE_FLTUND 5
1140-
#define FPE_INTDIV 1
1141-
#define FPE_INTOVF 2
11421120
#define FP_ILOGB0 FP_ILOGBNAN
11431121
#define FP_ILOGBNAN (-1-0x7fffffff)
11441122
#define FP_INFINITE 1
@@ -1352,14 +1330,6 @@
13521330
#define IGNBRK 0000001
13531331
#define IGNCR 0000200
13541332
#define IGNPAR 0000004
1355-
#define ILL_BADSTK 8
1356-
#define ILL_COPROC 7
1357-
#define ILL_ILLADR 3
1358-
#define ILL_ILLOPC 1
1359-
#define ILL_ILLOPN 2
1360-
#define ILL_ILLTRP 4
1361-
#define ILL_PRVOPC 5
1362-
#define ILL_PRVREG 6
13631333
#define IMAXBEL 0020000
13641334
#define IN6ADDRSZ NS_IN6ADDRSZ
13651335
#define IN6ADDR_ANY_INIT { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
@@ -1773,11 +1743,6 @@
17731743
#define LFLOW_ON 1
17741744
#define LFLOW_RESTART_ANY 2
17751745
#define LFLOW_RESTART_XON 3
1776-
#define LIO_NOP 2
1777-
#define LIO_NOWAIT 1
1778-
#define LIO_READ 0
1779-
#define LIO_WAIT 0
1780-
#define LIO_WRITE 1
17811746
#define LITTLE_ENDIAN __LITTLE_ENDIAN
17821747
#define LITUSE_ALPHA_ADDR 0
17831748
#define LITUSE_ALPHA_BASE 1
@@ -2099,7 +2064,6 @@
20992064
#define NO_RECOVERY 3
21002065
#define NR_ICMP_TYPES 18
21012066
#define NR_ICMP_UNREACH 15
2102-
#define NSIG _NSIG
21032067
#define NSLC 18
21042068
#define NS_ALG_DH 2
21052069
#define NS_ALG_DSA 3
@@ -3449,7 +3413,7 @@
34493413
#define R_NIOS2_TLS_TPREL 35
34503414
#define R_NIOS2_U16 2
34513415
#define R_NIOS2_UJMP 18
3452-
#define R_OK (4)
3416+
#define R_OK (4)
34533417
#define R_OR1K_16 2
34543418
#define R_OR1K_16_PCREL 10
34553419
#define R_OR1K_32 1
@@ -4137,10 +4101,6 @@
41374101
#define SEEK_END __WASI_WHENCE_END
41384102
#define SEEK_SET __WASI_WHENCE_SET
41394103
#define SEGSIZE 512
4140-
#define SEGV_ACCERR 2
4141-
#define SEGV_BNDERR 3
4142-
#define SEGV_MAPERR 1
4143-
#define SEGV_PKUERR 4
41444104
#define SELFMAG 4
41454105
#define SEM_FAILED ((sem_t *)0)
41464106
#define SEM_NSEMS_MAX 256
@@ -4293,10 +4253,6 @@
42934253
#define SIGBUS 7
42944254
#define SIGCHLD 17
42954255
#define SIGCONT 18
4296-
#define SIGEV_NONE 1
4297-
#define SIGEV_SIGNAL 0
4298-
#define SIGEV_THREAD 2
4299-
#define SIGEV_THREAD_ID 4
43004256
#define SIGFPE 8
43014257
#define SIGHUP 1
43024258
#define SIGILL 4
@@ -4328,24 +4284,8 @@
43284284
#define SIGXFSZ 25
43294285
#define SIG_ATOMIC_MAX INT32_MAX
43304286
#define SIG_ATOMIC_MIN INT32_MIN
4331-
#define SIG_BLOCK 0
4332-
#define SIG_DFL ((void (*)(int)) 0)
4333-
#define SIG_ERR (__SIG_ERR)
4334-
#define SIG_HOLD ((void (*)(int)) 2)
4335-
#define SIG_IGN (__SIG_IGN)
4336-
#define SIG_SETMASK 2
4337-
#define SIG_UNBLOCK 1
43384287
#define SIZE_MAX UINT32_MAX
4339-
#define SI_ASYNCIO (-4)
4340-
#define SI_ASYNCNL (-60)
4341-
#define SI_KERNEL 128
43424288
#define SI_LOAD_SHIFT 16
4343-
#define SI_MESGQ (-3)
4344-
#define SI_QUEUE (-1)
4345-
#define SI_SIGIO (-5)
4346-
#define SI_TIMER (-2)
4347-
#define SI_TKILL (-6)
4348-
#define SI_USER 0
43494289
#define SLC_ABORT 7
43504290
#define SLC_ACK 0x80
43514291
#define SLC_AO 4
@@ -4920,7 +4860,6 @@
49204860
#define YESSTR 0x50002
49214861
#define YXDOMAIN ns_r_yxdomain
49224862
#define YXRRSET ns_r_yxrrset
4923-
#define _AIO_H
49244863
#define _ALLOCA_H
49254864
#define _ALL_SOURCE 1
49264865
#define _ARPA_FTP_H
@@ -4977,7 +4916,7 @@
49774916
#define _Complex_I (0.0f+1.0fi)
49784917
#define _DIRENT_H
49794918
#define _DIRENT_HAVE_D_TYPE
4980-
#define _ELF_H
4919+
#define _ELF_H
49814920
#define _ENDIAN_H
49824921
#define _ERRNO_H
49834922
#define _ERR_H
@@ -4991,7 +4930,7 @@
49914930
#define _GETOPT_H
49924931
#define _GLOB_H
49934932
#define _GNU_SOURCE 1
4994-
#define _GRP_H
4933+
#define _GRP_H
49954934
#define _ICONV_H
49964935
#define _IFADDRS_H
49974936
#define _ILP32 1
@@ -5025,7 +4964,7 @@
50254964
#define _NSIG 65
50264965
#define _NSIG_BPW 32
50274966
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
5028-
#define _PATHS_H
4967+
#define _PATHS_H
50294968
#define _PATH_BSHELL "/bin/sh"
50304969
#define _PATH_CONSOLE "/dev/console"
50314970
#define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
@@ -5125,6 +5064,7 @@
51255064
#define _POSIX_STREAM_MAX 8
51265065
#define _POSIX_SYMLINK_MAX 255
51275066
#define _POSIX_SYMLOOP_MAX 8
5067+
#define _POSIX_THREADS _POSIX_VERSION
51285068
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
51295069
#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
51305070
#define _POSIX_THREAD_CPUTIME _POSIX_VERSION
@@ -5147,7 +5087,7 @@
51475087
#define _POSIX_V7_ILP32_OFFBIG (1)
51485088
#define _POSIX_VDISABLE 0
51495089
#define _POSIX_VERSION 200809L
5150-
#define _PTHREAD_H
5090+
#define _PTHREAD_H
51515091
#define _PTRDIFF_T
51525092
#define _PWD_H
51535093
#define _REENTRANT 1
@@ -5297,8 +5237,7 @@
52975237
#define _SEARCH_H
52985238
#define _SEMAPHORE_H
52995239
#define _SETJMP_H
5300-
#define _SHADOW_H
5301-
#define _SIGNAL_H
5240+
#define _SHADOW_H
53025241
#define _SIZE_T
53035242
#define _SPAWN_H
53045243
#define _STDALIGN_H
@@ -6418,7 +6357,6 @@
64186357
#define __tg_real_remquo(x,y,z) (__RETCAST_2(x, y)( __FLT(x) && __FLT(y) ? remquof(x, y, z) : __LDBL((x)+(y)) ? remquol(x, y, z) : remquo(x, y, z) ))
64196358
#define __tm_gmtoff tm_gmtoff
64206359
#define __tm_zone tm_zone
6421-
#define __ucontext ucontext
64226360
#define __va_copy(d,s) __builtin_va_copy(d,s)
64236361
#define __wasi__ 1
64246362
#define __wasi_api_h
@@ -6449,24 +6387,24 @@
64496387
#define __wasilibc___macro_PAGESIZE_h
64506388
#define __wasilibc___mode_t_h
64516389
#define __wasilibc___seek_h
6452-
#define __wasilibc___struct_dirent_h
6453-
#define __wasilibc___struct_group_filter_h
6454-
#define __wasilibc___struct_group_req_h
6455-
#define __wasilibc___struct_group_source_req_h
6456-
#define __wasilibc___struct_if_addrs_h
6457-
#define __wasilibc___struct_in6_addr_h
6458-
#define __wasilibc___struct_in6_mtuinfo_h
6459-
#define __wasilibc___struct_in6_pktinfo_h
6460-
#define __wasilibc___struct_in_addr_h
6461-
#define __wasilibc___struct_in_pktinfo_h
6462-
#define __wasilibc___struct_iovec_h
6463-
#define __wasilibc___struct_ip_mreq_h
6464-
#define __wasilibc___struct_ip_mreq_source_h
6465-
#define __wasilibc___struct_ip_mreqn_h
6466-
#define __wasilibc___struct_ip_msfilter_h
6467-
#define __wasilibc___struct_ip_opts_h
6468-
#define __wasilibc___struct_ipv6_mreq_h
6469-
#define __wasilibc___struct_msghdr_h
6390+
#define __wasilibc___struct_dirent_h
6391+
#define __wasilibc___struct_group_filter_h
6392+
#define __wasilibc___struct_group_req_h
6393+
#define __wasilibc___struct_group_source_req_h
6394+
#define __wasilibc___struct_if_addrs_h
6395+
#define __wasilibc___struct_in6_addr_h
6396+
#define __wasilibc___struct_in6_mtuinfo_h
6397+
#define __wasilibc___struct_in6_pktinfo_h
6398+
#define __wasilibc___struct_in_addr_h
6399+
#define __wasilibc___struct_in_pktinfo_h
6400+
#define __wasilibc___struct_iovec_h
6401+
#define __wasilibc___struct_ip_mreq_h
6402+
#define __wasilibc___struct_ip_mreq_source_h
6403+
#define __wasilibc___struct_ip_mreqn_h
6404+
#define __wasilibc___struct_ip_msfilter_h
6405+
#define __wasilibc___struct_ip_opts_h
6406+
#define __wasilibc___struct_ipv6_mreq_h
6407+
#define __wasilibc___struct_msghdr_h
64706408
#define __wasilibc___struct_pollfd_h
64716409
#define __wasilibc___struct_rusage_h
64726410
#define __wasilibc___struct_sockaddr_h
@@ -6507,20 +6445,10 @@
65076445
#define __wasm__ 1
65086446
#define __wasm_atomics__ 1
65096447
#define __wasm_bulk_memory__ 1
6510-
#define __wasm_mutable_globals__ 1
6511-
#define __wasm_sign_ext__ 1
65126448
#define _tolower(a) ((a)|0x20)
65136449
#define _toupper(a) ((a)&0x5f)
65146450
#define acos(x) __tg_real_complex(acos, (x))
65156451
#define acosh(x) __tg_real_complex(acosh, (x))
6516-
#define aio_cancel64 aio_cancel
6517-
#define aio_error64 aio_error
6518-
#define aio_fsync64 aio_fsync
6519-
#define aio_read64 aio_read
6520-
#define aio_return64 aio_return
6521-
#define aio_suspend64 aio_suspend
6522-
#define aio_write64 aio_write
6523-
#define aiocb64 aiocb
65246452
#define alignas _Alignas
65256453
#define alignof _Alignof
65266454
#define alloca __builtin_alloca
@@ -6673,7 +6601,6 @@
66736601
#define letoh32(x) (uint32_t)(x)
66746602
#define letoh64(x) (uint64_t)(x)
66756603
#define lgamma(x) __tg_real(lgamma, (x))
6676-
#define lio_listio64 lio_listio
66776604
#define llrint(x) __tg_real_nocast(llrint, (x))
66786605
#define llround(x) __tg_real_nocast(llround, (x))
66796606
#define loff_t off_t
@@ -6769,36 +6696,11 @@
67696696
#define rr_code rr_hdr.icmp6_code
67706697
#define rr_seqnum rr_hdr.icmp6_data32[0]
67716698
#define rr_type rr_hdr.icmp6_type
6772-
#define sa_handler __sa_handler.sa_handler
6773-
#define sa_sigaction __sa_handler.sa_sigaction
67746699
#define scalbln(x,y) __tg_real_2_1(scalbln, (x), (y))
67756700
#define scalbn(x,y) __tg_real_2_1(scalbn, (x), (y))
67766701
#define scandir64 scandir
67776702
#define setbit(x,i) __bitop(x,i,|=)
67786703
#define setjmp setjmp
6779-
#define si_addr __si_fields.__sigfault.si_addr
6780-
#define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
6781-
#define si_arch __si_fields.__sigsys.si_arch
6782-
#define si_band __si_fields.__sigpoll.si_band
6783-
#define si_call_addr __si_fields.__sigsys.si_call_addr
6784-
#define si_fd __si_fields.__sigpoll.si_fd
6785-
#define si_int si_value.sival_int
6786-
#define si_lower __si_fields.__sigfault.__first.__addr_bnd.si_lower
6787-
#define si_overrun __si_fields.__si_common.__first.__timer.si_overrun
6788-
#define si_pid __si_fields.__si_common.__first.__piduid.si_pid
6789-
#define si_pkey __si_fields.__sigfault.__first.si_pkey
6790-
#define si_ptr si_value.sival_ptr
6791-
#define si_status __si_fields.__si_common.__second.__sigchld.si_status
6792-
#define si_stime __si_fields.__si_common.__second.__sigchld.si_stime
6793-
#define si_syscall __si_fields.__sigsys.si_syscall
6794-
#define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
6795-
#define si_uid __si_fields.__si_common.__first.__piduid.si_uid
6796-
#define si_upper __si_fields.__sigfault.__first.__addr_bnd.si_upper
6797-
#define si_utime __si_fields.__si_common.__second.__sigchld.si_utime
6798-
#define si_value __si_fields.__si_common.__second.si_value
6799-
#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
6800-
#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
6801-
#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
68026704
#define signbit(x) (__builtin_signbit(x))
68036705
#define sin(x) __tg_real_complex(sin, (x))
68046706
#define sinh(x) __tg_real_complex(sinh, (x))

0 commit comments

Comments
 (0)