[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-10 Thread Jacob Gravelle via cfe-commits
jgravelle-google abandoned this revision. jgravelle-google added a comment. Abandoning in favor of https://github.com/kripken/emscripten/pull/4718 https://reviews.llvm.org/D26431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Derek Schuff via cfe-commits
dschuff added a comment. Yeah, I don't mean for this to be the final word; mostly this just matches asm.js. I do agree with you that the unixy stuff goes with the emscripten environment rather than wasm per se. I had thought we might define emscripten as an "OS" (i.e. the third or maybe even 4t

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Jacob Gravelle via cfe-commits
jgravelle-google added a comment. I think you're right, it's the Emscripten embedding that's unixy, therefore Emscripten should be responsible for telling clang to be unixy. To play devil's advocate, it might be advantageous for all compile-to-wasm code to assume a common environment, and unix

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Dan Gohman via cfe-commits
sunfish added a comment. The other main way we could provide __unix et al would be to add them to tools/shared.py in Emscripten (see the comment "wasm target does not automatically define emscripten stuff"). It's not clear to me whether that's better than adding the macros to clang itself or no

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Jacob Gravelle via cfe-commits
jgravelle-google added a comment. For the emscripten testsuite, specifically test_zlib relies on `#ifdef __unix__` to `#include `, which it needs. The rest of the unistd tests don't actually care. So we could make that test pass by explicitly adding a define for __unix__ for it, but I figure it

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Dan Gohman via cfe-commits
sunfish added a comment. When adding new predefined macros, please also add the new macros to test/Preprocessor/init.c (and remove negative tests that no longer apply). Also though, I'd also like to understand this a little more. Even with emulation, there will be limits to how Unixy a Web envi

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Derek Schuff via cfe-commits
dschuff accepted this revision. dschuff added a comment. This revision is now accepted and ready to land. Also it matches asm.js @sunfish is planning on unifying the triples, and this will be part of that (and there may be more defines that we want to add and/or subtract), but for now it makes m

[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

2016-11-08 Thread Jacob Gravelle via cfe-commits
jgravelle-google created this revision. jgravelle-google added reviewers: dschuff, sunfish. jgravelle-google added a subscriber: cfe-commits. Herald added a subscriber: jfb. Unix is a convenient common denominator for embeddings to implement syscalls for. This makes it explicit that wasm is unix-y