I get this when trying to use libraries:

$ emcc -o conftest -I/home/todd/try2/include -L/home/todd/try2/lib 
conftest.c -lgmp
/home/todd/try2/lib/libgmp.so: file not recognized: File format not 
recognized
clang-3.3: error: linker command failed with exit code 1 (use -v to see 
invocation)


libgmp.so looks like the right type:

$ file /home/todd/try2/lib/libgmp.so
/home/todd/try2/lib/libgmp.so: LLVM IR bitcode


The -v option reveals the culprit:

$ emcc -v -o conftest -I/home/todd/try2/include -L/home/todd/try2/lib 
conftest.c -lgmp
clang version 3.3
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/home/todd/emscripten-fastcomp/build/bin/clang-3.3" -cc1 -triple 
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free 
-disable-llvm-verifier -main-file-name conftest.c -mrelocation-model static 
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases 
-munwind-tables -fuse-init-array -target-cpu x86-64 -v -nostdsysteminc 
-nobuiltininc -resource-dir 
/home/todd/emscripten-fastcomp/build/bin/../lib/clang/3.3 -D __EMSCRIPTEN__ 
-D EMSCRIPTEN -I /home/todd/try2/include -fdebug-compilation-dir 
/home/todd/try2/mpfr-3.1.1 -ferror-limit 19 -fmessage-length 189 
-mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties 
-fdiagnostics-show-option -fcolor-diagnostics -backend-option 
-vectorize-loops -nobuiltininc -nostdsysteminc 
-isystem/home/todd/emscripten/system/local/include 
-isystem/home/todd/emscripten/system/include/compat 
-isystem/home/todd/emscripten/system/include 
-isystem/home/todd/emscripten/system/include/emscripten 
-isystem/home/todd/emscripten/system/include/bsd 
-isystem/home/todd/emscripten/system/include/libc 
-isystem/home/todd/emscripten/system/include/gfx 
-isystem/home/todd/emscripten/system/include/net 
-isystem/home/todd/emscripten/system/include/SDL 
-isystem/home/todd/emscripten/system/include/libcxx -o 
/tmp/conftest-9LGfCY.o -x c conftest.c
clang -cc1 version 3.3 based upon LLVM 3.3svn default target 
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/home/todd/emscripten/system/local/include"
ignoring nonexistent directory "/home/todd/emscripten/system/include/bsd"
ignoring nonexistent directory "/home/todd/emscripten/system/include/net"
#include "..." search starts here:
#include <...> search starts here:
 /home/todd/try2/include
 /home/todd/emscripten/system/include/compat
 /home/todd/emscripten/system/include
 /home/todd/emscripten/system/include/emscripten
 /home/todd/emscripten/system/include/libc
 /home/todd/emscripten/system/include/gfx
 /home/todd/emscripten/system/include/SDL
 /home/todd/emscripten/system/include/libcxx
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker 
/lib64/ld-linux-x86-64.so.2 -o conftest 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o 
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o -L/home/todd/try2/lib 
-L/usr/lib/gcc/x86_64-linux-gnu/4.8 
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu 
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu 
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -L/lib -L/usr/lib 
/tmp/conftest-9LGfCY.o -lgmp -lgcc --as-needed -lgcc_s --no-as-needed -lc 
-lgcc --as-needed -lgcc_s --no-as-needed 
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
/home/todd/try2/lib/libgmp.so: file not recognized: File format not 
recognized
clang-3.3: error: linker command failed with exit code 1 (use -v to see 
invocation)


/usr/bin/ld shouldn't be invoked, should it?

This is a fresh checkout of emscripen, emscripten-fastcomp, 
and emscripten-fastcomp-clang running on Ubuntu 14.04.

Did I miss a key step in the build instructions?

Todd

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to