Archive: makensis scons build failing on linux


makensis scons build failing on linux
Can someone please advise me how to get around the following build issue on linux:

nsis-2.19-src]$ scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no
scons: Reading SConscript files ...
Delete("nsis-28-Aug-2006.cvs")
Delete(".instdist")
Delete(".test")
Using GNU tools configuration
Checking for linker flag $MAP_FLAG... (cached) no
Checking for linker flag -s... (cached) no
Checking for linker flag $MAP_FLAG... (cached) no
Checking for linker flag -s... (cached) no
Checking for memcpy requirement... (cached) yes
Checking for memset requirement... (cached) yes
Checking for linker flag -pthread... (cached) no
Checking for __BIG_ENDIAN__... (cached) yes
Checking for main() in C library gdi32... (cached) no
Checking for main() in C library user32... (cached) no
Checking for main() in C library pthread... (cached) no
Checking for main() in C library stdc++... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library dl... (cached) no
Checking for main() in C library gdi32... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library user32... (cached) no
Checking for main() in C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/release/makensis/build.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/build.cpp
g++ -o build/release/makensis/lang.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/lang.cpp
g++ -o build/release/makensis/makenssi.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/makenssi.cpp
g++ -o build/release/makensis/script.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 Source/script.cpp
g++ -o build/release/makensis/makensis build/release/makensis/build.o build/release/makensis/clzma.o build/release/makensis/crc32.o build/release/makensis/DialogTemplate.o build/release/makensis/dirreader.o build/release/makensis/fileform.o build/release/makensis/growbuf.o build/release/makensis/lang.o build/release/makensis/lineparse.o build/release/makensis/makenssi.o build/release/makensis/mmap.o build/release/makensis/Plugins.o build/release/makensis/ResourceEditor.o build/release/makensis/ResourceVersionInfo.o build/release/makensis/script.o build/release/makensis/ShConstants.o build/release/makensis/strlist.o build/release/makensis/tokens.o build/release/makensis/util.o build/release/makensis/writer.o build/release/makensis/bzip2/blocksort.o build/release/makensis/bzip2/bzlib.o build/release/makensis/bzip2/compress.o build/release/makensis/bzip2/huffman.o build/release/makensis/7zip/7zGuids.o build/release/makensis/7zip/Common/CRC.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o build/release/makensis/7zip/7zip/Common/OutBuffer.o build/release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o build/release/makensis/7zip/Common/Alloc.o build/release/makensis/zlib/deflate.o build/release/makensis/zlib/trees.o
build/release/makensis/clzma.o(.text+0x67d): In function `CLZMA::End()':
: undefined reference to `pthread_detach'
build/release/makensis/clzma.o(.text+0x6b8): In function `CLZMA::End()':
: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
scons: *** [build/release/makensis/makensis] Error 1
scons: building terminated because of errors.


The tests are cached, so I'll take a wild guess and say you've moved the entire directory from another machine which has pthreads in glibc to a machine that has a separate pthread library. Try building from a clean source tree.


I'm guessing (not knowing much about scons) that the reason they are cached is because I reran the scons build script. But I got the same result when I built initially after downloading the sources. BTW, if I add "-pthread" to the linker line makensis is linked successfully. What does that say about what scons is (or is not) doing with regards to setting pthread linking correctly?

Thanks
Carlos


It means the -pthread test failed incorrectly. Could you attach the config.log file generated for a clean build?


Attached is the confg.log file that was generated when I reran the scons build. If this is not what you wanted please send me the exact build line you want me to run to generate the config.log you need.

Note: to make it work I copied/pasted the g++ as follows:

[nsis-2.19-src] $>g++ -pthread -o build/release/makensis/makensis build/release/makensis/build.o build/release/makensis/clzma.o build/release/makensis/crc32.o build/release/makensis/DialogTemplate.o build/release/makensis/dirreader.o build/release/makensis/fileform.o build/release/makensis/growbuf.o build/release/makensis/lang.o build/release/makensis/lineparse.o build/release/makensis/makenssi.o build/release/makensis/mmap.o build/release/makensis/Plugins.o build/release/makensis/ResourceEditor.o build/release/makensis/ResourceVersionInfo.o build/release/makensis/script.o build/release/makensis/ShConstants.o build/release/makensis/strlist.o build/release/makensis/tokens.o build/release/makensis/util.o build/release/makensis/writer.o build/release/makensis/bzip2/blocksort.o build/release/makensis/bzip2/bzlib.o build/release/makensis/bzip2/compress.o build/release/makensis/bzip2/huffman.o build/release/makensis/7zip/7zGuids.o build/release/makensis/7zip/Common/CRC.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o build/release/makensis/7zip/7zip/Common/OutBuffer.o build/release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o build/release/makensis/7zip/Common/Alloc.o build/release/makensis/zlib/deflate.o build/release/makensis/zlib/trees.o


That's the file and the command line doesn't matter in this case, but I need it after a clean build. SCons must run only once after the source tree is completely cleaned so config.log won't be overwritten. In the log you've attached, it doesn't show the results of the real configuration test because it's cached.


Can you please tell me which command I should run to generate the config.log file you need? I've ran "scons --clean" but it still shows cached. Which configuration should I delete that keeps this cache information?

Thanks
Carlos


scons doesn't have a clean command for that, you need to clean it yourself. The easiest method is simply to delete the folder and extract the files again.


Hmm, it built OK this time. So if I'm to guess at what happened, originally when I first built the thing I didn't use any arguments in the scons command line. I then read that I should only build makensis (not the plugins) and I then used the arguments per the doc. Perhaps the first attempt cached some invalid options.

Thanks
Carlos


Originally posted by kichik It means the -pthread test failed incorrectly. (...)
Hi there! I have a very similar problem trying to build nsis 2.21 on Solaris.
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no

ends up somewhere with:I modified SConstruct as follows:
#defenv = Environment()
defenv = Environment(CXX = 'g++')
defenv.Replace(CXXVERSION = '3.3.2')

One more error is:
And in the conf.log it reads: Do you have any idea what's wrong here?

TIA,
MOENK

One more thing:
Do I definately need a XCompiler?
I cannot imagine, that putting "my" new makensis into a precompiled zip for win32 will work on SAPRC? At the moment, when running ./makensis nothing happens at all :rolleyes:
Sorry, but the documentation is not very detailled for building on POSIX ...

Again, Thanks,
MOENK

PS: I got rid of the "-pthread" - message after changing conf/gnu

#conf.CheckLinkFlag('-pthread')

Is that ok ?

In your case, the -pthread actually succeeded on accident. But that's OK as it's ignored by gcc if it's not supported.

The config.log part you took and the output piece do not match. You've pasted the output of the -s test and the log for the -pthread test.

As the documentation says, you don't need a cross-compiler. You can just drop makensis into the precompiled zip for win32. The fact that ./makensis fails is probably because of unaligned memory access because you're trying to run on SPARC. If the wrong files are present, it'll tell you, so that's not the problem.