- NSIS Discussion
- Error Building NSIS on HP-UX
Archive: Error Building NSIS on HP-UX
tresemi
30th March 2007 18:41 UTC
Error Building NSIS on HP-UX
Hi,
I'm trying to build NSIS on HP-UX environment.
I have installed Python-2.5, scons-0.96.95 and trying to install nsis-2.24.
I tried to install using:
scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/tmp install-compiler
and that's the log:
root@itacare:/home/zembrzus/nsis/NSIS# scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/tmp>
scons: Reading SConscript files ...
Delete("nsis-30-Mar-2007.cvs")
Delete(".instdist")
Delete(".test")
Using GNU tools configuration
Checking for linker flag -m32... (cached) yes
Checking for compiler flag -m32... (cached) no
Checking for linker flag $MAP_FLAG... (cached) no
Checking for linker flag -s... (cached) yes
Checking for linker flag $MAP_FLAG... (cached) no
Checking for linker flag -s... (cached) yes
Checking for memcpy requirement... (cached) yes
Checking for memset requirement... (cached) yes
Checking for linker flag -pthread... (cached) yes
Checking for __BIG_ENDIAN__... (cached) no
Checking for C library gdi32... (cached) no
Checking for C library user32... (cached) no
Checking for C library pthread... (cached) yes
Checking for C library stdc++... (cached) yes
Checking for C library iconv... (cached) no
Checking for C library dl... (cached) yes
Checking for C library gdi32... (cached) no
Checking for C library iconv... (cached) no
Checking for C library pthread... (cached) yes
Checking for C library user32... (cached) no
Checking for C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/release/makensis/makensis -m32 -s -pthread 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/manifest.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/winchar.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/7zip/Common/OutBuffer.o build/release/makensis/7zip/7zip/Common/StreamUtils.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o build/release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o build/release/makensis/7zip/Common/Alloc.o build/release/makensis/7zip/Common/CRC.o build/release/makensis/zlib/deflate.o build/release/makensis/zlib/trees.o -Lbuild/release/makensis -LSource -lpthread -lstdc++
ld: Unsatisfied symbol "libiconv_open" in file build/release/makensis/util.o
ld: Unsatisfied symbol "libiconv_close" in file build/release/makensis/util.o
ld: Unsatisfied symbol "libiconv" in file build/release/makensis/util.o
3 errors.
collect2: ld returned 1 exit status
scons: *** [build/release/makensis/makensis] Error 1
scons: building terminated because of errors.
Any toughts ?
Thanks in advance!!
kichik
30th March 2007 18:58 UTC
Delete .sconsign.dblite and add LIBPATH=/usr/lib/where/ever/iconv/is/located to the build line.
kichik
31st March 2007 12:58 UTC
I forgot LIBPATH doesn't actually work. Wait for 2.25 which will be released today and use APPEND_LIBPATH instead.
tresemi
2nd April 2007 15:03 UTC
Ok. It have worked fine to me. Thanks.
Now I've nsis installed, but I'm getting this error trying to compile the example1.nsi.
What would be my fault?
Thanks.
root@itacare:/home/zembrzus/nsis-2.25# ./makensis Examples/example1.nsi
MakeNSIS v02-Apr-2007.cvs - Copyright 1995-2007 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.
Processing config:
Processing plugin dlls: "/home/zembrzus/nsis-2.25/Plugins/*.dll"
!define: "MUI_INSERT_NSISCONF"=""
Changing directory to: "/home/zembrzus/nsis-2.25/Examples"
Processing script file: "Examples/example1.nsi"
Name: "Example1"
OutFile: "example1.exe"
InstallDir: "$PROGRAMFILES\Example1"
Page: directory
Page: instfiles
Section: ""
SetOutPath: "$INSTDIR"
File: "example1.nsi" [compress] 378/794 bytes
SectionEnd
Processed 1 file, writing output:
Processing pages... Done!
Removing unused resources...
Error: Unsupported PE format
Error - aborting creation process
kichik
2nd April 2007 15:45 UTC
Sounds like every executable you extracted got corrupted somehow. Notice it doesn't find any plug-ins either. Try extracting the ZIP again and make sure the DLL files and the files in Stubs have have some normal data in them.
deckrider
16th April 2007 22:50 UTC
I'm also having the same problem:
$ uname -a
HP-UX omztdv1 B.11.23 U ia64 2505142627 unlimited-user license
Does anyone have any luck building AND using NSIS on this platform?
kichik
16th April 2007 23:14 UTC
Seems like big endian support was broken since 2.24. The PE magic wasn't converted to big endian prior to comparison. Use the attached patch to fix this.
(Or on cvs)
deckrider
17th April 2007 19:45 UTC
Still not working. Here is more info, including an attached script you can run to reproduce my results:
$ uname -a
HP-UX omztdv1 B.11.23 U ia64 2505142627 unlimited-user license
$ gcc --version
gcc (GCC) 4.1.2
Copyright (C) 2006 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 --version
SCons by Steven Knight et al.:
script: v0.96.96.D001, 2007/04/12 14:12:18, by knight on roxbury
engine: v0.96.96.D001, 2007/04/12 14:12:18, by knight on roxbury
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation
deckrider
17th April 2007 19:49 UTC
Here is also the result of running the earlier build script.
kichik
17th April 2007 20:05 UTC
That's due to memory alignment problems. There's an open bug report regarding this. For now, you can run makensis under WINE.
deckrider
17th April 2007 20:39 UTC
I'm dubious of wine working at all on hpux ia64, but I'll look into it: my initial attempt to compile on hpux ia64 failed quickly, and I'm not seeing pre-built binaries in my initial search.
deckrider
19th April 2007 17:23 UTC
Just thought I'd report back that I've given up on the possibility of makensis on HP-UX B.11.23 ia64. My skills are not good enough to patch either wine or nsis to make it work.
But just in case anyone out there can know a patch, I'll post the gdb backtrace here.
deckrider
20th April 2007 00:27 UTC
Hey, I got it working...after giving up and looking into some other issue, we stumbled across an HP compiler option "+u1" which allows for unaligned access. Anyone know if there is a corresponding gcc option for this?
So here is a crude script containing some patches--don't know if they are all really needed. I know a lot more about GNU autotools than 'scons'. It seems like it ought to be easier to pass compiler flags/options without patching files to do it, but maybe I'm just missing something.
Anyway, compiler options that only work with one compiler probably shouldn't be forced on other compilers (-Wall and -m32 come to mind).
Also the test for big endian appears to get it wrong for HPUX ia64, which is why I force the -D entry for it.
kichik
20th April 2007 10:03 UTC
GCC should support -mno-strict-align according to the following message:
http://gcc.gnu.org/ml/gcc/1999-10n/msg00317.html
kichik
20th April 2007 13:02 UTC
To add compiler flags or linker flags, you can pass APPEND_CCFLAGS or APPEND_LINKFLAGS in the scons build line.
-Wall and -m32 aren't forced on any compilers because the file that adds them (SCons/Config/gnu) is specific to gcc.
The test for big endian is pretty simple. If it failed, it's probably because the environment wasn't properly set when it was ran. To verify, delete .sconsign.dblite and .sconf_temp and run scons again. Then you can see exactly what happens in config.log.
deckrider
20th April 2007 14:17 UTC
We have 3 compilers on our system:
(1) hpux ansi c and c++:
/usr/bin/cc
/opt/aCC/bin/aCC
(2) gcc (I think it was version 3.4) packaged by hp
/usr/local/bin/gcc
/usr/local/bin/c++
(3) gcc 4.1.2 packaged by hp
/opt/hp-gcc/bin/gcc
/opt/hp-gcc/bin/g++
When I do no patches, it seems to select /opt/aCC/bin/aCC for c++ and /usr/local/bin/gcc for c (this last bit about gcc I will re-confirm when I get to the office).
And then "-Wall" is an error to /opt/aCC/bin/aCC.
I'm using scons 0.96.96.
I'm willing to learn and help to get any of this nicely fixed (I know not everyone has access to this platform). Let me know what you would like from me and I can try to provide it (unfortunately I cannot provide direct login access to our hardware).
deckrider
20th April 2007 15:45 UTC
Re: "(2) gcc (I think it was version 3.4) packaged by hp"
... the precise version is 3.4.3
Re: "When I do no patches, it seems to select /opt/aCC/bin/aCC for c++ and /usr/local/bin/gcc for c."
... I have re-verified this behavior.
Thus, the first un-patched error looks like this (notice "Using GNU tools configuration", how do I get it not to use that, since the aCC compiler became selected?):
deverly@omztdv1:~/helper-tools/nsis-2.25-src$ scons DEBUG=yes STRIP=no SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all PREFIX_BIN=/opt/vzb/bin PREFIX=/opt/vzb PREFIX_CONF=/etc/opt/vzb APPEND_LINKFLAGS="-L/usr/local/lib/hpux32" install-compiler
scons: Reading SConscript files ...
Delete("nsis-20-Apr-2007.cvs")
Delete(".instdist")
Delete(".test")
Using GNU tools configuration
Checking for linker flag -m32... yes
Checking for compiler flag -m32... no
Checking for linker flag $MAP_FLAG... no
Checking for linker flag $MAP_FLAG... no
Checking for memcpy requirement... yes
Checking for memset requirement... yes
Checking for linker flag -pthread... yes
Checking for __BIG_ENDIAN__... no
Checking for C library gdi32... no
Checking for C library user32... no
Checking for C library pthread... yes
Checking for C library stdc++... yes
Checking for C library iconv... yes
Checking for C library dl... yes
Checking for C library gdi32... no
Checking for C library iconv... yes
Checking for C library pthread... yes
Checking for C library user32... no
Checking for C++ library cppunit... no
scons: done reading SConscript files.
scons: Building targets ...
/opt/aCC/bin/aCC -o build/debug/makensis/build.o -c -g -Wall -D_WIN32_IE=0x0500 -Ibuild/debug/makensis -ISource Source/build.cpp
aCC: error 1914: bad form for `-W' option
scons: *** [build/debug/makensis/build.o] Error 1
scons: building terminated because of errors.
deckrider
20th April 2007 15:58 UTC
I've looked at the __BIG_ENDIAN__ test and now see that both flavors of gcc/g++/c++ on my system define __BIG_ENDIAN__, but cc/aCC do not (they define _BIG_ENDIAN instead).
So the bad test was really a symptom caused by the bad combination of gcc with aCC noted earlier.
deckrider
20th April 2007 16:23 UTC
Just tested: both gcc 3.4.3 and 4.1.2 do NOT support -mno-strict-align on hpux ia64:
error: invalid option `no-strict-align'
Thus far this means only the HP compilers and their options can be used.
deckrider
20th April 2007 17:01 UTC
Under nsis 2.25 and HP cc/aCC, there are two compile errors in the unpatched source code:
/opt/aCC/bin/aCC -o build/debug/makensis/Plugins.o -c -mt +u1 -g -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/debug/makensis -ISource Source/Plugins.cpp
"Source/Plugins.cpp", line 72: error #2350: more than one operator ">="
matches these operands:
built-in operator "arithmetic >= arithmetic"
function "std::fpos<_StateT>::operator>=(const std::fpos<_StateT>
&) const [with _StateT=mbstate_t]"
function "std::fpos<_StateT>::operator>=(std::streamoff) const
[with _StateT=mbstate_t]"
operand types are: std::basic_ifstream<char,
std::char_traits<char>>::pos_type >= int
assert(result >= 0);
^
1 error detected in the compilation of "Source/Plugins.cpp".
scons: *** [build/debug/makensis/Plugins.o] Error 2
scons: building terminated because of errors.
/opt/aCC/bin/aCC -o build/debug/makensis/ResourceEditor.o -c -mt +u1 -g -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/debug/makensis -ISource Source/ResourceEditor.cpp
"Source/ResourceEditor.cpp", line 684: error #2308: more than one instance of
overloaded function "ConvertEndianness" matches the argument list:
function "ConvertEndianness(DWORD)"
function "ConvertEndianness(LONG)"
function "ConvertEndianness(WORD)"
argument types are: (unsigned long)
PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(seeker - pbRsrcSec + m_dwResourceSectionVA);
^
1 error detected in the compilation of "Source/ResourceEditor.cpp".
scons: *** [build/debug/makensis/ResourceEditor.o] Error 2
scons: building terminated because of errors.
kichik
20th April 2007 19:28 UTC
deckrider
20th April 2007 20:16 UTC
Well I've tried the SCons/Config/hpux with patching in the elif 'hpcc' statement, but its still selecting gnu instead.
kichik
20th April 2007 20:19 UTC
The SCons problem needs to be handled first. Because it selects gcc for C code, NSIS build system selects the gnu configuration. For test purpose you can change the elif line just one line above the one you've added.
deckrider
20th April 2007 21:51 UTC
Originally posted by kichik
The SCons problem needs to be handled first. Because it selects gcc for C code, NSIS build system selects the gnu configuration. For test purpose you can change the elif line just one line above the one you've added.
I'm not sure I understand what you mean ... what I think you mean didn't fix it.
Here is what I have working so far. It is attached as a build/patch script and the output of it.
(I know it only patches SConstruction and SCons/Config/gnu, but I'm still clueless on them).
Interestingly, it builds 5 out of 6 examples under "Examples/Modern UI". The one it fails on is MultiLanguage.nsi as follows:
Removing unused resources... Done!
Generating language tables...
Error while applying NLF font/RTL: Unicode conversion failed
Error - aborting creation process
kichik
20th April 2007 21:59 UTC
Just above the elif line you've added to the SConstruct file there's an elif line for the gnu configuration. Either put hpux line first or remove the gnu line completely for test purpose. This assumes you already have a configuration file for hpux in SCons/Config, which you don't have. At least according to the patch.
Unicode conversion usually fails because of a missing codepage. Your iconv probably doesn't support one of the codepages used by the language files. You can have `create_code_page_string` in Source/util.cpp print out the codepages it tries to initialize to find out exactly which one is missing.
deckrider
21st April 2007 00:16 UTC
So I printed 'tools' and here is what came out:
['default', 'hplink', 'gcc', 'hpc++', 'g77', 'as',
'ar', 'lex', 'm4', 'RCS', 'rpcgen', 'SCCS', 'tar', 'yacc',
'zip']
I assumed then that I should have this in SConstruct:
print tools
if 'msvc' in tools or 'mstoolkit' in tools:
envs = SConscript('SCons/Config/ms')
elif 'hpc++' in tools:
envs = SConscript('SCons/Config/hpux')
elif 'gcc' in tools:
envs = SConscript('SCons/Config/gnu')
else:
envs = SConscript('SCons/Config/default')
However, it still tries to use gcc instead of /usr/bin/cc (symlink to /opt/ansic/bin/cc, the HP ANSI C compiler, as installed by HP):
/opt/aCC/bin/aCC -o build/release/makensis/clzma.o -c -mt
+u1 -D_WIN32_IE=0x0500 Source/clzma.cpp
gcc -o build/release/makensis/crc32.o -c -mt +u1
-D_WIN32_IE=0x0500 Source/crc32.c
gcc: +u1: No such file or directory
cc1: error: invalid option `t'
scons: *** [build/release/makensis/crc32.o] Error 1
scons: building terminated because of errors.
I know its now picking up the SCons/Config/hpux file, but I'm not sure how that file should be altered, given that scons seems to want gcc for its c compiler.
(Just FYI, I'll be leaving for the weekend, but can pick this back up on Monday ... thanks for all your help!)
kichik
21st April 2007 00:19 UTC
Using GCC is a SCons issue which should be fixed on the SCons side. See my first bullet in 6 replies above. Loading SCons/Config/hpux only configures flags and such. It's SCons that configures the compiler paths and the default flags and search directories.
deckrider
23rd April 2007 18:03 UTC
I don't have enough knowledge to know whether there is a scons bug or not, so I posted a message here:
http://scons.tigris.org/servlets/Rea...rs&msgNo=10713
Meanwhile, perhaps we don't have to wait. I'm attaching another try, following the pattern I think you have suggested. It is a script with some patches and its output, as well as the output of running the built makensis against the 6 MUI examples.
The script copies SCons/Config/default to SCons/Config/hpux and then patches SCons/Config/hpux so that the exact changes will be easily seen.
Here is a summmary of the counted and sorted compiler warnings:
1 "Source/build.cpp", line 488: warning #2068-D: integer conversion resulted in a change of sign
1 "Source/build.cpp", line 512: warning #2068-D: integer conversion resulted in a change of sign
1 "Source/build.cpp", line 533: warning #2068-D: integer conversion resulted in a change of sign
1 "Source/script.cpp", line 2771: warning #2186-D: pointless comparison of unsigned integer with zero
1 "Source/script.cpp", line 5838: warning #2111-D: statement is unreachable
1 "Source/util.cpp", line 583: warning #2541-D: omission of exception specification is incompatible with previous function "operator new(size_t)" (declared at line 89 of "/opt/aCC/include_std/new")
1 "Source/util.cpp", line 590: warning #2541-D: omission of exception specification is incompatible with previous function "operator delete(void *)" (declared at line 91 of "/opt/aCC/include_std/new")
1 "Source/util.cpp", line 594: warning #2541-D: omission of exception specification is incompatible with previous function "operator delete[](void *)" (declared at line 95 of "/opt/aCC/include_std/new")
1 "Source/util.cpp", line 682: warning #2186-D: pointless comparison of unsigned integer with zero
12 "Source/ResourceEditor.h", line 64: warning #3055-D: types cannot be declared in anonymous unions
12 "Source/ResourceEditor.h", line 78: warning #3055-D: types cannot be declared in anonymous unions
deckrider
23rd April 2007 20:59 UTC
As it turns out, the aCC compiler is all that is needed, since it has this option:
-Ae In aC++, invokes aCC as an ANSI-C compiler
I've found that just because aCC exists doesn't mean /opt/ansic/bin/cc does. So I've make a small change in the script to allow compiling with just aCC.
kichik
24th April 2007 14:29 UTC
deckrider
24th April 2007 21:26 UTC
Thanks for the reply. Here are some thoughts, let me know what you think.
Originally posted by kichik
- As far as I can tell, it does find aCC with no issue. And on any HPUX system, until there is some unaligned option, gcc/g++ cannot be used to build makensis, so aCC is exactly and only what is needed.
Given that we are using the scons detection of aCC to drive the process into using SCons/Conf/hpux, it seems correct to say that if we are in SCons/Conf/hpux, CXX = 'aCC' and thus CC must be 'aCC -Ae', no matter what scons says, even when all scons bugs are fixed.
- I think it'd be better to check for _BIG_ENDIAN with a configuration test, just like in SCons/Config/gnu. A simple #ifdef can make sure the test program will return 1 in case _BIG_ENDIAN is defined. Hmmm...shouldn't this then be a 'global' test instead of a platform-specific test?
And if so, then shouldn't the test itself never look to see what the compiler defines, but always provide the 'correct' answer to the question of whether a system was big endian or not, thus avoiding the problem if two different compilers are used, once for CC and one for CXX, that give different #defines automatically?
- Currently, your hpux changes the build flags for everything built. It allows you to build makensis but not the rest. I think the best thing here would be to extract most of the mingw stuff from SCons/Config/gnu to SCons/Config/posix and use that in both SCons/Config/gnu and SCons/Config/hpux. This way, everything could be built on HP-UX and there'd be no code duplication. I think some of the flags, like -g, are also common to the two configurations. Let me know if you're up to it.
Yes I was wondering about this last night. We don't have the option of installing any cross compiler onto these systems so I don't have a way to test cross compilation.
However, I'm wondering if there wouldn't be an elegant way so that the same mingw cross-compilation environment could be used and then that could be included into the specific hpux or gcc files that are building makensis.
I'll definitely look at the gcc file to try to emulate that so the makensis compiler options are only used for makensis, but I don't know how to be elegant regarding a cross compilation mingw environment using scons.
kichik
24th April 2007 21:34 UTC
It doesn't find aCC (the C compiler) and that's why it loads gcc. Look in SCons/Tool/__init__.py and you'll see this logic. I also forgot to mention that '-Ae' should go into CCFLAGS and not CC.
defenv.Append(CCFLAGS = '-Ae')
Regarding _BIG_ENDIAN, I prefer not to run tests that aren't really needed. With Visual C++, this isn't required because we're always building for Win32 and on GCC it's only required sometimes. It'd be semi-global if the split is made from SCons/Config/gnu into SCons/Config/posix.
Cross compilation environments aren't so elegant in SCons, but already dealt with in the gnu configuration file. There's a function there that converts a given environment to a cross-compile environment.
deckrider
25th April 2007 19:02 UTC
It seems that anything I add to CCFLAGS also goes to CXX.
kichik
25th April 2007 19:52 UTC
Right, that was recently changed. Use CFLAGS instead (one C only).
deckrider
27th April 2007 00:43 UTC
Here is the latest incarnation of script/patches.
I have not addressed the cross-compiler issues, since don't have a cross compiler in this environment so as to test anything I do in this regard.
And I'm still setting CC = CXX because, even if it finds some other HP c compiler, I only want it to use CXX when building makensis.
kichik
27th April 2007 12:51 UTC
Thanks. Please submit a patch and I'll add it after 2.26.
deckrider
30th April 2007 17:08 UTC
nsis scons paradigm
I've not yet submitted a patch, because I'm still confused as to the mindset I should use when thinking about scons changes, specifically relating to selecting compilers and paths ($CC, $CXX, $PATH) on unix environments.
I'm an avid autotools user (autoconf, automake, libtool), so I tend to start with the idea that $CC, $CXX, $PATH can be determined by the person running the build.
When I patch nsis to accept my PATH, scons finds all my compilers on hpux ia64, but prefers CC=/opt/ansic/bin/cc and CXX=/opt/aCC/bin/aCC over any of the others.
On hpux, it is possible that one might have /opt/aCC/bin/aCC, but not /opt/ansic/bin/cc.
It may also be possible that the hpux user would want to select /opt/hp-gcc/bin/gcc and /opt/hp-gcc/bin/g++ over any of the other installed compilers.
There are options for each of these scenarios which will allow for unaligned access on hpux.
But currently, it is does not seem possible for the builder to determine PATH, CXX, and CC within nsis. I'm curious if this is your preference?
kichik
30th April 2007 19:14 UTC
SCons doesn't provide much of a convenient user interface for selecting the compilers used to build. When you build an environment with the default values, it'll load what it thinks is best. Then it'll go on and search additional peripheral tools. It's also possible to pass a list of tools to load instead of this default behavior.
The tools define far more than just the path of the compiler. They define required flags, available builders, file extensions, etc. Tool definitions are made of code, so they are able to perform complex searches. Take NSIS/SCons/Tools/crossmingw.py for example, which searches for the right compiler.
Add the Options list only being able to perform on an already existing environment with a loaded set of tools and you get (1) an ugly hack to load specific tools and not the defaults, (2) inability to define just the compiler path and (3) errors about missing builders when using an incomplete list of tools (i.e. no tool for C selected).
Number 2 has a very good reason and I actually like that about SCons. Number 1 can be solved by using ARGUMENTS, which I forgot about. Number 3 must be handled by the user with a little help from the build scripts that add the tools that are always required - namely `zip`. It can also be solved by adding a tool selection mechanism to SCons which will allow selecting a specific tool for a specific task while allowing tools for other tasks to be automatically detected.
I've now added the TOOLSET option to SConstruct which allows passing a comma-separated list of tools to load instead of the default. It assumes the user selects a tool for each required task. Instead of directly selecting the C compiler, it asks for a name SCons builder to do the task. Flags can still be added with APPEND_CCFLAGS and APPEND_LINKFLAGS.
Which of the options work on GCC? Does the unalign lib work on GCC as well?
deckrider
30th April 2007 19:35 UTC
Originally posted by kichik
Which of the options work on GCC? Does the unalign lib work on GCC as well?
Compiling with gcc/g++ seems to work fine with the following approach on hpux ia64:
1. since there are no headers for allow_unaligned_data_access(), one must define it:
extern "C" { void allow_unaligned_data_access(); }
2. then at the beginning of main():
allow_unaligned_data_access();
3a. finally, on Itanium link:
-lunalign
3b. or on PA-RISC link:
-lhppa
But of course, this means there must be some way of knowing you are on these platforms so as to select the correct actions.
kichik
30th April 2007 19:38 UTC
SCons uses if env['PLATFORM'] == 'hpux', so that should be good enough.
- NSIS Discussion
- Error Building NSIS on HP-UX
Archive: Error Building NSIS on HP-UX
deckrider
30th April 2007 19:49 UTC
Originally posted by kichik
SCons uses if env['PLATFORM'] == 'hpux', so that should be good enough.
Is there another way that determines whether to use -lunalign or -lhppa? (note that on Itanium at least, both libraries are installed, because we have emulation capabilities).
kichik
30th April 2007 19:52 UTC
If linking to both on Itanium is ok, both can be checked for and linked against if they exist.
deckrider
30th April 2007 19:58 UTC
This is the result:
ld: Can't find library or mismatched ABI for -lhppa
(In our case, it is the mismatched ABI, since we are compiling for ia64).
kichik
30th April 2007 20:03 UTC
As long as it's an error, it's good enough for the configuration functions which expect nothing bug success before they include a library. See AddAvailableLibs in SCons/utils.py.
deckrider
30th April 2007 20:08 UTC
Yes, to confirm, both g++ and aCC return an error to the shell when trying to link to the wrong ABI.
deckrider
1st May 2007 18:55 UTC
Originally posted by kichik
I've now added the TOOLSET option to SConstruct which allows passing a comma-separated list of tools to load instead of the default. It assumes the user selects a tool for each required task. Instead of directly selecting the C compiler, it asks for a name SCons builder to do the task. Flags can still be added with APPEND_CCFLAGS and APPEND_LINKFLAGS.
I've tried this TOOLSET option, but it isn't working, since the PATH cannot be set, and it doesn't seem to go through any scons logic to search the path.
deckrider
1st May 2007 21:49 UTC
Here is the latest incarnation of make-nsis.txt script/patch.
I think the only remaining issue in the patch is that I've incorporated the PATH, so it can find the various tools, since on my HP system they are as follows (and who can predict where others may have installed their tools):
/opt/aCC/bin/aCC
/opt/ansic/bin/cc
/opt/hp-gcc/bin/gcc
/opt/hp-gcc/bin/g++
/usr/local/bin/gcc
/usr/local/bin/c++
However, I'm open to discovering or being shown other issues :)
It should work for both gcc/g++ and aCC on both PA-RISC/Itanium on all HP-UX.
To use g++/gcc instead, change from:
TOOLSET=hpc++,hpcc,hplink
to:
TOOLSET=g++,gcc,gnulink
Also, be sure your PATH contains all the locations of the tools you plan to use.
deckrider
7th May 2007 16:58 UTC
Originally posted by kichik
Thanks. Please submit a patch and I'll add it after 2.26.
Patch #1714416 submitted.
kichik
19th May 2007 20:48 UTC
Thanks. I'll take a look when I get the time.
Portante
15th June 2007 04:44 UTC
UCS-2LE not available under HP-UX
Hello folks,
I have tried deckrider's patch (applied to NSIS 2.28), and I have had to make a few other tweaks to get the install compiler built. However, the setup.exe generated hangs on our windows box. Perhaps I can confirm that the tweaks I have made are not too harmful.
I am running things on an rx2600 (IA) HP-UX 11.23 (the 0505 release) with the following compiler versions
B3901BA C.11.23.09 HP C/ANSI C Developer's Bundle (S800)
B3913DB C.05.55 HP aC++ Compiler (S800)
Using HP's C++ compiler the anonymous unions in ResourceEditor.h were considered errors. So as a work around, I named them _a and _b and modified the source code to reference them. Ugly, I know, but wanted to get around that for now.
I then modified deckrider's hpc++ configuration to add +W829 so that a number of warnings about deprecated constant conversions would be ignored.
I then had to tweak util.cpp, to change "CP1252" to "cp1252", and "UCS-2LE" to "UCS-2BE" in order for HP-UX's iconv_open() to accept the arguments. However, the use of UCS-2BE most likely means that I cannot use nsis-2.28.zip pre-compiled contents, as those executables use UCS-2LE, right?
Thanks, -peter
deckrider
15th June 2007 11:53 UTC
Re: UCS-2LE not available under HP-UX
Originally posted by Portante
Hello folks,
I have tried deckrider's patch (applied to NSIS 2.28), and I have had to make a few other tweaks to get the install compiler built. However, the setup.exe generated hangs on our windows box
I haven't tried NSIS 2.28 yet. We've been using the patch (#1714416) that was uploaded to sourceforge without issue, but only to build the 'makensis' executable and only for NSIS 2.27. (I'll provide a few more details when I get to work--no such host with me here at home.) Do you have these issues with 2.27?
kichik
15th June 2007 15:47 UTC
You can't use UCS-2BE. Windows uses little endian so every string must be encoded with little endian and not big endian. If HP-UX's libiconv doesn't support UCS-2LE, it can't be used and must be replaced.
deckrider
15th June 2007 18:47 UTC
Re: Re: UCS-2LE not available under HP-UX
Originally posted by deckrider
(I'll provide a few more details when I get to work--no such host with me here at home.)
Still haven't tried 2.28 yet, but here are my details for 2.27:
$ uname -a
HP-UX omztdv1 B.11.23 U ia64 2505142627 unlimited-user license
$ aCC -V
aCC: HP C/aC++ B3910B A.06.12 [Aug 17 2006]
$ cc -V
cc: HP aC++/ANSI C B3910B A.06.10 [Mar 22 2006]
$ ldd `which makensis`
libunalign.so.1 => /usr/lib/hpux32/libunalign.so.1
libpthread.so.1 => /usr/lib/hpux32/libpthread.so.1
libiconv.so => /usr/local/lib/hpux32/libiconv.so
libstd_v2.so.1 => /usr/lib/hpux32/libstd_v2.so.1
libCsup.so.1 => /usr/lib/hpux32/libCsup.so.1
libm.so.1 => /usr/lib/hpux32/libm.so.1
libunwind.so.1 => /usr/lib/hpux32/libunwind.so.1
libc.so.1 => /usr/lib/hpux32/libc.so.1
libdl.so.1 => /usr/lib/hpux32/libdl.so.1
libc.so.1 => /usr/lib/hpux32/libc.so.1
libuca.so.1 => /usr/lib/hpux32/libuca.so.1
# note above that I didn't link to the native libiconv
# but the one I link to is available from HP :
$ swlist -l file | grep /usr/local/lib/hpux32/libiconv.so
GNUbase.GNUBASE-IPF-RUN: /usr/local/lib/hpux32/libiconv.so
# and finally how I build:
scons \
SKIPSTUBS=all \
SKIPPLUGINS=all \
SKIPUTILS=all \
SKIPMISC=all \
VERSION=$PACKAGE_VERSION \
PATH=$PATH \
TOOLSET=hpc++,hpcc,hplink \
APPEND_CPPPATH=/usr/local/include \
APPEND_LIBPATH=/usr/local/lib/hpux32 \
PREFIX_BIN=/opt/vzb/bin \
PREFIX=/opt/vzb \
PREFIX_CONF=/etc/opt/vzb \
PREFIX_DEST=$DSTDIR \
install-compiler
Portante
28th June 2007 15:47 UTC
Here is what I had to do to get NSIS 2.28 to work for HP-UX
Folks, here is what I had to do to get NSIS 2.28 to build and run on HP-UX 11.11 (PA) and 11.23 (IA) platforms. The additional patch (see attachment) contains:
- hpc++: a couple of flags to enable the code to be compiled with only a few changes
- SConstruct: change order of gnu and hpc++ conditionals so that GNU is not recognized by default
- ResourceEditor.cpp, ResourceEditor.h, util.cpp: remove anonymous unions; this is a hack fix, which I did not like doing, but I didn't find a compiler switch to enable this behavior; also for util.cpp, the new and delete operator definitions conflicted with HP-UX C++ header files.
How to build NSIS for HP-UX (using NSIS 2.28 as an example)
Assumptions:
-
For 11.23 IA
$ swlist -a revision -a architecture -a title B3913DB,r=C.05.55
# B3913DB C.05.55 HP-UX_B.11.23_IA HP aC++ Compiler (S800)
B3913DB.C-Dev-Tools B.11.23.03 HP-UX_B.11.23_IA C Language Development Tools
B3913DB.Caliper B.11.23.03 HP-UX_B.11.23_IA HP Itanium Performance Measurement Tools
B3913DB.ACXX C.05.55 HP-UX_B.11.23_IA HP aC++
B3913DB.WDB-GUI B.11.23.03 HP-UX_B.11.23_IA GUI for the HP WDB Debugger
B3913DB.WDB B.11.23.03 HP-UX_B.11.23_IA HP Wildebeest (HP WDB) Debugger
B3913DB.Auxiliary-Opt B.11.23.03 HP-UX_B.11.23_IA Auxiliary Optimizer for HP Languages.
$ aCC -V
aCC: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
$ swlist -a revision -a architecture -a title B3901BA,r=C.05.55
# B3901BA C.05.55 HP-UX_B.11.23_IA HP C/ANSI C Developer's Bundle (S800)
B3901BA.C-ANSI-C C.05.55 HP-UX_B.11.23_IA HP C/ANSI C Compiler
B3901BA.X11MotifDevKit B.11.23.03 HP-UX_B.11.23_IA/PA HP-UX Developer's Toolkit - X11, Motif, and Imake
B3901BA.Caliper B.11.23.03 HP-UX_B.11.23_IA HP Itanium Performance Measurement Tools
B3901BA.WDB-GUI B.11.23.03 HP-UX_B.11.23_IA GUI for the HP WDB Debugger
B3901BA.WDB B.11.23.03 HP-UX_B.11.23_IA HP Wildebeest (HP WDB) Debugger
B3901BA.Auxiliary-Opt B.11.23.03 HP-UX_B.11.23_IA Auxiliary Optimizer for HP Languages.
B3901BA.C-Dev-Tools B.11.23.03 HP-UX_B.11.23_IA C Language Development Tools
$ cc -V
cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
$ swlist -a revision -a architecture -a title gcc libiconv
# gcc 3.4.3 HP-UX_B.11.23_64 gcc
gcc.gcc-INC
gcc.gcc-MAN
gcc.gcc-RUN
gcc.gcc-SHLIBS
# libiconv 1.11 HP-UX_B.11.23_64 libiconv
libiconv.libiconv-RUN
-
For 11.11 PA
$ swlist -a revision -a architecture -a title B3913DB,r=C.03.70
# B3913DB C.03.70 HP-UX_B.11.11_32/64 HP aC++ Compiler (S800)
B3913DB.C-Dev-Tools B.11.11.16 HP-UX_B.11.00_32/64 C Language Development Tools
B3913DB.ACXX C.03.70 HP-UX_B.11.00_32/64 HP aC++
B3913DB.CodeAdvisor C.01.00 HP-UX_B.11.00_32/64 HP Static Analysis Tool
B3913DB.WDB-GUI B.11.11.16 HP-UX_B.11.00_32/64 GUI for the HP WDB Debugger
B3913DB.WDB B.11.11.16 HP-UX_B.11.00_32/64 HP Wildebeest (HP WDB) Debugger
B3913DB.DebugPrg B.11.11.16 HP-UX_B.11.00_32/64 Debugging Support Tools
B3913DB.Auxiliary-Opt B.11.11.16 HP-UX_B.11.00_32/64 Auxiliary Optimizer for HP Languages.
# aCC -V
aCC: HP ANSI C++ B3910B A.03.70
# swlist -a revision -a architecture -a title B3901BA,r=B.11.11.16
# B3901BA B.11.11.16 HP-UX_B.11.11_32/64 HP C/ANSI C Developer's Bundle for HP-UX (S800)
B3901BA.C-ANSI-C B.11.11.16 HP-UX_B.11.00_32/64 HP C/ANSI C Compiler
B3901BA.X11MotifDevKit B.11.11.02 HP-UX_B.11.11_32/64 HP-UX Developer's Toolkit - X11, Motif, and Imake
B3901BA.ImagingDevKit B.11.11.02 HP-UX_B.11.11_32/64 HP-UX Developer's Toolkit - Imaging
B3901BA.CDEDevKit B.11.11.02 HP-UX_B.11.11_32/64 CDE Developer Kit
B3901BA.AudioDevKit B.11.11.02 HP-UX_B.11.11_32/64 HP-UX Audio Developer Kit
B3901BA.CodeAdvisor C.01.00 HP-UX_B.11.00_32/64 HP Static Analysis Tool
B3901BA.WDB-GUI B.11.11.16 HP-UX_B.11.00_32/64 GUI for the HP WDB Debugger
B3901BA.WDB B.11.11.16 HP-UX_B.11.00_32/64 HP Wildebeest (HP WDB) Debugger
B3901BA.DebugPrg B.11.11.16 HP-UX_B.11.00_32/64 Debugging Support Tools
B3901BA.Auxiliary-Opt B.11.11.16 HP-UX_B.11.00_32/64 Auxiliary Optimizer for HP Languages.
B3901BA.C-Dev-Tools B.11.11.16 HP-UX_B.11.00_32/64 C Language Development Tools
B3901BA.C-Analysis-Tools B.11.11.16 HP-UX_B.11.00_32/64 C Language Analysis Tools
# cc -V tmp.c
cpp.ansi: HP92453-01 B.11.11.16 HP C Preprocessor (ANSI)
ccom: HP92453-01 B.11.11.16 HP C Compiler
/usr/ccs/bin/ld: 92453-07 linker linker ld B.11.53 060322
$ swlist -a revision -a architecture -a title gcc libiconv
# gcc 3.4.3 HP-UX_B.11.11_700/800 gcc
gcc.gcc-INC
gcc.gcc-MAN
gcc.gcc-RUN
# libiconv 1.11 HP-UX_B./800 libiconv
libiconv.libiconv-RUN
- /tmp/nsis-2.28.zip exists
- /tmp/nsis-2.28-src.tar exists
- /tmp/nsis-hpux.patch (http://sourceforge.net/tracker/downl...05&aid=1714416) exists
- /tmp/nsis-hpux-vse.patch exists (see attachment)
Note that HP-UX's /usr/bin/patch does not work with the patch files listed above. So the source tree might first have to be patched up on a box with GNU patch 2.5.9 (
http://mirrors.ibiblio.org/pub/mirro...h-2.5.9.tar.gz ) or later, and then moved to the target HP-UX box (installing and running GNU patch on the HP-UX box will work as well).
For both IA and PA first perform the following steps:
cd /opt
umask 022
unzip /tmp/nsis-2.28.zip
ln -s nsis-2.28 nsis
cd /tmp
tar xf /tmp/nsis-2.28-src.tar
cd nsis-2.28-src
patch -p1 < ../nsis-hpux.patch
patch -p1 < ../nsis-hpux-vse.patch
Then, for
PA:
scons \
SKIPSTUBS=all \
SKIPPLUGINS=all \
SKIPUTILS=all \
SKIPMISC=all \
NSIS_CONFIG_CONST_DATA_PATH=no \
APPEND_CPPPATH=/usr/local/include \
APPEND_LIBPATH=/usr/local/lib \
PREFIX=/opt/nsis \
install-compiler
Then, for
IA (only difference is that APPEND_LIBPATH is set to /usr/local/lib/hpux32):
scons \
SKIPSTUBS=all \
SKIPPLUGINS=all \
SKIPUTILS=all \
SKIPMISC=all \
NSIS_CONFIG_CONST_DATA_PATH=no \
APPEND_CPPPATH=/usr/local/include \
APPEND_LIBPATH=/usr/local/lib/hpux32 \
PREFIX=/opt/nsis \
install-compiler
kichik
29th June 2007 18:02 UTC
Does that remove the need for the PATH change? deckrider, does the new patch work for you too?
deckrider
20th July 2007 20:39 UTC
Originally posted by kichik
Does that remove the need for the PATH change? deckrider, does the new patch work for you too?
Sorry to take so long to respond, I just noticed this recently. A friend loaned me some time on:
HP-UX B.11.11 U 9000/893 HP-UX
aCC: HP ANSI C++ B3910B A.03.34
As a small note, on this older compiler, I had to convert all the source
code from dos to unix line endings, otherwise it would fail on #define
multiline continuations.
I'm providing a patch to nsis-2.29-src which works for both the above
host/compiler and:
HP-UX B.11.23 U ia64
aCC: HP C/aC++ B3910B A.06.12 [Aug 17 2006]
The only real difference from my original patch is that it adds -AA to
CXXFLAGS (its the default on aCC A.06.12) and fixes some compile errors
in Source/util.cpp (they were only warnings on aCC A.06.12).
Clearly, the library locations will be different, but these should be
specified by the user anyway.
I should explain that my patches are essentially to add alignment fixups based on SIGBUS. Either -lunalign or -lhppa provides this handler
as documented here:
http://h30097.www3.hp.com/docs/porti...64-to-hpux.pdf
As for Portante's patch, I haven't yet had the time to analyze or test
it, but if it converts makensis to using only aligned access, then this
is better and the alignment fixups I'm using are not needed, and should
be removed.
deckrider
20th July 2007 21:36 UTC
I had more time than I thought this afternoon:
I tried applying nsis-hpux.patch-patch.txt, and during the hpux ia64 build I get these:
aCC: warning 967: Option -AA or -AP does not apply to ANSI C compilation, ignored.
Without the alignment fixups from http://h30097.www3.hp.com/docs/porti...64-to-hpux.pdf the running of makensis still results in a bus error.
But the 'anonymous' warnings are now gone :) so I'm going to add that patch to my build of nsis-2.29-src.
Here are the only warnings left for me on hpux ia64:
aCC -o build/release/makensis/build.o -c +DD32 -mt -AA -D__BIG_ENDIAN__ -DNSIS_HPUX_ALLOW_UNALIGNED_DATA_ACCESS -D_WIN32_IE=0x0500 -I/usr/local/include Source/build.cpp
"Source/build.cpp", line 534: warning #2068-D: integer conversion resulted in
a change of sign
*out++ = (unsigned int) NS_VAR_CODE; // Named user variable;
^
"Source/build.cpp", line 558: warning #2068-D: integer conversion resulted in
a change of sign
*out++=(unsigned int)NS_SHELL_CODE; // Constant code identifier
^
"Source/build.cpp", line 579: warning #2068-D: integer conversion resulted in
a change of sign
*out++ = (unsigned int)NS_LANG_CODE; // Next word is lang-string Identifier
^
aCC -o build/release/makensis/script.o -c +DD32 -mt -AA -D__BIG_ENDIAN__ -DNSIS_HPUX_ALLOW_UNALIGNED_DATA_ACCESS -D_WIN32_IE=0x0500 -I/usr/local/include Source/script.cpp
"Source/script.cpp", line 2775: warning #2186-D: pointless comparison of
unsigned integer with zero
if (s < 0)
^
"Source/script.cpp", line 5760: warning #2111-D: statement is unreachable
return PS_ERROR;
^
aCC -o build/release/makensis/util.o -c +DD32 -mt -AA -D__BIG_ENDIAN__ -DNSIS_HPUX_ALLOW_UNALIGNED_DATA_ACCESS -D_WIN32_IE=0x0500 -I/usr/local/include Source/util.cpp
"Source/util.cpp", line 676: warning #2186-D: pointless comparison of unsigned
integer with zero
if( nchars < 0 ){
^
Note that I did not use +W829 (I think it just suppresses a compiler message for a certain compiler--not the version I'm using, since none of my warnings have that number)
deckrider
20th July 2007 22:59 UTC
Here is the final combined patch (thanks Portante) that I'm using (eliminates all aCC compiler warnings on hpux ia64 aCC HP C/aC++ B3910B A.06.12 [Aug 17 2006]).
kichik
21st July 2007 16:52 UTC
Could you change _a and _b to meaningful names, wrap __THROWSPEC_NULL in some kind of #ifdef and preferably comment on its meaning (Google shows nothing) and submit it as a patch?
deckrider
23rd July 2007 14:07 UTC
Originally posted by kichik
Could you change _a and _b to meaningful names, wrap __THROWSPEC_NULL in some kind of #ifdef and preferably comment on its meaning (Google shows nothing) and submit it as a patch?
Ooops....didn't mean to let that slip through: '__THROWSPEC_NULL' should really be 'throw()' and '__THROWSPEC_X(__bad_alloc)' should really be 'throw(bad_alloc)'. The patch I submitted has that corrected, but not in any #ifdef, since it should just be standard for all compilers (but I haven't tested on msvc).
The meaningful names I chose are: UName and UOffset, but these can easily be searched and replaced in the patch if they aren't good.
I've submitted patch
1758863 at
https://sourceforge.net/tracker/inde...49&atid=373087
I developed this patch using free accounts from
http://www.testdrive.hp.com/ which I would like to recommend trying.
It may help to understand why PATH may need to be specified (for instance, if you want to compile using GCC on HPUX, but you must build/install GCC in your home directory since you don't have administrator rights).
Also, I think it may valuable to try some changes first hand if needed.