In my build box, in addition to the system tools, I have a separate folder (/opt/xbb/bin) with newer versions of some tools, including GCC 7.2.
The PATH is adjusted to include this folder, and starting GCC uses this new version of the compiler.
However, the configurator ignores the PATH, and always picks the system GCC, which is 4.4, as it can be seen.
Fortunately in this case the build passes with 4.4, but it would be better to use the new compiler.
PATH=/opt/xbb/bin:/opt/xbb-bootstrap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CFLAGS=-g -O2 -pipe -ffunction-sections -fdata-sections
CXXFLAGS=-g -O2 -pipe -ffunction-sections -fdata-sections
CPPFLAGS=-I/opt/xbb/include
LDFLAGS=-L/opt/xbb/lib64 -L/opt/xbb/lib -static-libstdc++ -Wl,--gc-sections -Wl,-rpath -Wl,"/opt/xbb/lib"
LD_LIBRARY_PATH=/opt/xbb/lib64:/opt/xbb/lib:/opt/xbb-bootstrap/lib64:/opt/xbb-bootstrap/lib:
PKG_CONFIG_PATH=/opt/xbb/lib64/pkgconfig:/opt/xbb/lib/pkgconfig:/usr/lib/pkgconfig
+ gcc --version
+ scons --version
gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SCons by Steven Knight et al.:
script: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668, 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
engine: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668, 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
engine path: ['/opt/xbb/lib/scons-3.0.1/SCons']
Copyright (c) 2001 - 2017 The SCons Foundation
+ scons --help-options
...
+ scons XGCC_W32_PREFIX=x86_64-w64-mingw32- VERSION=3.02.1 PREFIX=/opt/xbb PREFIX_CONF=/opt/xbb/etc 'SKIPUTILS=NSIS Menu' STRIP_CP=false ZLIB_W32=/opt/xbb/x86_64-w64-mingw32 install
scons: Reading SConscript files ...
Mkdir("build/urelease/config")
Delete("nsis-3.02.1")
Delete(".instdist")
Delete(".test")
Using GNU tools configuration
Checking for linker flag $MAP_FLAG... yes
Checking for linker flag $MAP_FLAG... yes
Checking for memcpy requirement... no
Checking for memset requirement... no
Checking for linker flag -pthread... yes
Checking for __BIG_ENDIAN__... no
x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Checking for C library gdi32... no
Checking for C library user32... no
Checking for C library pthread... yes
Checking for C library iconv... no
Checking for C library shlwapi... no
Checking for C library z... yes
scons: warning: Ignoring missing SConscript 'build/urelease/System/x86-ansi/SConscript'
File "/tmp/xbb/xbb-build/nsis-3.02.1-src/SConstruct", line 717, in <module>
scons: warning: Ignoring missing SConscript 'build/urelease/System/x86-unicode/SConscript'
File "/tmp/xbb/xbb-build/nsis-3.02.1-src/SConstruct", line 717, in <module>
Checking for C library iconv... no
Checking for C library z... yes
Checking for C library zdll... no
Checking for C library z... yes
Checking for C library dl... yes
Checking for C library gdi32... no
Checking for C library iconv... no
Checking for C library pthread... yes
Checking for C library user32... no
Checking for C library z... yes
Checking for C++ library cppunit... no
scons: done reading SConscript files.
scons: Building targets ...
Install file: "COPYING" as "/opt/xbb/share/doc/nsis/COPYING"
Install file: "nsisconf.nsh" as "/opt/xbb/etc/nsisconf.nsh"
x86_64-w64-mingw32-gcc -o build/urelease/stub_bzip2-x86-unicode/bgbg.o -c -Os -Wall -xc -fno-strict-aliasing -DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config Source/exehead/bgbg.c
x86_64-w64-mingw32-gcc -o build/urelease/stub_bzip2-x86-unicode/components.o -c -Os -Wall -xc -fno-strict-aliasing -DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config Source/exehead/components.c
x86_64-w64-mingw32-gcc -o build/urelease/stub_bzip2-x86-unicode/exec.o -c -Os -Wall -xc -fno-strict-aliasing -DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config Source/exehead/exec.c
x86_64-w64-mingw32-gcc -o build/urelease/stub_bzip2-x86-unicode/fileform.o -c -Os -Wall -xc -fno-strict-aliasing -DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config Source/exehead/fileform.c
x86_64-w64-mingw32-gcc -o build/urelease/stub_bzip2-x86-unicode/Main.o -c -Os -Wall -xc -fno-strict-aliasing -DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE -DEXEHEAD -DWIN32_LEAN_AND_MEAN -D_WIN32_IE=0x0500 -DNSIS_COMPRESS_USE_BZIP2 -Ibuild/urelease/config Source/exehead/Main.c
See the command lines for the stubs?
x86_64-w64-mingw32-gcc -o build/urelease/stub_bzip2-x86-unicode/Main.o -c -Os ...
You're using a 64bit compiler to compile 32bit stubs.
This line is also wrong:
ZLIB_W32=/opt/xbb/x86_64-w64-mingw32
It should point to a windows specific zlib library. The easy way to fix that is to add zip2exe to the SKIPUTILS variable on the command line: SKIPUTILS='NSIS Menu','zip2exe' (don't use wrapping quotes).
yes, you are probably right, but the reported problem is different.
do you see the following:
this was an explicit command I added to the script before starting scons.
later on, in exactly the same environment, the configurator displays:
I have no idea how this happens, but if the configurator ignores the PATH and searches only the system folders, it cannot work properly in my environment, since the system folders are from a very old CentOS 6, and all the new tools are in
/opt/xbb/bin:/opt/xbb-bootstrap/bin.I think that is just how SCons works. We have a SCons parameter called PATH you can try. There are also overrides for TOOLSET, CC and CXX. Run SCons -H to see these options.
are you sure
-His the magic option to see the parameters?Sorry, must be -h then, I always mix them up.
in my setup,
scons -hshows the same asscons -H:-h works for me but my SCons is old. You can see our options in the root SConstruct file. Those option descriptions are passed to the SCons Help() function but perhaps the way you activate Help has changed.
These are NSIS specific options, but you're not running
scons -horscons -Hin the NSIS source code folder. Other projects may add their own options, so it won't work otherwise. You will only see our specific options when you run those commands in the NSIS source code folder.I'm using the latest scons.
The options start from about line 153 in Sconstruct, just as reference.