583 Commits

Author SHA1 Message Date
Sam Clegg
2b2b3bdbe3
[WebAssembly] wasm.js: use explicity variable for main_module (#43) 2018-01-22 15:18:08 -08:00
Sam Clegg
c93b284f39
[WebAssembly] Add call to __wasm_call_ctors on startup if found (#42) 2018-01-18 12:36:54 -08:00
Sam Clegg
ac877172c1
[WebAssembly] Add stub for _Unwind_ForcedUnwind (#41) 2018-01-17 19:24:15 -08:00
Sam Clegg
b93ae1f7eb [WebAssembly] Add TODO 2018-01-17 14:38:49 -08:00
Sam Clegg
dbd68988a8 [WebAssembly] Update PAGE_SIZE for 64k
See: 910e3cace5/Semantics.md (resizing)
2018-01-16 17:23:54 -08:00
Sam Clegg
9064441edc
[WebAssembly] Support grow memory in brk() (#39) 2018-01-16 17:20:44 -08:00
Sam Clegg
ddb01fbf88 handle oom 2018-01-13 09:23:30 -08:00
Sam Clegg
3ce20a9f57 [WebAssembly] wasm.js: implement brk 2018-01-13 08:47:42 -08:00
Sam Clegg
0c827335e4
[WebAssebmly] Implement a_cas() in arch/wasm32/atomic_arch.h (#36) 2018-01-13 08:46:40 -08:00
Sam Clegg
0bf0e9f1fe
wasm.js: Add unwind symbols needed by libc++abi (#35) 2018-01-11 15:21:59 -08:00
Sam Clegg
4b17a3b40c
Rename wasm.syms -> libc.imports (#34) 2018-01-11 14:33:17 -08:00
Derek Schuff
190dffd141 remove extra logging 2017-12-15 13:23:12 -08:00
Derek Schuff
4b606b59d4 Support node.js in wasm loader
The latest LTS of Node supports wasm, and this allows us to test
against it, as well as the shells.
2017-12-13 15:53:52 -08:00
Sam Clegg
c34cb0b46a [WebAssembly] Remove empty headers
These are provided by arch/generic.
2017-11-30 15:14:40 -08:00
Sam Clegg
2b92b728e3 Merge remote-tracking branch 'upstream/master' into HEAD 2017-11-29 15:46:05 -08:00
Sam Clegg
b49da62f23
Implement writv syscall so that musl printf works (#26) 2017-11-20 17:13:33 -08:00
Sam Clegg
6a45034cab
[WebAssembly] Cleanup syscall handling in wasm.js (#25)
Also, ignore a couple of syscall by return 0 rather
than -1.  This allows the musl startup code to get
furthur.
2017-11-17 17:01:15 -08:00
Sam Clegg
0f2a7be58e
[WebAssembly] Add syscall numbers of wasm.js (#23)
I verified that this change doesn't change the list
of failing tests on the wasm waterfall.
2017-11-16 12:28:18 -08:00
Sam Clegg
9f20a8a3c2
[WebAsembly] Build thread code (#22) 2017-11-15 15:58:02 -08:00
Sam Clegg
c185c68dd0
[WebAssembly] Use hardcoded list expected undefined symbols (#21)
Rather than generate wasm.syms from wasm.js (which includes
a huge superset of the number of symbols actaully expected
to be undefined at link time) simply hardcode that list as
a test file, which lld can read.
2017-11-07 15:17:25 -08:00
Sam Clegg
8116ebcd0c
[WebAssembly] Fix shared library loading (#17)
Loading of shared libraries was broken back in:
39fde60

This change restores the ability for shared libraries to
be loaded such that they can share memory and provide
function exports to the main executable.

However the executable that libraries still need to built
in a specific way (i.e. all importing the same sized memory)
and their static globals need to be in the different address
range. This has the complication that the executables won't
run the wasm spec interpreter (since it doesn't pass in a
memory to the executables it runs). So although I'm fixing this
here in the musl repo I'm also proposiing that we remove the
continuous testing of this configurations on the wasm waterfall
in favor of concentrating on the statically linking lld case:
WebAssembly/waterfall#271
2017-11-06 14:18:53 -08:00
Szabolcs Nagy
13935337f3 s390x: use generic ioctl.h
s390 can use the generic ioctls definitions other than FIOQSIZE (like arm).

this fixes some missing ioctls and two incorrect ones:
TIOCTTYGSTRUCT and TIOCM_MODEM_BITS seem to be defined on frv
target only in linux.
2017-11-05 18:43:51 -05:00
Szabolcs Nagy
4dc44ce8e2 microblaze: add statx syscall from linux v4.13
statx number is allocated for microblaze in linux commit
f5ef419630e85e80284cd0256cb5a13a66bbd6c5
2017-11-05 18:41:29 -05:00
Szabolcs Nagy
ffd048a07b aarch64: add extra_context struct from linux v4.13
allows expanding the signal frame beyond the 4k reserved space.
new in linux commit 33f082614c3443d937f50fe936f284f62bbb4a1b
2017-11-05 18:41:27 -05:00
Szabolcs Nagy
754f66afb7 ioctl TIOCGPTPEER from linux v4.13
added for safe opening of peer end of pty in a mount namespace.
new in linux commit c6325179238f1d4683edbec53d8322575d76d7e2
2017-11-05 18:41:22 -05:00
Szabolcs Nagy
5daaed6a0e s390x: add syscall number for s390_guarded_storage from linux v4.12
new syscall in linux commit 916cda1aa1b412d7cf2991c3af7479544942d121
2017-11-05 18:41:19 -05:00
Szabolcs Nagy
2dc6760f3c i386: add arch_prctl syscall number from linux v4.12
syscall for i386 compat mode on x86_64 for non-x86_64 prctls.
new in linux commit 79170fda313ed5be2394f87aa2a00d597f8ed4a1
2017-11-05 18:41:18 -05:00
Szabolcs Nagy
840d45bebd aarch64: add new HWCAP_* flags from linux v4.12
hwcap bits for armv8.3 extensions, added in linux commits
c8c3798d2369e4285da44b244638eafe446a8f8a
cb567e79fa504575cb97fb2f866d2040ed1c92e7
c651aae5a7732287c1c9bc974ece4ed798780544
2017-11-05 18:41:16 -05:00
Szabolcs Nagy
9864f60e92 add statx syscall numbers from linux v4.11
statx was added in linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
(there is no libc wrapper yet and microblaze and sh misses the number).
2017-11-05 18:41:11 -05:00
Szabolcs Nagy
bd1560f6eb update aarch64 hwcap.h for linux v4.11
new hwcap bits were added in kernel commits
77c97b4ee21290f5f083173d957843b615abbff2
f92f5ce01ee6a6a86cbfc4e3b0d18529c302b1ea
2017-11-05 18:41:04 -05:00
Szabolcs Nagy
cee73f0c10 add kexec_file_load syscall number on powerpc from linux v4.10
added in linux commit 80f60e509a03ff9ff2bdbf9cd1e935c6360b8bd9
2017-11-05 18:41:02 -05:00
Szabolcs Nagy
8f56955713 add microblaze syscall numbers from linux v4.10
missing syscalls got allocated on microblaze.
2017-11-05 18:41:00 -05:00
Sam Clegg
e7fb361e60 [WebAssembly] Fix bug in wasm.js version of strchr 2017-11-03 17:46:28 -07:00
Sam Clegg
319abd03d4
Add --dump-ffi-symbols argument to wasm.js (#5)
This allows a list of all symbols exports by wasm.js to be
generated which is usefull for passing to my prototype of
lld which takes an --allow-undefined-symbols=<filename>
argument.
2017-10-30 17:37:48 -07:00
Sam Clegg
a7161e9449 [WebAssembly] Exclude less in libc.py 2017-10-27 14:39:51 -07:00
Rich Felker
1b9406b03c fix build regression on ARM for ISA levels less than v5
commit 06fbefd10046a0fae7e588b7c6d25fb51811b931 (first included in
release 1.1.17) introduced this regression.

patch by Adrian Bunk. it fixes the regression in all cases, but
spuriously prevents use of the clz instruction on very old compiler
versions that don't define __ARM_ARCH. this may be fixed in a more
general way at some point in the future. it also omits thumb1 logic
since building as thumb1 code is currently not supported.
2017-10-25 11:54:16 -04:00
JF Bastien
46cf4c8640 Merge pull request #11 from sbc100/add_letf2
[WebAssembly] Add llvm builting '__letf2' to wasm.js
2017-10-20 16:46:44 -07:00
Sam Clegg
96aea19aae [WebAssembly] Updaet alltypes.h.in 2017-10-20 16:21:39 -07:00
Sam Clegg
addf7f9215 [WebAssembly] Add llvm builting '__letf2' to wasm.js 2017-10-20 13:33:55 -07:00
Sam Clegg
94500fb127 [WebAssembly] Enable building with 'make' command
This change enables all of the .c sources in musl
be built with the clang -target wasm32-unknown-unknown-wasm
2017-10-19 17:42:50 -07:00
Szabolcs Nagy
c10bc61508 powerpc{64}: fix MAP_NORESERVE and MAP_LOCKED in mman.h
MAP_{NORESERVE,LOCKED} have different values on powerpc than in generic.
2017-09-11 14:06:27 -04:00
Szabolcs Nagy
822dddfbf1 make syscall.h consistent with linux
most of the found naming differences don't matter to musl, because
internally it unifies the syscall names that vary across targets,
but for external code the names should match the kernel uapi.

aarch64:
	__NR_fstatat is called __NR_newfstatat in linux.
	__NR_or1k_atomic got mistakenly copied from or1k.
arm:
	__NR_arm_sync_file_range is an alias for __NR_sync_file_range2
	__NR_fadvise64_64 is called __NR_arm_fadvise64_64 in linux,
	the old non-arm name is kept too, it should not cause issues.
	(powerpc has similar nonstandard fadvise and it uses the
	normal name.)
i386:
	__NR_madvise1 was removed from linux in commit
	303395ac3bf3e2cb488435537d416bc840438fcb 2011-11-11
microblaze:
	__NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite
	had different name in linux.
mips:
	__NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite, __NR_select
	had different name in linux.
mipsn32:
	__NR_fstatat is called __NR_newfstatat in linux.
or1k:
	__NR__llseek is called __NR_llseek in linux.
	the old name is kept too because that's the name musl uses
	internally.
powerpc:
	__NR_{get,set}res{gid,uid}32 was never present in powerpc linux.
	__NR_timerfd was briefly defined in linux but then got renamed.
2017-09-06 19:29:25 -04:00
Szabolcs Nagy
8459c6f264 arm: add HWCAP_ARM_ hwcap macros
Glibc renamed the linux uapi HWCAP_* macros to HWCAP_ARM_*
so have both variants in case some code depends on it.
(The HWCAP2_ macros are not defined in glibc currently so those
only have the linux uapi variant.)
2017-08-29 22:16:19 -04:00
Szabolcs Nagy
06fbefd100 add a_clz_64 helper function
counts leading zero bits of a 64bit int, undefined on zero input.
(has nothing to do with atomics, added to atomic.h so target specific
helper functions are together.)

there is a logarithmic generic implementation and another in terms of
a 32bit a_clz_32 on targets where that's available.
2017-08-29 21:47:10 -04:00
Szabolcs Nagy
3356177979 s390x: add bits/hwcap.h
aligned with linux arch/s390/include/asm/elf.h
(these macros should be exported into uapi, but they are not)
2017-08-29 21:40:35 -04:00
Szabolcs Nagy
cc08669380 add SIOCGSTAMPNS socket ioctl macro to ioctl.h
it is defined in linux asm/sockios.h since commit
ae40eb1ef30ab4120bd3c8b7e3da99ee53d27a23 (linux v2.6.22)
but was missing from musl by accident.

in musl the sockios macros are exposed in sys/ioctl.h together
with other ioctl requests instead of in sys/socket.h because of
namespace rules. (glibc has them in sys/socket.h under _GNU_SOURCE.)
2017-08-29 19:48:37 -04:00
Szabolcs Nagy
02b50c9d0a fix mips ioctl macros to match linux asm/sockios.h 2017-08-29 19:48:35 -04:00
Heejin Ahn
30930bef22 Fix bugs in strcmp/strncmp/strchr
Added strcmp/strncmp implementations that follow the libc spec, and
fixed a bug in strchr. This makes a couple more tests pass in Wasm
waterfall.
2017-08-22 15:46:51 -07:00
Thomas Petazzoni
1698fe6cdc fix build failure for sh4a due to missing colon in asm statement
Due to a missing ":" in an asm() statement, the "memory" clobber is
considered by gcc as an input operand and not a clobber, which causes a
build failure.
2017-08-11 21:06:57 -04:00
Rich Felker
5948bc1a64 fix omission of microblaze user.h definitions 2017-06-21 12:47:15 -04:00