You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
The logs show a link that's pulling in both libcurl.so and some of the object
files that are already contained in libcurl.so, like base64.o and nonblock.o. I
don't know why emscripten is doing that, but I suspect it's trying to outsmart
autoconf somehow. You could try adding --disable-shared or
--disable-symbol-hiding to see if changes its behaviour.
You might want to look at the WASIX build at https://curl.se/download.html as
they're compiling curl against wasm already.
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.
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.
I did this
Trying to compile
curl
from source for WASM viaemscripten
, with the final goal of compilingRCurl
R package forWebR
. This can be reproduced in theghcr.io/r-wasm/webr:main
container, which providesemscripten
configured for wasm compilation. Concretely within the container (i.e.docker run --rm -it ghcr.io/r-wasm/webr:main bash
)The above creates the
libcurl.so
file, but errors out with a bunch of duplicate symbolsA gist with the full
emmake V=1
log can be found in this gistFwiw, 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.0operating 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
The text was updated successfully, but these errors were encountered: