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

Duplicate symbols when compiling for wasm with emscripten #13018

Closed
almahmoud opened this issue Feb 29, 2024 · 4 comments
Closed

Duplicate symbols when compiling for wasm with emscripten #13018

almahmoud opened this issue Feb 29, 2024 · 4 comments
Labels
build not-a-curl-bug This is not a bug in curl

Comments

@almahmoud
Copy link

I did this

Trying to compile curl from source for WASM via emscripten, with the final goal of compiling RCurl R package for WebR. This can be reproduced in the ghcr.io/r-wasm/webr:main container, which provides emscripten configured for wasm compilation. Concretely within the container (i.e. docker run --rm -it ghcr.io/r-wasm/webr:main bash)

cd /root
git clone https://github.com/curl/curl 
apt update
apt install -y vim autoconf automake libtool
cd /root/curl
autoreconf -i
mkdir -p /manual/curl
emconfigure ./configure --prefix=/manual/curl --without-ssl
emmake make V=1

The above creates the libcurl.so file, but errors out with a bunch of duplicate symbols

wasm-ld: error: duplicate symbol: curlx_ultous
>>> defined in ../lib/warnless.o
>>> defined in ../lib/.libs/libcurl.so

wasm-ld: error: duplicate symbol: curlx_strtoofft
>>> defined in ../lib/strtoofft.o
>>> defined in ../lib/.libs/libcurl.so

A gist with the full emmake V=1 log can be found in this gist

Fwiw, I do not have much experience with emscripten, or compilation in general, so I apologize in advance if I am doing something obviously wrong

I expected the following

Success

curl/libcurl version

master branch source, and 8.6.0

operating system

Linux aefe9808b6b4 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@dfandrich
Copy link
Contributor

dfandrich commented Feb 29, 2024 via email

@bagder
Copy link
Member

bagder commented Mar 3, 2024

This sounds like a not-curl problem. We don't provide those build scripts - the ones we do provide don't have this problem...

@bagder bagder added build not-a-curl-bug This is not a bug in curl labels Mar 3, 2024
@almahmoud
Copy link
Author

Thank you for the input, and sorry for the noise. I'll close it as I agree it's only tangentially related to the repository, and I'll come back with a solution to the closed issue if I find one, in case it can help anyone else searching in the future.

@notsilverhoft
Copy link

Hey guys, lil late to the party, but credit to @dfandrich I was able to get it to work with
emconfigure ./configure --without-ssl --prefix=/workspaces/WasmFlash/curl/build --disable-shared --disable-symbol-hiding

I am aware that some of this makes no sense, as the file paths are my own, and the whole SSL thing, but the --disable-shared and --disable-symbol-hiding flags worked when combined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build not-a-curl-bug This is not a bug in curl
Development

No branches or pull requests

4 participants