emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.62k stars 3.28k forks source link

error: Linking globals named 'sincosf': symbol multiply defined! #5977

Closed lilmayofuksu closed 4 years ago

lilmayofuksu commented 6 years ago

Hi, I am trying to compile cl_dll from "https://github.com/FWGS/cs16-client/tree/v1.32" But I am getting error while compiling .bc to .js Here's the error with debug enabled:

root@lul:~/cs16-client-1.32/cl_dll# EMCC_DEBUG=1 emcc libclient.bc -o hey.html

DEBUG:root:PYTHON not defined in /root/.emscripten, using "/usr/bin/python"
DEBUG:root:JAVA not defined in /root/.emscripten, using "java"
DEBUG:root:Cache: PID 31817 acquiring multiprocess file lock to Emscripten cache at /root/.emscripten_cache
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 31817 released multiprocess file lock to Emscripten cache at /root/.emscripten_cache
DEBUG:root:check tells us to use asm.js backend
WARNING:root:invocation: /root/emscripten/emsdk-portable/emscripten/1.37.26/emcc libclient.bc -o hey.html  (in /root/cs16-client-1.32/cl_dll)
DEBUG:root:Checking JS engine ['/root/emscripten/emsdk-portable/node/4.1.1_64bit/bin/node']
INFO:root:(Emscripten: Running sanity checks)
WARNING:root:java does not seem to exist, required for closure compiler, which is optional (define JAVA in /root/.emscripten if you want it)
WARNING:root:closure compiler will not be available
DEBUG:root:compiling to bitcode
DEBUG:root:emcc step "parse arguments and setup" took 0.23 seconds
DEBUG:root:using bitcode file: libclient.bc
DEBUG:root:emcc step "bitcodeize inputs" took 0.00 seconds
DEBUG:root:emcc step "process inputs" took 0.00 seconds
DEBUG:root:will generate JavaScript
DEBUG:root:including libcxx.a
DEBUG:root:Cache: PID 31817 acquiring multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 31817 released multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:including libcxxabi.bc
DEBUG:root:Cache: PID 31817 acquiring multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 31817 released multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:including dlmalloc.bc
DEBUG:root:Cache: PID 31817 acquiring multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 31817 released multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:including libc.bc
DEBUG:root:Cache: PID 31817 acquiring multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 31817 released multiprocess file lock to Emscripten cache at /root/.emscripten_cache/asmjs
DEBUG:root:emcc step "calculate system libraries" took 0.05 seconds
DEBUG:root:linking: ['libclient.bc', '/root/.emscripten_cache/asmjs/dlmalloc.bc', '/root/.emscripten_cache/asmjs/libc.bc', '/root/.emscripten_cache/asmjs/libcxx.a', '/root/.emscripten_cache/asmjs/libcxxabi.bc']
DEBUG:root:adding object /root/cs16-client-1.32/cl_dll/libclient.bc to link
DEBUG:root:adding object /root/.emscripten_cache/asmjs/dlmalloc.bc to link
DEBUG:root:adding object /root/.emscripten_cache/asmjs/libc.bc to link
DEBUG:root:considering archive /root/.emscripten_cache/asmjs/libcxx.a
DEBUG:root:adding object /tmp/emscripten_temp_WxWL2D_archive_contents/hash_89a591b0.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_WxWL2D_archive_contents/new_add28db6.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_WxWL2D_archive_contents/stdexcept_5c983eab.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_WxWL2D_archive_contents/string_00cc9aa0.cpp.o to link
DEBUG:root:done running loop of archive /root/.emscripten_cache/asmjs/libcxx.a
DEBUG:root:adding object /root/.emscripten_cache/asmjs/libcxxabi.bc to link
DEBUG:root:emcc step "link" took 0.30 seconds
DEBUG:root:saving intermediate processing steps to /tmp/emscripten_temp
DEBUG:root:(not saving intermediate /tmp/emscripten_temp/emcc-0-basebc.bc because deferring linking)
DEBUG:root:emcc: LLVM opts: -strip-debug -disable-debug-info-type-map -internalize -internalize-public-api-list=main,malloc,free,__errno_location,fflush,__cxa_can_catch,__cxa_is_pointer_type,malloc -globaldce -disable-loop-vec           torization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false -vectorize-slp-aggressive=false  [num inputs: 8]

*error: Linking globals named 'sincosf': symbol multiply defined!*
Traceback (most recent call last):
  File "/root/emscripten/emsdk-portable/emscripten/1.37.26/emcc", line 13, in <module>
    emcc.run()
  File "/root/emscripten/emsdk-portable/emscripten/1.37.26/emcc.py", line 1546, in run
    final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL)
  File "/root/emscripten/emsdk-portable/emscripten/1.37.26/tools/shared.py", line 1953, in llvm_opt
    proc = run_process([LLVM_OPT] + inputs + opts + ['-o', target], stdout=PIPE)
  File "/root/emscripten/emsdk-portable/emscripten/1.37.26/tools/shared.py", line 223, in run_process
    return run_base(cmd, universal_newlines=universal_newlines, check=check, *args, **kw)
  File "/root/emscripten/emsdk-portable/emscripten/1.37.26/tools/shared.py", line 219, in run_base
    result.check_returncode()
  File "/root/emscripten/emsdk-portable/emscripten/1.37.26/tools/shared.py", line 206, in check_returncode
    raise Py2CalledProcessError(returncode=self.returncode, cmd=self.args, output=self.stdout, stderr=self.stderr)
tools.shared.Py2CalledProcessError: Command '['/root/emscripten/emsdk-portable/clang/e1.37.26_64bit/opt', '/root/cs16-client-1.32/cl_dll/libclient.bc', '/root/.emscripten_cache/asmjs/dlmalloc.bc', '/root/.emscripten_cache/asmj           s/libc.bc', '/tmp/emscripten_temp_WxWL2D_archive_contents/hash_89a591b0.cpp.o', '/tmp/emscripten_temp_WxWL2D_archive_contents/new_add28db6.cpp.o', '/tmp/emscripten_temp_WxWL2D_archive_contents/stdexcept_5c983eab.cpp.o', '/tmp/           emscripten_temp_WxWL2D_archive_contents/string_00cc9aa0.cpp.o', '/root/.emscripten_cache/asmjs/libcxxabi.bc', '-strip-debug', '-disable-debug-info-type-map', '-internalize', u'-internalize-public-api-list=main,malloc,free,__er           rno_location,fflush,__cxa_can_catch,__cxa_is_pointer_type,malloc', '-globaldce', '-disable-loop-vectorization', '-disable-slp-vectorization', '-vectorize-loops=false', '-vectorize-slp=false', '-vectorize-slp-aggressive=false',            '-o', '/tmp/tmpW23L03/hey.bc']' returned non-zero exit status 1
root@lul:~/cs16-client-1.32/cl_dll#
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.