Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GnuPG 1.4 failed to build: duplicate symbol from wasm-ld when using extern in .h files #22940

Open
Young-Lord opened this issue Nov 15, 2024 · 0 comments

Comments

@Young-Lord
Copy link

Young-Lord commented Nov 15, 2024

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.71 (4171ae200b77a6c266b0e1ebb507d61d1ade3501)
clang version 20.0.0git (https:/github.com/llvm/llvm-project d6344c1cd0d099f8d99ee320f33fc9254dbe8288)
Target: wasm32-unknown-emscripten
Thread model: posix

Failing command line in full:
Sorry for not able to give a minimal reproduction. I can only attach full output log here. I've found #22629 and other issues, but no solution worked for me.

wget https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-1.4.23.tar.bz2
tar xvf gnupg-1.4.23.tar.bz2
cd gnupg-1.4.23
emconfigure ./configure --disable-agent-support --disable-photo-viewers --disable-exec --disable-threads
emmake make V=1 LDFLAGS=-v

The error from console output is similar to this:

/home/yang/wasm/emsdk/upstream/emscripten/emcc  -g -O2 -Wall -Wno-pointer-sign   -o gpgsplit gpgsplit.o ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a   ../intl/libintl.a    ../zlib/libzlib.a
wasm-ld: error: duplicate symbol: iobuf_debug_mode
>>> defined in mpicalc.o
>>> defined in ../mpi/libmpi.a(mpi-add.o)

wasm-ld: error: duplicate symbol: memory_debug_mode
>>> defined in mpicalc.o
>>> defined in ../mpi/libmpi.a(mpi-add.o)

wasm-ld: error: duplicate symbol: memory_stat_debug_mode
>>> defined in mpicalc.o
>>> defined in ../mpi/libmpi.a(mpi-add.o)

wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
emcc: error: '/home/yang/wasm/emsdk/upstream/bin/wasm-ld -o mpicalc.wasm -L/home/yang/wasm/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten mpicalc.o ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a ../intl/libintl.a -lGL-getprocaddr -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpgfdpsqxhlibemscripten_js_symbols.so --export=_emscripten_stack_alloc --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export=emscripten_stack_get_current --export=_emscripten_stack_restore --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-table -z stack-size=65536 --no-growable-memory --initial-heap=16777216 --no-entry --table-base=1 --global-base=1024' failed (returned 1)

Here is full log: make.log

Full link command and output with -v appended:
make.2.log

P.S., GnuPG 2.x can build smoothly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant