Failed to pass test "convert" on cross-compiled and shared libraries

_ goxjanskloon goxjanskloon at outlook.com
Wed Jan 15 16:41:23 CET 2025


Basic information:

  *
GMPGMP version: 6.3.0
  *
configure options: --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 --prefix=/home/gxj/bin --enable-shared --disable-static
  *
configure output:  See attachment configure.output
  *
Compilers: See attachments *gcc.version
  *
Output from uname -a: Linux DESKTOP-####### 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  *
Output from config.guess: zen2-pc-linux-gnu
  *
Output from configfsf.guess: x86_64-pc-linux-gnu
  *
config.log: See attachment config.log

Bug Detail:
I cross-compiled GMP on Ubuntu WSL2 (from Windows 10), targeting Windows. I have package mingw-w64 installed from apt, to get a MinGW-w64 toolchain. I configured and built GMP successfully, without any errors but a warning during configuring:
      configure: WARNING: cannot check for properly working vsnprintf when cross compiling, will assume it's ok.
 After looking up this warning, I thought it couldn't be an error, and ignored it, then ran make install.
The output from installing reminded me to test, so I ran make check -j12(for output and log, see attachment tests-mpz-test-suite.log). I saw plenty warnings and errors from libtool (see attachment). I couldn't get anything helpful about it on the Internet.  All tests passed, except convert. Sorry for my laziness, I couldn't understand the source code of this test. Only I know is that this test stopped exceptionally with exiting code 127. As far as I know, 127 means a command can't be found. But I couldn't see any system calls in convert.c. Recalling the warning I got during configuring, I guess it is related to function vsnprintf . (I saw a character serial in the source code, according to it and the name "convert", I guess it is about strings. But this is a multiprecision project! My idea may be foolish...)

I tried to debug it. I cleaned my building directory and reconfigured by:
      CFLAGS='-O0 -g -DDEBUG' CC_FOR_BUILD=gcc /path/to/configure --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 --prefix=/home/gxj/bin --enable-static --disable-shared --enable-alloca=debug --disable-assembly
Everything went well, and every test passed (There was't any error or warning that is significant, so I don't attach the outputs and logs from it). The error I got previously didn't appear this time. I thought it might be related to the type of libraries. Because in the first build, I built shared libraries, and in the debugging build, I built static libraries, in order to get debugging symbols for GDB.

I have experienced many problems about library types when I cross-compile from Linux to Windows. But this time I want to build an exactly as dynamic as possible toolchain, which includes GMP. So I need to know a workaround or a solution that isn't switching to static libraries.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attachments.7z
Type: application/octet-stream
Size: 6041 bytes
Desc: attachments.7z
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20250115/a91c939f/attachment.obj>


More information about the gmp-bugs mailing list