Comments (4)
Also as a side note, on Mac OS, this happens later on:
[email protected] ~/W/g/wac $ emmake make
gcc -DPLATFORM=1 -std=gnu99 -m32 -g -c wa.c -o wa.o
gcc -DPLATFORM=1 -std=gnu99 -m32 -g -c util.c -o util.o
gcc -DPLATFORM=1 -std=gnu99 -m32 -g -c thunk.c -o thunk.o
gcc -DPLATFORM=1 -std=gnu99 -m32 -g -c platform_libc.c -o platform_libc.o
platform_libc.c:18:53: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
FATAL("Could not allocate %d bytes for %s", (int)nmemb * size, name);
~~ ^~~~~~~~~~~~~~~~~
%lu
./util.h:20:21: note: expanded from macro 'FATAL'
fprintf(stderr, __VA_ARGS__); exit(1); \
^~~~~~~~~~~
platform_libc.c:28:53: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
FATAL("Could not allocate %d bytes for %s", (int)nmemb * size, name);
~~ ^~~~~~~~~~~~~~~~~
%lu
./util.h:20:21: note: expanded from macro 'FATAL'
fprintf(stderr, __VA_ARGS__); exit(1); \
^~~~~~~~~~~
2 warnings generated.
ar rcs wa.a wa.o util.o thunk.o platform_libc.o
gcc -DPLATFORM=1 -std=gnu99 -m32 -g -c wac.c -o wac.o
gcc -DPLATFORM=1 -std=gnu99 -m32 -g -rdynamic -Wl,--no-as-needed -o wac \
-Wl,--start-group wa.a wac.o -Wl,--end-group -lm -ldl -ledit
ld: unknown option: --no-as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [wac] Error 1
from wac.
@IngwiePhoenix I wasn't seeing those warning with my version of gcc (5.4.0) but I've pushed changes that should fix that. Can you check and verify that it builds for you?
from wac.
On OS X, the default compiler is LLVM Clang. Howeve,r as you mentioned GCC, I decided to change my make
invocation into this:
[email protected] ~/W/g/wac $ env HOST_CC=/usr/local/opt/gcc/bin/gcc-8 CFLAGS="-I "(xcrun --show-sdk-path)/usr/include make
/usr/local/opt/gcc/bin/gcc-8 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -DPLATFORM=1 -std=gnu99 -m32 -g -c wa.c -o wa.o
/usr/local/opt/gcc/bin/gcc-8 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -DPLATFORM=1 -std=gnu99 -m32 -g -c util.c -o util.o
/usr/local/opt/gcc/bin/gcc-8 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -DPLATFORM=1 -std=gnu99 -m32 -g -c thunk.c -o thunk.o
/usr/local/opt/gcc/bin/gcc-8 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -DPLATFORM=1 -std=gnu99 -m32 -g -c platform_libc.c -o platform_libc.o
ar rcs wa.a wa.o util.o thunk.o platform_libc.o
/usr/local/opt/gcc/bin/gcc-8 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -DPLATFORM=1 -std=gnu99 -m32 -g -c wac.c -o wac.o
/usr/local/opt/gcc/bin/gcc-8 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -DPLATFORM=1 -std=gnu99 -m32 -g -rdynamic -Wl,--no-as-needed -o wac \
-Wl,--start-group wa.a wac.o -Wl,--end-group -lm -ldl -ledit
ld: unknown option: --no-as-needed
collect2: error: ld returned 1 exit status
make: *** [wac] Error 1
Note, I am using the Fish shell - that is why the command substition is a little bit off and weird-looking.
But as you see, warnings gone! :)
from wac.
That means that the ld on OS X doesn't support the --no-as-needed
flag. I suspect that you can probably drop that flag and you should be okay. It might not be needed on Linux (I think --no-as-needed is default but there was a valid reason I needed it in the past). But it will probably be a while before I can around to testing that for sure. I'm going to close the bug for now since the issue is specific to OS X ld.
from wac.
Related Issues (15)
- Use wast2json instead for generating tests? HOT 2
- Any plans to allow x64 (amd64) builds? HOT 6
- performance?
- Multiple heap-buffer-overflow vulnerabilities in interpret HOT 7
- Multiple heap-buffer-overflow in load_module HOT 1
- heap-buffer-overflow in setup_call
- Dynamic memory allocation and sandboxing HOT 3
- DoS in wace
- cannot pull kanaka/emscripten from docker hub HOT 1
- Arm support? HOT 5
- wac crashes
- segmentation fault when running clang built wasm HOT 2
- examples cannot stat wasm files HOT 7
- Windows build download link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wac.