Joined: 30 Mar 2009
|Posted: Fri Aug 13, 2010 5:01 pm Post subject: Can't load libfish.so on Hardened Gentoo x86
|Hey - I'm running into a problem compiling FiSH that I haven't run into before on all the times and different machines I've gotten FiSH to work on.
I'm running on a two-day old install of hardened Gentoo x86 (which has PaX and grsecurity enabled), and I can compile 1.0 RC5 or 0,99 fine but I always get this message when trying to load FiSH in irssi:
|-!- Irssi: Error loading module fish/fish: /usr/lib/irssi/modules/libfish.so: undefined symbol: mirvar
I found a thread on the FiSH forums about someone else using Hardened who was running into a similar issue, including recompiling MIRACL and FiSH with some alternate CFLAGS and LDFLAGS, but nothing seems to make this problem go away (and the FiSH forums are completely dead). Compiling on a normal Linux system running the same version of everything and using the libfish.so from that results in a segmentation fault.
I can't seem to find any clues on Google or the Gentoo forums as to how to solve this mirvar problem. Any help would be greatly appreciated.
p.s. this is the only clue I found on the FiSH forums from the aforementioned thread. i added the flags as they are written and checked the owner/permissions, but nothing fixed it. this post is also a year and a half old.
I have the last day or so tried to get around this issue and solar, from the Hardened Gentoo team, helped me find that these segfaults were due to stack being RWX in libfish.so.
To get away with this without disabling the MPROTECT-feature, you have to pass some extra options to the linker and compiler.
CFLAGS += " -Wa,--noexecstack"
LDFLAGS +=" -Wl,-z,noexecstack"
Also, if you have enabled TPE, make sure that both the libfish.so file and irssi binary have appropriate owner and permissions.
Another note; this is an issue that has emerged somewhere between 2.6.26 and 2.6.27.