Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38744 - sys-apps/modutils fails with -fPIC
Summary: sys-apps/modutils fails with -fPIC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-19 12:06 UTC by John Davis (zhen) (RETIRED)
Modified: 2004-01-20 02:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Davis (zhen) (RETIRED) gentoo-dev 2004-01-19 12:06:57 UTC
sys_oim.c: In function `old_sys_init_module':
sys_oim.c:38: can't find a register in class `BREG' while reloading `asm'
make[1]: *** [sys_oim.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/modutils-2.4.25/work/modutils-2.4.25/util'
make: *** [all] Error 2

That is the error - looks like some filter flags magic needs to be added.
Comment 1 solar (RETIRED) gentoo-dev 2004-01-19 12:43:20 UTC
zhen,
I've taken a fresh set of hardened stages and have beat myself silly.

Can you tell me if you also see this when building?

patching file alias.h
>>> Source unpacked.
/usr/sbin/ebuild.sh: line 261: [: is-flag: unary operator expected
Comment 2 solar (RETIRED) gentoo-dev 2004-01-19 15:37:43 UTC
Very strange behavior out of "stable" tree.

Anyway can you try this.

Index: flag-o-matic.eclass
===================================================================
RCS file: /home/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v
retrieving revision 1.34
diff -u -b -B -w -p -r1.34 flag-o-matic.eclass
--- flag-o-matic.eclass	14 Jan 2004 20:32:41 -0000	1.34
+++ flag-o-matic.eclass	19 Jan 2004 23:33:01 -0000
@@ -257,21 +257,23 @@ append-ldflags() {
 }
 
 etexec-flags() {
-	has_version 'sys-devel/hardened-gcc' && {
-		if [ ! is-flag -yet_exec ]; then
+	has_version sys-devel/hardened-gcc
+	if [ $? == 0 ]; then                
+		if [ "`is-flag -yet_exec`" != "true" ]; then
 			debug-print ">>> appending flags -yet_exec"
 			append-flags -yet_exec
 			append-ldflags -yet_exec
 		fi
-	}
+	fi
 }
 
 fstack-flags() {
-	has_version 'sys-devel/hardened-gcc' && {
-		if [ ! is-flag -yno_propolice ]; then
+	has_version sys-devel/hardened-gcc
+	if [ $? == 0 ]; then
+		if [ "`is-flag -yno_propolice`" != "true" ]; then
 			debug-print ">>> appending flags -yno_propolice"
 			append-flags -yno_propolice
 			append-ldflags -yno_propolice
 		fi
-	}
+	fi
 }
Comment 3 solar (RETIRED) gentoo-dev 2004-01-19 16:37:17 UTC
I will commit this to cvs as soon as I get word back from you that it works.
Comment 4 Antony Suter 2004-01-20 02:32:43 UTC
I had the following error while doing "emerge =sys-fs/raidtools-1.00.3-r1":-

...
gcc -march=athlon-xp -O2 -fomit-frame-pointer -ffast-math -pipe -fstack-protector -DMD_VERSION=\"raidtools-1.00.3\" -c -o raid_io.o raid_io.c
raid_io.c: In function `_llseek':
raid_io.c:96: error: can't find a register in class `BREG' while reloading `asm'
make: *** [raid_io.o] Error 1
make: *** Waiting for unfinished jobs....
 
!!! ERROR: sys-fs/raidtools-1.00.3-r1 failed.
!!! Function src_compile, Line 29, Exitcode 2
!!! (no error message)

After I applied the patch given by solar, the emerge completed successfully.
Comment 5 solar (RETIRED) gentoo-dev 2004-01-20 02:38:48 UTC
Ok good.. I'll commited it to portage. The new revision is 1.35

Note: 
I think this will fix an array of problems when filtering -fPIC, -fpic, -fPIE, -fpie, -fstack-protector and -fstack-protector-all in the stable tree.

What really seems odd is this exact same syntax worked previously. My guess is that perhaps a compile time bash option has changed. I'm using app-shells/bash-2.05b-r7 -build +nls

Comment 6 solar (RETIRED) gentoo-dev 2004-01-20 02:49:28 UTC
Re: comment #5 Note: In the last 6 days.