Old 6th December 2016, 21:34   #1
CrazyDogGuy
Junior Member
 
Join Date: Dec 2016
Posts: 8
MakeNSIS 2.50 Compile on CentOS7

Hi All--

I'm attempting to create a new build machine for my products to replace a dying one. I've downloaded the NSIS 2.50 source and am attempting to compile it. I've applied a patch to get around a gcc 4.8 compile issue, but now I'm getting a link error:

code:

/bin/ld: i386 architecture of input file `build/release/makensis/build.o' is incompatible with i386:x86-64 output
/bin/ld: i386 architecture of input file `build/release/makensis/clzma.o' is incompatible with i386:x86-64 output
/bin/ld: i386 architecture of input file `build/release/makensis/crc32.o' is incompatible with i386:x86-64 output
....
collect2: error: ld returned 1 exit status
scons: *** [build/release/makensis/makensis] Error 1
scons: building terminated because of errors.




As near as I can tell, the compile is getting done with the -m32 flag as it should.

I've made sure I have the 32-bit development libraries installed. Can someone help me get past this?

Thanks!

CrazyDogGuy
CrazyDogGuy is offline   Reply With Quote
Old 6th December 2016, 22:25   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
I guess you need to pass "-m elf_i386" to the linker?

Have you tried NSIS v3? v2.xx is probably harder to get working on newer systems...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th December 2016, 15:10   #3
CrazyDogGuy
Junior Member
 
Join Date: Dec 2016
Posts: 8
Thanks for the response, Anders.

We can't update to 3.0 yet, we'd have to update a bunch of custom plugins and do a bunch of testing that we don't have the time for at the moment.

I did figure out my problem... there was a clue a little earlier in the log:
code:
Using GNU tools configuration
Checking for compiler flag -m32... (cached) yes
Checking for linker flag -m32... (cached) no


That led me to add the following to $SRCDIR/SCons/Config/gnu in the makensis environment section:
code:
makensis_env.Append(LINKFLAGS = ['-m32'])

Incidentally, for anyone else that attempts this with 2.5 and GCC later than 4.6, you'll get a compile error before you ever get to the linker if you don't apply the changes in this patch

Thanks again for the help,
CDG
CrazyDogGuy is offline   Reply With Quote
Old 8th December 2016, 02:53   #4
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 881
Quote:
Originally Posted by CrazyDogGuy View Post
We can't update to 3.0 yet, we'd have to update a bunch of custom plugins and do a bunch of testing that we don't have the time for at the moment.
The plugin API hasn't changed, but there is a new restriction on where you can load .dll's from (%windir%\system32 and $pluginsdir are the default, you can add more with AddDllDirectory() using the system plugin).

FYI, many of the example scripts in 2.46 haven't been changed in 3.0, so there is a pretty good chance the script itself will compile without errors.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 8th December 2016, 03:48   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
Quote:
Originally Posted by JasonFriday13 View Post
The plugin API hasn't changed, but there is a new restriction on where you can load .dll's from (%windir%\system32 and $pluginsdir are the default, you can add more with AddDllDirectory() using the system plugin).
No, only system32 is searched by default, you have to add $pluginsdir with AddDllDirectory if you need it but all of this only applies to relative paths, absolute paths work everywhere. If your plug-in only uses normal Windows .dlls like user32 and shell32 then you don't have to do anything.

When you move to 3.0 you probably want to switch to Unicode as well and that might mean fixing bugs in your plug-in that usually show up when you first switch even if it was coded with TCHAR/LPTSTR/TEXT to begin with. If you stay Ansi then 3.0 and 2.5x are very similar.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
gcc, posix, scons

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump