Subject: Re: kern/30008 & NetBSD 3.0_BETA: "cannot enable executable stack"
To: Chuck Silvers <chuq@chuq.com>
From: Brian de Alwis <bsd@cs.ubc.ca>
List: current-users
Date: 10/26/2005 10:31:09
An immediate fix is to remove the executable-stack flag: most libraries
causing this problem were probably mistakenly built with executable-stack
flag.  I managed to get the execstack program compiled under a SuSE
system, and applying this to the appropriate libraries has solved my
immediate problems.  I've made a compiled binary available at:

    http://www.cs.ubc.ca/~bsd/execstack.gz

This was compiled on a SuSE 9.1 box with libelf-0.8.5 [*].  I ran
something like the following:

    find /usr/pkg/emul/linux -name '*.so*' 2>/dev/null \
	| xargs execstack -q 2>/dev/null \
	| grep '^X' \
	| xargs execstack -c

For Eclipse users, you may need to extract and execstack-fix the SWT
.so libraries too (I had to for 3.1.1 GTK).

Brian.

[*] For those wanting to build their own execstack,
it is part of the prelink distribution (available at
<ftp://people.redhat.com/jakub/prelink/>).  Beware that prelink ships
with a byteswap.h file, which will hide /usr/include/byteswap.h: You'll
need to manually include it.

-- 
  Brian de Alwis | Software Practices Lab | UBC | http://www.cs.ubc.ca/~bsd/
      "Amusement to an observing mind is study." - Benjamin Disraeli