Hi,

On Sat, Feb 11, 2023 at 01:44:04PM -0500, Selva Nair wrote:
> On Sat, Feb 11, 2023 at 1:32 PM Gert Doering <g...@greenie.muc.de> wrote:
> 
> > /bin/bash ../../../libtool  --tag=CC   --mode=link i686-w64-mingw32-gcc
> 
> This is a 32 bit build which I never tried. Maybe cmocka is not built for
> 32 bit?

Yes, that was spot-on.

Found time to debug this with Arne today, and all the "non-cmocka" stuff
was built with "configure --host=i686-w64-mingw32" while cmocka got
"-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc", so the resulting .a library
was full of 64 bit objects... which, of course, "file" doesn't tell on
the .a, but unpacking libcmocka.dll.a + libcrypto.dll.a and looking at 
some of the contained .o told me...

gert@ubuntu2204:/tmp$ file cmocka_dll_d000001.o libcrypto_3_dll_d000001.o
cmocka_dll_d000001.o:      Intel amd64 COFF object file, no line number info, 
not stripped, 5 sections, symbol offset=0x138, 8 symbols, 1st section name 
".text"
libcrypto_3_dll_d000001.o: Intel 80386 COFF object file, no line number info, 
not stripped, 5 sections, symbol offset=0x134, 9 symbols, 1st section name 
".text"


... so, changed the cmocka CMAKE invocation to 

    cmake -DCMAKE_SYSTEM_NAME=Windows \
            -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc \
            -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ \
...

rebuilt cmocka, and "make test" now does what we expect it to do - build
something

gert@ubuntu2204:~/mingw/openvpn.git$ ls -l ./tests/unit_tests/openvpn/.libs
total 6504
-rwxrwxr-x 1 gert gert 541621 Feb 14 10:11 argv_testdriver.exe
-rw-rw-r-- 1 gert gert   6229 Feb 14 10:11 argv_testdriver_ltshwrapper
-rwxrwxr-x 1 gert gert 816794 Feb 14 10:12 auth_token_testdriver.exe
-rw-rw-r-- 1 gert gert   6248 Feb 14 10:12 auth_token_testdriver_ltshwrapper
-rwxrwxr-x 1 gert gert 536193 Feb 14 10:11 buffer_testdriver.exe
...

and not fail :-)


So, I can confirm that the yesterday-merged patch will make "make check"
on a MinGW system do the right thing.  I didn't test 64 bit compiles, as
that wouldn't add insights on "it's make / configure specific" changes.

Thanks for your assistence and patience,

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to