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
{{ message }}
Repository navigation
getpeername/getnameinfo not detected by configure test #9154
While compiling Python's _socket module, I noticed that getpeername and getnameinfo were mistakenly detected as not present.
Something appears to confuse emscripten in the configuration test, as it returns a link error with htons:
$ emcc -o conftest conftest.c -ldl
warning: unexpected number of arguments 0 in call to 'getpeername', should be 3
error: undefined symbol: htons
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
Error: Aborting compilation due to previous errors
(using -s ERROR_ON_UNDEFINED_SYMBOLS=0 as suggested would defeat the point of the config test :))
The behavior is triggered by using conftest.c as a file name.
It happens even without all the autoconf boilerplate.
I see the same behavior regardless of the filename, though, it doesn't seem specific to conftest.c. Maybe I'm missing something? Does the PR work for you?
Since Emscripten has working test cases against getpeername/getnameinfo I thought this was specific to conftest.c. But admittedly this failed too :)
$ emcc -o conftest-getnameinfo.js conftest-getnameinfo.c -ldl; echo $?
warning: unexpected number of arguments 0 in call to 'getnameinfo', should be 1
error: undefined symbol: htons
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
Error: Aborting compilation due to previous errors
The PR appears to work (correct results from Python ./configure) however there's still an error at runtime:
$ emcc -o conftest-getnameinfo.js conftest-getnameinfo.c -ldl
warning: unexpected number of arguments 0 in call to 'getnameinfo', should be 1
$ node conftest-getnameinfo.js
exception thrown: ReferenceError: _ntohs is not defined,ReferenceError: _ntohs is not defined
Activity
kripken commentedon Aug 5, 2019
Thanks @Beuc! Fix in #9158
I see the same behavior regardless of the filename, though, it doesn't seem specific to
conftest.c. Maybe I'm missing something? Does the PR work for you?Beuc commentedon Aug 5, 2019
Here's what I had with emsdk latest:
Since Emscripten has working test cases against getpeername/getnameinfo I thought this was specific to
conftest.c. But admittedly this failed too :)The PR appears to work (correct results from Python ./configure) however there's still an error at runtime:
kripken commentedon Aug 6, 2019
Thanks, yeah, some more deps were needed, I added those now.
In general the sockets code is not well tested - just not many people use it, and our test suite is very minimal there.
Beuc commentedon Aug 6, 2019
Looks like it works, thanks!
Add missing reverse deps for some sockets code (#9158)
Add missing reverse deps for some sockets code (emscripten-core#9158)