[sudo-users] [BUG] Another system (solaris 10 sparc) requires --disable-pie flag

Christian Jullien eligis at orange.fr
Sat May 25 05:58:27 MDT 2013


Todd,

Now all is clear to me, you can read
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57409 for full details.

In short, about only Linux supports PIE, this probably also explains ia64
bug.
On your Solaris machine, when you think you use pie, you don't. Solaris ld
silently ignore pie.
On my box with gnu ld, it just hangs which looks to be a binutils bug.

May I suggest you to support pie only on Linux (easy) or, as Eric suggests,
better check that pie is actually supported (maybe with my simple C
program?)

Christian

-----Original Message-----
From: Todd C. Miller [mailto:Todd.Miller at courtesan.com] 
Sent: vendredi 24 mai 2013 13:36
To: Christian Jullien
Cc: sudo-users at sudo.ws
Subject: Re: [sudo-users] [BUG] Another system (solaris 10 sparc) requires
--disable-pie flag

Here's what I get:

$ gcc -o foo foo.c
$ ./foo
malloc 20d18
$ gcc -o foo -pie foo.c
$ ./foo
malloc 20d18
$ gcc -o foo -pie -fPIE foo.c
$ ./foo
malloc 20d30
$ gcc -o foo -pie -fpie foo.c
$ ./foo
malloc 20d28

I suspect there is something wrong with your gcc toolchain.  Is your gcc
built to use the Solaris or GNU linker?  Here's the verbose output I see.

$ gcc -o foo -v -fPIE -pie foo.c

Reading specs from /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/csw/libexec/gcc/sparc-sun-solaris2.10/4.8.0/lto-wra
pper
Target: sparc-sun-solaris2.10
Configured with:
/home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparc
v8plus/gcc-4.8.0/configure --prefix=/opt/csw --exec_prefix=/opt/csw
--bindir=/opt/csw/bin --sbindir=/opt/csw/sbin --libexecdir=/opt/csw/libexec
--datadir=/opt/csw/share --sysconfdir=/etc/opt/csw
--sharedstatedir=/opt/csw/share --localstatedir=/var/opt/csw
--libdir=/opt/csw/lib --infodir=/opt/csw/share/info
--includedir=/opt/csw/include --mandir=/opt/csw/share/man
--enable-cloog-backend=isl --enable-java-awt=xlib
--enable-languages=ada,c,c++,fortran,go,java,objc --enable-libada
--enable-libssp --enable-nls --enable-objc-gc --enable-threads=posix
--program-suffix=-4.8 --with-cloog=/opt/csw --with-gmp=/opt/csw
--with-included-gettext --with-ld=/usr/ccs/bin/ld --without-gnu-ld
--with-libiconv-prefix=/opt/csw --with-mpfr=/opt/csw --with-ppl=/opt/csw
--with-system-zlib=/opt/csw --with-as=/usr/ccs/bin/as --without-gnu-as
Thread model: posix gcc version 4.8.0 (GCC) COLLECT_GCC_OPTIONS='-o' 'foo'
'-v' '-fPIE' '-pie' '-mcpu=v9'
 /opt/csw/libexec/gcc/sparc-sun-solaris2.10/4.8.0/cc1 -quiet -v -D__sparcv8
foo.c -quiet -dumpbase foo.c -mcpu=v9 -auxbase foo -version -fPIE -o
/var/tmp//ccgrqHnr.s GNU C (GCC) version 4.8.0 (sparc-sun-solaris2.10)
	compiled by GNU C version 4.8.0, GMP version 5.0.4, MPFR version
3.1.0, MPC version 0.9 GGC heuristics: --param ggc-min-expand=65 --param
ggc-min-heapsize=65536 ignoring nonexistent directory
"/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/../../../../sparc-sun-solaris2
.10/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/include
 /usr/local/include
 /opt/csw/include
 /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/include-fixed
 /usr/include
End of search list.
GNU C (GCC) version 4.8.0 (sparc-sun-solaris2.10)
	compiled by GNU C version 4.8.0, GMP version 5.0.4, MPFR version
3.1.0, MPC version 0.9 GGC heuristics: --param ggc-min-expand=65 --param
ggc-min-heapsize=65536 Compiler executable checksum:
cb9af0f869f3e77ef4252af61c1b76ac COLLECT_GCC_OPTIONS='-o' 'foo' '-v' '-fPIE'
'-pie' '-mcpu=v9'
 /usr/ccs/bin/as -V -Qy -s -xarch=v8plus -K PIC -o /var/tmp//cc0UQn2V.o
/var/tmp//ccgrqHnr.s
/usr/ccs/bin/as: Sun Compiler Common 10 Patch 09/04/2007
COMPILER_PATH=/opt/csw/libexec/gcc/sparc-sun-solaris2.10/4.8.0/:/opt/csw/lib
exec/gcc/sparc-sun-solaris2.10/4.8.0/:/opt/csw/libexec/gcc/sparc-sun-solaris
2.10/:/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/:/opt/csw/lib/gcc/sparc-s
un-solaris2.10/:/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/../../../../spa
rc-sun-solaris2.10/bin/:/usr/ccs/bin/
LIBRARY_PATH=/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/:/opt/csw/lib/gcc/
sparc-sun-solaris2.10/4.8.0/../../../../sparc-sun-solaris2.10/lib/:/usr/ccs/
lib/:/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'foo' '-v' '-fPIE' '-pie' '-mcpu=v9'
 /usr/ccs/bin/ld -V -Y P,/usr/ccs/lib:/lib:/usr/lib -Qy -o foo
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/crt1.o /usr/lib/crti.o
/usr/ccs/lib/values-Xa.o
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/crtbegin.o
-L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0
-L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/../../../../sparc-sun-solaris
2.10/lib -L/usr/ccs/lib
-L/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/../../.. /var/tmp//cc0UQn2V.o
-lgcc -lgcc_eh -lc -R /opt/csw/lib -lgcc -lgcc_eh -lc -R /opt/csw/lib
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.8.0/crtend.o /usr/lib/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.1514



More information about the sudo-users mailing list