Hi All,
My project built fine some time back with fastcomp and now I wanted to catch up with upstream. Unfortunately, the command I used to build the stuff results in duplicate symbol errors as if I wanted to build a shared library. However, all the dependent libs are compiled to .a archives. Here's the command (tried to copy relevant parts from the makefile):
CXXFLAGS=-std=c++11 -fPIC -pedantic -Wall
em++ ${CXXFLAGS} $$includedirs -s EXPORTED_FUNCTIONS=$$exportedfunction $$srcfilepath $$projectdir/logger.cpp $$projectdir/sqlite_db.cpp $$projectdir/lexer.cpp $$projectdir/sp.cpp $$projectdir/tokenpaths.cpp $$projectdir/query_result.cpp $$projectdir/morphan_result.cpp $$projectdir/morphan.cpp $$projectdir/transgraph.cpp $$jslibdir -lsqlite3 -lfoma -lz -lreadline -o $$absbuilddir/hi_js/embedded/hi.js --embed-file $$jsdb --embed-file $$jsfst;
See the result (only the errors it ends up with) at the end. The interesting thing is that all errors seem to come from libfoma.a and the build stops with SHARED ERROR. Does anyone happen to have any hint how to make it build?
Thanks®ards,
r0ller
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(apply.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(int_stack.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(apply.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(int_stack.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(int_stack.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(topsort.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(int_stack.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(topsort.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(topsort.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(flags.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(topsort.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(flags.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(flags.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(determinize.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(flags.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(determinize.o)
wasm-ld: error: duplicate symbol: trans_array
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(determinize.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(minimize.o)
wasm-ld: error: duplicate symbol: trans_list
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(determinize.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(minimize.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(determinize.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(minimize.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(determinize.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(minimize.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(minimize.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(reverse.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(minimize.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(reverse.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(reverse.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(sigma.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(reverse.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(sigma.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(sigma.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(define.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(sigma.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(define.o)
wasm-ld: error: duplicate symbol: g_defines
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(define.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(io.o)
wasm-ld: error: duplicate symbol: g_defines_f
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(define.o)
>>> defined in /home/r0ller/hi/alice/hi_js/libfoma.a(io.o)
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
shared:ERROR: '/usr/pkg/bin/wasm-ld -o /tmp/emscripten_temp_d2_aum2l/hi.wasm --allow-undefined --lto-O0 /tmp/emscripten_temp_d2_aum2l/hi.y_0.o -L/home/r0ller/emsdk/upstream/emscripten/system/local/lib /tmp/emscripten_temp_d2_aum2l/logger_1.o -L/home/r0ller/emsdk/upstream/emscripten/system/lib /tmp/emscripten_temp_d2_aum2l/sqlite_db_2.o -L/home/r0ller/.emscripten_cache/wasm-obj /tmp/emscripten_temp_d2_aum2l/lexer_3.o /tmp/emscripten_temp_d2_aum2l/sp_4.o /tmp/emscripten_temp_d2_aum2l/tokenpaths_5.o /tmp/emscripten_temp_d2_aum2l/query_result_6.o /tmp/emscripten_temp_d2_aum2l/morphan_result_7.o /tmp/emscripten_temp_d2_aum2l/morphan_8.o /tmp/emscripten_temp_d2_aum2l/transgraph_9.o -L/home/r0ller/hi/alice/hi_js /home/r0ller/hi/alice/hi_js/libsqlite3.a /home/r0ller/hi/alice/hi_js/libfoma.a /home/r0ller/hi/alice/hi_js/libz.a /home/r0ller/hi/alice/hi_js/libreadline.a /home/r0ller/.emscripten_cache/wasm-obj/libc.a /home/r0ller/.emscripten_cache/wasm-obj/libcompiler_rt.a /home/r0ller/.emscripten_cache/wasm-obj/libc-wasm.a /home/r0ller/.emscripten_cache/wasm-obj/libc++-noexcept.a /home/r0ller/.emscripten_cache/wasm-obj/libc++abi-noexcept.a /home/r0ller/.emscripten_cache/wasm-obj/libdlmalloc.a /home/r0ller/.emscripten_cache/wasm-obj/libpthread_stub.a /home/r0ller/.emscripten_cache/wasm-obj/libc_rt_wasm.a /home/r0ller/.emscripten_cache/wasm-obj/libsockets.a --import-memory --import-table -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --strip-debug --export __wasm_call_ctors --export __data_end --export hi --export malloc --export free --export setThrew --export __errno_location --export fflush --export _ZSt18uncaught_exceptionv --export emscripten_builtin_free --export _get_environ --export emscripten_builtin_memalign --export memalign --export usleep --export _get_tzname --export _get_daylight --export _get_timezone --export realloc -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (1)
*** Error code 1
Stop.
make: stopped in /home/r0ller/hi/alice