*1) Updated from issue #2*

$ clang++ -emit-llvm -c test.cpp -I/usr/local/include -L/usr/local/lib 
-lopencv_core -lopencv_highgui -o test.bc
clang: warning: -lopencv_core: 'linker' input unused
clang: warning: -lopencv_highgui: 'linker' input unused
clang: warning: argument unused during compilation: '-L/usr/local/lib'

$ em++ test.bc -o a.out.html -I/usr/local/include -L/usr/local/lib 
-lopencv_core -lopencv_highgui -v
WARNING  root: -I or -L of an absolute path "-I/usr/local/include" 
encountered. If this is to a local system header/library, it may cause 
problems (local system files make sense for compiling natively on your 
system, but not necessarily to JavaScript). Pass '-Wno-warn-absolute-paths' 
to emcc to hide this warning.
DEBUG    root: invocation: /dist/emscripten/emcc test.bc 
-I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_highgui -v
DEBUG    root: looking for library "opencv_core"
DEBUG    root: found library "opencv_core" at 
/usr/local/lib/libopencv_core.dylib
DEBUG    root: looking for library "opencv_highgui"
DEBUG    root: found library "opencv_highgui" at 
/usr/local/lib/libopencv_highgui.dylib
DEBUG    root: compiling to bitcode
DEBUG    root: emcc step "parse arguments and setup" took 0.00 seconds
DEBUG    root: copying bitcode file: test.bc
DEBUG    root: copying library file: /usr/local/lib/libopencv_core.dylib
DEBUG    root: copying library file: /usr/local/lib/libopencv_highgui.dylib
DEBUG    root: emcc step "bitcodeize inputs" took 0.01 seconds
DEBUG    root: emcc step "bitcodeize inputs" took 0.00 seconds
DEBUG    root: will generate JavaScript
DEBUG    root: including libcxx
DEBUG    root: including libcextra
DEBUG    root: including libcxxabi
DEBUG    root: including gl
DEBUG    root: including libc
DEBUG    root: emcc step "calculate system libraries" took 0.03 seconds
DEBUG    root: linking: ['/tmp/tmpN8Nvxg/test_0.o', 
'/tmp/tmpN8Nvxg/libopencv_core_1.dylib', 
'/tmp/tmpN8Nvxg/libopencv_highgui_2.dylib', 
'/Users/hayssm/.emscripten_cache/libcxx.bc', 
'/Users/hayssm/.emscripten_cache/libcextra.bc', 
'/Users/hayssm/.emscripten_cache/libcxxabi.bc', 
'/Users/hayssm/.emscripten_cache/gl.bc', 
'/Users/hayssm/.emscripten_cache/libc.bc']
DEBUG    root: emcc: llvm-linking: ['/tmp/tmpN8Nvxg/test_0.o', 
'/Users/hayssm/.emscripten_cache/libcxx.bc', 
'/Users/hayssm/.emscripten_cache/libcextra.bc', 
'/Users/hayssm/.emscripten_cache/libcxxabi.bc', 
'/Users/hayssm/.emscripten_cache/gl.bc', 
'/Users/hayssm/.emscripten_cache/libc.bc'] to /tmp/tmpN8Nvxg/a.out.bc
WARNING: Linking two modules of different data layouts: 
'/Users/hayssm/.emscripten_cache/libcxx.bc' is 
'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32'
 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 
'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128'
WARNING: Linking two modules of different target triples: 
/Users/hayssm/.emscripten_cache/libcxx.bc' is 'le32-unknown-nacl' whereas 
'/tmp/tmpN8Nvxg/test_0.o' is 'x86_64-apple-macosx10.9.0'
WARNING: Linking two modules of different data layouts: 
'/Users/hayssm/.emscripten_cache/libcextra.bc' is 
'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32'
 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 
'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128'
WARNING: Linking two modules of different target triples: 
/Users/hayssm/.emscripten_cache/libcextra.bc' is 'le32-unknown-nacl' 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 'x86_64-apple-macosx10.9.0'
WARNING: Linking two modules of different data layouts: 
'/Users/hayssm/.emscripten_cache/libcxxabi.bc' is 
'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32'
 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 
'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128'
WARNING: Linking two modules of different target triples: 
/Users/hayssm/.emscripten_cache/libcxxabi.bc' is 'le32-unknown-nacl' 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 'x86_64-apple-macosx10.9.0'
WARNING: Linking two modules of different data layouts: 
'/Users/hayssm/.emscripten_cache/gl.bc' is 
'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32'
 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 
'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128'
WARNING: Linking two modules of different target triples: 
/Users/hayssm/.emscripten_cache/gl.bc' is 'le32-unknown-nacl' whereas 
'/tmp/tmpN8Nvxg/test_0.o' is 'x86_64-apple-macosx10.9.0'
WARNING: Linking two modules of different data layouts: 
'/Users/hayssm/.emscripten_cache/libc.bc' is 
'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32'
 
whereas '/tmp/tmpN8Nvxg/test_0.o' is 
'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128'
WARNING: Linking two modules of different target triples: 
/Users/hayssm/.emscripten_cache/libc.bc' is 'le32-unknown-nacl' whereas 
'/tmp/tmpN8Nvxg/test_0.o' is 'x86_64-apple-macosx10.9.0'
DEBUG    root: emcc step "link" took 0.30 seconds
DEBUG    root: saving intermediate processing steps to /tmp/emscripten_temp
DEBUG    root: emcc: LLVM opts: -internalize 
-internalize-public-api-list=main,malloc,free -globaldce -S
DEBUG    root: emcc step "post-link" took 0.20 seconds
DEBUG    root: LLVM => JS
DEBUG    root: emscript: ll=>js
DEBUG    root:   emscript: scan took 0.00878810882568 seconds
DEBUG    root:   emscript: split took 0.0128350257874 seconds
warning: using an unexpected LLVM triple: x86_64-apple-macosx10.9.0, !== 
,le32-unknown-nacl (are you using emcc for everything and not clang?)
warning: unresolved symbol: _ZN2cv6imreadERKNS_6StringEi
warning: unresolved symbol: 
_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc
warning: unresolved symbol: _ZN2cv8fastFreeEPv
warning: unresolved symbol: _ZN2cv3Mat10deallocateEv
warning: unresolved symbol: _ZN2cv6String10deallocateEv
warning: unresolved symbol: _ZN2cv6String8allocateEm
DEBUG    root:   emscript: phase 1 took 0.390188932419 seconds
DEBUG    root:   emscript: phase 2 working on 4 chunks using 8 cores 
(intended chunk size: 1.00 MB, meta: 0.00 MB, forwarded: 0.22 MB, total: 
3.66 MB)
warning: Casting a function pointer type to a potentially incompatible one 
(use -s VERBOSE=1 to see more)
warning: See 
https://github.com/kripken/emscripten/wiki/CodeGuidelinesAndLimitations#function-pointer-issues
 
for more information on dangerous function pointer casts
warning: Casting a function pointer type to a potentially incompatible one 
(use -s VERBOSE=1 to see more)
warning: See 
https://github.com/kripken/emscripten/wiki/CodeGuidelinesAndLimitations#function-pointer-issues
 
for more information on dangerous function pointer casts
DEBUG    root: .
DEBUG    root: .
DEBUG    root: .
DEBUG    root: .
DEBUG    root:   emscript: phase 2 took 1.4245300293 seconds
DEBUG    root:   emscript: phase 2b took 0.00212502479553 seconds
DEBUG    root:   emscript: phase 2c took 0.0311720371246 seconds
DEBUG    root:   emscript: phase 3 took 0.234448194504 seconds
DEBUG    root: emcc step "emscript (llvm=>js)" took 2.26 seconds
DEBUG    root: emcc step "source transforms" took 0.00 seconds
DEBUG    root: emcc step "js opts" took 0.00 seconds
DEBUG    root: generating HTML
DEBUG    root: emcc step "final emitting" took 0.08 seconds

DEBUG    root: total time: 2.88 seconds


*2) Observation*

1) It looks like the issue is that the lib was compiled with 
emscripten-fastcomp's clang++ and the source was converted to bitcode using 
the system clang++.  If this is correct then the issue is #1 from my 
original post.  Using emscripten-fastcomp's clang++ to convert the code to 
byte code is unable to find <stdlib.h>

-- 
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