Commit Graph

212 Commits

Author SHA1 Message Date
Ximin Luo
ce4f93f4ce Update d/changelog, patches 2020-09-04 17:28:51 +01:00
Ximin Luo
ade3cecb6b Update upstream source from tag 'upstream/0.0_git20200731.215adc8'
Update to upstream version '0.0~git20200731.215adc8'
with Debian dir 2eea1c752d
2020-09-04 17:27:59 +01:00
Ximin Luo
130d22db7b New upstream version 0.0~git20200731.215adc8 2020-09-04 17:27:57 +01:00
Ximin Luo
b81b8ba349 update upstream git url 2020-09-04 17:27:26 +01:00
Ximin Luo
5dee6353b3 Release 0.0~git20200319.9efc2f4-2 to Debian unstable. 2020-08-05 21:52:27 +01:00
Ximin Luo
7ec44c5196 Update to LLVM 10 2020-08-05 21:51:24 +01:00
Dan Gohman
215adc8ac9
Redefine the access bits to be compatible with other systems (#210)
Normally bits like this would be considered implementation details, but
in this case, `X_OK`, `W_OK`, and `R_OK` line up with `S_IXOTH`,
`S_IWOTH`, and `S_IROTH` on other systems, and those bits do have
well-known values.
2020-07-31 13:44:58 -07:00
Ximin Luo
62cefc66f6 Release 0.0~git20200319.9efc2f4-1 to Debian unstable. 2020-07-04 17:25:33 +01:00
Ximin Luo
f1f691b292 Update changelog 2020-07-04 17:25:28 +01:00
Ximin Luo
38018176d4 Update upstream source from tag 'upstream/0.0_git20200319.9efc2f4'
Update to upstream version '0.0~git20200319.9efc2f4'
with Debian dir c20be67b07
2020-07-04 17:24:11 +01:00
Ximin Luo
e176eadaa1 New upstream version 0.0~git20200319.9efc2f4 2020-07-04 17:24:08 +01:00
Ximin Luo
03a143026b add more precise instructions on updating the source package 2020-07-04 17:22:22 +01:00
Dan Gohman
00cc5944df
Comment a use of __attribute__((visibility("protected"))). (#204)
This comments out a use of "protected" visibility, since
[WebAssembly doesn't support it].

[WebAssembly doesn't support it]: https://reviews.llvm.org/D81688
2020-06-12 20:21:12 -07:00
Dan Gohman
4e45d2b5ad
Rename __prepare_for_exit to __wasm_call_dtors. (#201)
This emphasizes the relationship with `__wasm_call_ctors`. Note however
that while `__wasm_call_ctors` is synthesized by the linker,
`__wasm_call_dtors` is still defined by libc.

Static constructors are registered statically, but static destructors
need to be registered dynamically so that they only run if their
corresponding static constructors have run, and so that they're
ordered with respect to interleaved `atexit` calls.
2020-06-08 15:21:18 -07:00
Dan Gohman
5a7ba74c19
Avoid calling poll_oneoff with zero subscriptions. (#162)
* Avoid calling `poll_oneoff` with zero subscriptions.

With https://github.com/WebAssembly/WASI/pull/193 merged, WASI is moving
to make `poll_oneoff` with no arguments an error. Even though that's in
ephemeral and not yet in a snapshot, we can start to anticipate it in
libc:
 - Remove the `pause` function, since WASI has no signals and thus no
   way to ever wake it up short of having the host terminate it.
 - Make `poll` and `pselect` return `ENOTSUP` in the case of having no
   events to wait for.

* Remove `pause` from the defined-symbols.txt list.

* Fix __wasilibc_unmodified_upstream markers.

* Check for zero subscriptions, rather than zero events.

Make `poll` and `pselect` return `ENOTSUP` when asked to poll on zero
subscriptions, rather than when the systerm returns zero events.

While here, drop the `__wasilibc_unmodified_upstream` markers, which
were already pretty noisy here, and would be significantly worse with
this change.

* Add comments about the subtle relationship between nfds and nsubscriptions.

* Rewrite the comment.

* Fix code quotes.
2020-06-01 19:00:30 -07:00
Dan Gohman
753cc4344d
Merge the basics component into libc-bottom-half. (#199)
We no longer have a need to maintain basics as a separate component.
Folding it into libc-bottom-half eliminates a fair amount of redundancy.
2020-06-01 16:44:05 -07:00
Dan Gohman
84c0778bff
Rewrite the preopen functionality. (#173)
* Rewrite the preopen functionality.

Rewrite the preopen functionality to be simpler, better organized,
and better integrated into WASI libc. Preopen support has diverged so
much from libpreopen that it no longer makes sense to track libpreopen
as an explicit upstream. And add more documentation.

* Fix missing #include.

* Fix a compilation error.
2020-06-01 14:32:24 -07:00
Dan Gohman
d1cd4f4836
Replace old <signal.h> support with emulated <signal.h> support. (#183)
wasm doesn't support signals, so provide an emulation layer, enabled
with -D_WASI_EMULATED_SIGNAL and -lwasi-emulated-signal.
2020-05-29 13:07:52 -07:00
Dan Gohman
a6d0b4c74b
Reactor support. (#74)
* Add support for the Reactor model.

* Mark _activate and _start as wasm exports.

* Rename _activate to _initialize.

* Don't define `_fini`.

* Rename reactor-crt1.c to crt1-reactor.c.
2020-05-29 09:09:58 -07:00
whitequark
3e9892fc41
Make mmap() possible to use in a conformant way. (#197) 2020-05-26 12:49:13 -07:00
whitequark
9b9d243bea
Make munmap() actually work. (#198)
Before this commit, he header of a mapped area, `struct map`, was
defined as follows:

    struct map {
        int prot;
        int flags;
        off_t offset;
        size_t length;
        char body[];
    };

Because the size and alignment of an `off_t` is 8 bytes, the entire
structure was padded to 24 bytes. However, the offset of `body` into
`struct map` was only 20 bytes. Therefore the code in mmap() and
munmap() did not agree on the offset from header to body.

This commit changes mmap() to skip the entire header, which is what
munmap() expects and what the size calculation uses.
2020-05-26 12:14:52 -07:00
Pat Hickey
86550c37ab
CI: use llvm 10.0.0 release (#194)
* CI: use llvm 10.0.0 release

* ci: download mac over https, add -L flag to curl

* llvm 10 is shipping for ubuntu 18.04, which is reasonable

* llvm releases are now served from github! 🎉

* oops

* one of these days ill get it right

* love too program in yml

* missed the other spot to convert to 18.04

* mac ci: fix clang_dir
2020-04-06 16:53:56 -07:00
Pat Hickey
1792d02ac9 debug 2020-04-06 15:06:01 -07:00
Pat Hickey
ee2726700c github ci: download llvm over https, add -L flag to curl
L means follow redirects
2020-04-06 15:06:01 -07:00
Ximin Luo
be5dd99218 Release 0.0~git20200114.1fad338-1 to Debian unstable. 2020-04-04 02:54:21 +01:00
Ximin Luo
093e6d29e2 Update changelog 2020-04-04 02:54:05 +01:00
Ximin Luo
a36001f95f Update upstream source from tag 'upstream/0.0_git20200114.1fad338'
Update to upstream version '0.0~git20200114.1fad338'
with Debian dir 8e75f3f1d1
2020-04-04 02:51:34 +01:00
Ximin Luo
65248e3c40 New upstream version 0.0~git20200114.1fad338 2020-04-04 02:51:31 +01:00
Ximin Luo
7e8060bb18 update watch file, and add instructions on updating the upstream source 2020-04-04 02:49:19 +01:00
Ximin Luo
8f28857f9e Release 0.0~git20191220.a280fea-2 to Debian unstable. 2020-04-04 01:12:57 +01:00
Olaf Tomalka
7b92f334e6
Added utime.h (#188)
* Added utime.h

* Changes after code review

* Auto-generated expected files instead of manually editing
* Fix libpreopoen stat and utime not following symlinks correctly
2020-04-03 15:39:43 -07:00
Pat Hickey
156fdc476a regenerate api.h 2020-04-02 15:54:40 -07:00
Pat Hickey
e2bdce89ea gen-headers: make handle output consistient with prior 2020-04-02 15:54:40 -07:00
Pat Hickey
fcbf8f40ea wasi submodule: point to latest (witx 0.8.5 release) 2020-04-02 15:54:40 -07:00
Pat Hickey
4b41c5d5ec Update libc-top-half/musl/README
Co-Authored-By: Gabor Greif <ggreif@gmail.com>
2020-04-01 11:25:51 -07:00
Gabor Greif
718dcbb50e Update URL 2020-04-01 11:25:51 -07:00
Gabor Greif
2408ea94aa Fix references to musl version 2020-04-01 11:25:51 -07:00
Dan Gohman
41af0db30f
Makefile refactoring; NFC (#186)
* Use ?= for variables intended to be overridable.

* Use `override` consistently for variables not meant to be overridden.

* Omit miscellaneous comments from the build output.

* Tidy up some comments.

* Use `addprefix` to factor out a common prefix.

* Add a comment.

* Reorganize.

* Adjust indentation.

* Simplify the logic for the `check` rule.

* Remove the `override` keywords.

They theoretically protect what the Makefile considers to be
implementation details from being overridden on the command-line,
but in practice this isn't super important, and they add a lot of
clutter.

* Put source file names on their own lines.
2020-03-20 15:45:37 -07:00
Dan Gohman
9efc2f4283
Lazy-initialize the environment variables. (#184)
* Lazy-initialize the environment variables.

This is the first in a series of PRs to make it easier to use WASI libc
in Wasm modules that don't have a `main` function. By initializing the
environment on demand, we avoid depending on having `__wasm_call_ctors`
run.

This uses weak symbols strategically to ensure that if `environ` is
used, it is initialized eagerly, but if only `getenv` and friends
are used, the environment is initialized lazily.

Eventually, I expect we'll have a convention for wasm modules without
main functions which will allow the `__wasm_call_ctors` function to be
called automatically, but this helps in simple cases for now.

Fixes #180.

* Add comments explaining the libc-environ-compat.h header usage.
2020-03-19 09:32:41 -07:00
Sam Clegg
38b930a26b
Fix -std=gnu17 when generating predefined_macros.txt (#187)
* Fix -std=gnu11 when generating predefined_macros.txt

The default recently changed in upstream clang:
https://reviews.llvm.org/D75383

We want to be immune to such things when generating this list so that
we can build wasi-libc with any recent clang version.

* 17
2020-03-18 04:26:57 -07:00
Dan Gohman
42e6901e58 Mention libcxx and libcxxabi too. 2020-03-17 17:44:08 -07:00
Dan Gohman
c33ea73e0e Update WASI Libc's README.md.
Update the description, point users to wasi-sdk as a simpler place to
get started using this library, and remove old text about being a
"reference" implementation.
2020-03-17 17:44:08 -07:00
Ximin Luo
50aa6b5be5 Mark as M-A: foreign for cross-compiling 2020-03-09 00:41:46 +00:00
Ximin Luo
1744d187e2 Release 0.0~git20191220.a280fea-1 to Debian unstable. 2020-03-08 22:38:24 +00:00
Ximin Luo
fcd63b0d8a Add README.source 2020-03-08 22:38:10 +00:00
Ximin Luo
f1bc8cca90 Rewind changelog as those releases were REJECTed by FTP masters 2020-03-08 22:36:03 +00:00
Ximin Luo
4725397c38 Fix copyright and update some more metadata 2020-03-08 22:33:30 +00:00
Dan Gohman
0cc57ac7b4
Multi-license wasi-libc under Apache and MIT licenses. (#174)
Multi-license wasi-libc under the Apache-2.0 WITH LLVM-exception,
Apache-2.0, and MIT licenses.
2020-02-29 10:52:28 +01:00
Dan Gohman
d9066a87c0 Add support for __main_argc_argv.
This adds support for the `__main_argc_argv` change, while preserving
compatibility with `__original_main`. This is needed by the LTO build
because the `__original_main` hack works in LLVM codegen, which is after
LTO. The `__main_argc_argv` change is implemented in clang, which makes
it properly visible to LTO.
2020-02-27 13:09:38 -08:00
Dan Gohman
575e1579a4 Update to musl 1.2.0.
See the WHATSNEW file for details. The biggest change in musl is the
switch to 64-bit time_t for 32-bit targets, however WASI libc was already
using 64-bit time_t. The main change affecting WASI is an update to
Unicode 12.1.0.
2020-02-26 10:23:05 -08:00