MinGW64 build issue

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

MinGW64 build issue

Post by rickyboy »

Lutz,

The MinGW (32-bit) compile of newLISP is clean as a whistle.

Code: Select all

~/builds-mingw/newlisp-10.4.5 $ make
make
./configure

removing old objects and setting correct permissions ...
discovering platform and default memory model ...

detected memory model ILP32
detected Operating System WIN_32
creating makefile_build ...

to make for ILP32 on WIN_32 type:
    make
to make for any other system do:
    make -f makefile_xxx
where makefile_xxx is one of the preconfigured makefiles

make -f makefile_build
make[1]: Entering directory `/c/Users/rick.hanson/builds-mingw/newlisp-10.4.5'
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI newlisp.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-symbol.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-math.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-list.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-liststr.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-string.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-filesys.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-sock.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-import.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-xml.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-web.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-matrix.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI nl-debug.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI pcre.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI win32-util.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 -DFFI win32-path.c
/MinGW/bin/gcc  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o win32-util.o win32-path.o -lws2_32 -lffi -o newlisp.exe
/MinGW/bin/strip newlisp.exe
make[1]: Leaving directory `/c/Users/rick.hanson/builds-mingw/newlisp-10.4.5'
~/builds-mingw/newlisp-10.4.5 $
But when I use any of the MinGW 64-bit toolchains, the compiler complains about initializers not being constant in nl-import. (The other *.c files compile just fine, albeit with more warnings.)

BTW, /MinGW now points to a 64-bit MinGW toolchain, and I added some -Wno-* flags to suppress some warning noise.

Code: Select all

~/builds-mingw64/newlisp-10.4.5 $ ./configure
./configure

removing old objects and setting correct permissions ...
discovering platform and default memory model ...

detected memory model LLP64
detected Operating System WIN_32
creating makefile_build ...

to make for LLP64 on WIN_32 type:
    make
to make for any other system do:
    make -f makefile_xxx
where makefile_xxx is one of the preconfigured makefiles

~/builds-mingw64/newlisp-10.4.5 $ make -f makefile_build
make -f makefile_build
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 newlisp.c
newlisp.c:158:1: warning: overflow in implicit constant conversion [-Woverflow]
newlisp.c: In function 'getInteger':
newlisp.c:3683:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
newlisp.c:3684:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
newlisp.c: In function 'getInteger64':
newlisp.c:3736:5: warning: overflow in implicit constant conversion [-Woverflow]
newlisp.c:3737:5: warning: overflow in implicit constant conversion [-Woverflow]
newlisp.c: In function 'getIntegerExt':
newlisp.c:3784:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
newlisp.c:3785:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-symbol.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-math.c
nl-math.c:64:5: warning: '_matherr' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-list.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-liststr.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-string.c
nl-string.c: In function 'p_symbol':
nl-string.c:1196:8: warning: unused variable 'fmt' [-Wunused-variable]
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-filesys.c
nl-filesys.c: In function 'p_makeDir':
nl-filesys.c:813:1: warning: implicit declaration of function '_mkdir' [-Wimplicit-function-declaration]
nl-filesys.c: In function 'p_removeDir':
nl-filesys.c:825:1: warning: implicit declaration of function '_rmdir' [-Wimplicit-function-declaration]
nl-filesys.c: In function 'getUUID':
nl-filesys.c:3049:5: warning: right shift count >= width of type [enabled by default]
nl-filesys.c:3050:5: warning: right shift count >= width of type [enabled by default]
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-sock.c
/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 -c -O1 -g -DWIN_32 -DNEWLISP64 nl-import.c
nl-import.c:451:5: error: initializer element is not constant
nl-import.c:451:5: error: (near initialization for 'callback[0].func')
nl-import.c:452:5: error: initializer element is not constant
nl-import.c:452:5: error: (near initialization for 'callback[1].func')
nl-import.c:453:5: error: initializer element is not constant
nl-import.c:453:5: error: (near initialization for 'callback[2].func')
nl-import.c:454:5: error: initializer element is not constant
nl-import.c:454:5: error: (near initialization for 'callback[3].func')
nl-import.c:455:5: error: initializer element is not constant
nl-import.c:455:5: error: (near initialization for 'callback[4].func')
nl-import.c:456:5: error: initializer element is not constant
nl-import.c:456:5: error: (near initialization for 'callback[5].func')
nl-import.c:457:5: error: initializer element is not constant
nl-import.c:457:5: error: (near initialization for 'callback[6].func')
nl-import.c:458:5: error: initializer element is not constant
nl-import.c:458:5: error: (near initialization for 'callback[7].func')
nl-import.c:459:5: error: initializer element is not constant
nl-import.c:459:5: error: (near initialization for 'callback[8].func')
nl-import.c:460:5: error: initializer element is not constant
nl-import.c:460:5: error: (near initialization for 'callback[9].func')
nl-import.c:461:5: error: initializer element is not constant
nl-import.c:461:5: error: (near initialization for 'callback[10].func')
nl-import.c:462:5: error: initializer element is not constant
nl-import.c:462:5: error: (near initialization for 'callback[11].func')
nl-import.c:463:5: error: initializer element is not constant
nl-import.c:463:5: error: (near initialization for 'callback[12].func')
nl-import.c:464:5: error: initializer element is not constant
nl-import.c:464:5: error: (near initialization for 'callback[13].func')
nl-import.c:465:5: error: initializer element is not constant
nl-import.c:465:5: error: (near initialization for 'callback[14].func')
nl-import.c:466:5: error: initializer element is not constant
nl-import.c:466:5: error: (near initialization for 'callback[15].func')
make: *** [nl-import.o] Error 1
~/builds-mingw64/newlisp-10.4.5 $
Curious as to why the 32-bit gcc did not complain about this too. Some dudes on SOF claim that the C standard says that you can't do this. (Even though, I think it's cool that you can.) BTW, 64-bit gcc on Linux has no problem with this. So, I wonder if there is a GNU extension that enables the 32-bit MinGW to accept this, but which is turned off by default in the 64-bit MinGW toolchain.

Have you tried using the 64-bit target compilers of MinGW to compile newLISP before? Curious.

Thanks for any feedback.
(λx. x x) (λx. x x)

Locked