Closed ivan closed 8 years ago
Possibly caused by a linker failure; I'll go investigate:
configure:9842: checking size of long
configure:9847: /home/build-otp/emsdk_portable/emscripten/incoming/emcc -o conftest -I/home/build-otp/otp/erts/x86_64-unknown-linux-gnu -D_GNU_SOURCE -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTI
ONS -D_GNU_SOURCE conftest.c -lutil -linet -lm -lpthread -lrt >&5
/usr/bin/ld: cannot find -linet
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
configure:9847: $? = 1
configure: program exited with status 1
configure: failed program was:
[...]
configure:9861: result: 0
I made erts/configure
pass these checks by deleting two instances of -linet
.
In any case, this seems like a really odd failure mode. I think the configure script might be running the binary for the previous test, even when linking fails for the binary for the current test. It should error out earlier. But I'm not sure if emscripten has anything to do with it.
In general configure
scripts need to be developed to be aware that they are cross-compiling with Emscripten. Very often this kind of work is in the emulation land, we have a collection of hacks with emconfigure
to try to make it mimic a native linux-like environment, but that is always not enough. If the project has a CMake build script, that might work better, since CMake has a strong concept of cross-compilation that Emscripten supports (there's a cross-compiler tool definition system for CMake).
To fake some configure scripts to succeed, we can run configure scripts against native gcc/ld, and use the results of that to feed to emcc. There was an env. var to control when that machinery is active, but don't remember what it was off the top of my head. Try checking the emconfigure
file it that might have more info.
Thanks! I think you're referring to EMCONFIGURE_JS
? In this case, setting to to 2
(always use) results in... blank output for the sizes of all the types.
Anyway, I ended up removing all the instances of AC_CHECK_SIZEOF
and replacing them with a block of
ac_cv_sizeof_char=1
ac_cv_sizeof_double=8
ac_cv_sizeof_float=4
ac_cv_sizeof_int=4
ac_cv_sizeof_long=4
ac_cv_sizeof_long_double=12
ac_cv_sizeof_long_long=8
ac_cv_sizeof_short=2
ac_cv_sizeof_signed_char=1
ac_cv_sizeof_unsigned_int=4
ac_cv_sizeof_unsigned_long=4
ac_cv_sizeof_unsigned_long_long=8
ac_cv_sizeof_unsigned_short=2
ac_cv_sizeof_unsigned_short=2
ac_cv_sizeof_void_p=4
ac_cv_sizeof_off_t=4
and now I'm dealing with much more interesting compilation failures.
Or perhaps CONFIGURE_CC?
When running under emconfigure, configuring otp fails with:
The checks in the top-level
configure
script work and output:while the errors come from
erts/configure
script thatconfigure
calls. I've tried runningerts/configure
by itself withemconfigure
as well, but I see the same configure errors.Repro steps are:
This might be the same issue as #264, but I haven't found a workaround. I see the same results when running emconfigure with
EMCONFIGURE_JS=1
, and there is no-O20
(or similar) in the configure scripts.I also see the same with emscripten sdk-master-64bit and with the
maint
branch of otp.Any suggestions would be appreciated, because I don't know my way around autoconf and configure.