I have extensive optimizations, but for this failure, I changed my CFLAGS to the following and only the following to assure that it was -fPIC -fstack-protector and -pie doing this: CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -fPIC -fstack-protector" LDFLAGS="-pie" gpm dies with the following error: gcc -I/var/tmp/portage/gpm-1.20.1/work/gpm-1.20.1/src -DHAVE_CONFIG_H -include headers/config.h -Wall -DSYSCONFDIR="\"/etc/gpm\"" -DSBINDIR="\"/usr/sbin\"" -march=athlon-xp -Os -pipe -fomit-frame-pointer -fstack-protector -fPIC -march=athlon-xp -Os -pipe -fomit-frame-pointer -fstack-protector -fPIC -c -o prog/mev.o prog/mev.c gcc -L/var/tmp/portage/gpm-1.20.1/work/gpm-1.20.1/src -pie -o prog/mev prog/mev.o lib/libgpm.so prog/mev.o(.text+0x47): In function `user_handler': : undefined reference to `Gpm_FitValuesM' prog/mev.o(.text+0x173): In function `emacs_handler': : undefined reference to `Gpm_FitValuesM' prog/mev.o(.text+0x6c3): In function `do_snapshot': : undefined reference to `Gpm_GetSnapshot' prog/mev.o(.text+0x745): In function `do_snapshot': : undefined reference to `Gpm_GetLibVersion' prog/mev.o(.text+0x75e): In function `do_snapshot': : undefined reference to `Gpm_GetServerVersion' prog/mev.o(.text+0x87f): In function `interact': : undefined reference to `Gpm_Close' prog/mev.o(.text+0x994): In function `interact': : undefined reference to `Gpm_Open' prog/mev.o(.text+0xa89): In function `main': : undefined reference to `Gpm_Open' prog/mev.o(.text+0xaaa): In function `main': : undefined reference to `gpm_report' prog/mev.o(.text+0xad8): In function `main': : undefined reference to `gpm_report' prog/mev.o(.text+0xaf5): In function `main': : undefined reference to `gpm_report' prog/mev.o(.text+0xbf5): In function `main': : undefined reference to `Gpm_GetEvent' collect2: ld returned 1 exit status make[1]: *** [prog/mev] Error 1 rm prog/mev.o make[1]: Leaving directory `/data/sysdirs/var/tmp/portage/gpm-1.20.1/work/gpm-1.20.1/src' make: *** [do-all] Error 1 !!! ERROR: sys-libs/gpm-1.20.1 failed. !!! Function src_compile, Line 56, Exitcode 2 !!! (no error message) It works without the LDFLAGS="-pie", even with my full optimization set. Portage 2.0.50-r6 (hardened-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.4-grsec) ================================================================= System uname: 2.6.4-grsec i686 AMD Athlon(tm) Processor Gentoo Base System version 1.4.9 distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -fstack-protector -fPIC -fforce-addr -fmove-all-movables -ftracer -freorder-blocks -falign-loops -frename-registers" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -fstack-protector -fPIC -fforce-addr -fmove-all-movables -ftracer -freorder-blocks -falign-loops -frename-registers" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs buildpkg ccache sandbox sfperms strict" GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/bmggnome" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="3ds X aalib alsa avi berkdb cdr composite crypt cups dri dvd flac gif gimpprint gnome gpm gstreamer gtk gtk2 gtkhtml hardened imlib java jbig jpeg justify lcms ldap mad mikmod mmap mng mozilla mpeg nls nptl offensive oggvorbis openal opengl pam perl pic pie png ppds python qt quicktime readline samba sdl speex spell ssl svga tcltk theora tiff truetype videos wmf x86 xml xml2 xmms xv zlib" (as well as LDFLAGS="-pie", not shown by einfo)
[ebuild R ] sys-libs/gpm-1.20.1 -(selinux) 0 kB Try relaxing off the CFLAGS some and/or try with USE=hardened gcc-3.3.3-r2 I used 3.3.3-r2 and my gpm works like a charm. /usr/sbin/gpm: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
solar: I have extensive optimizations, but for this failure, I changed my CFLAGS to the following and only the following to assure that it was -fPIC -fstack-protector and -pie doing this: CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -fPIC -fstack-protector" LDFLAGS="-pie" I did relax the cflags to test. I'll try the new gcc.
Can this bug be closed now?
Yes, he confirmed to me that the problem was no longer present.
Sounds like this is FIXED then