Even filter-flags -fPIC didn't have anyy effect. CC="${CC} -yet_exec" did however work. Green root # emerge --resume *** Resuming merge... >>> emerge (1 of 529) sys-fs/devfsd-1.3.25-r5 to / >>> md5 src_uri ;-) devfsd-v1.3.25.tar.gz >>> Unpacking source... >>> Unpacking devfsd-v1.3.25.tar.gz to /var/tmp/portage/devfsd-1.3.25-r5/work * Applying devfsd-1.3.25-kernel-2.5.patch... [ ok ]>>> Source unpacked. gcc -march=athlon -O2 -I. -I/usr/src/linux/include -Wall -DLIBNSL="\"/lib/libnsl.so.1\"" -c -o devfsd.o devfsd.c gcc -march=athlon -O2 -I. -I/usr/src/linux/include -Wall -DLIBNSL="\"/lib/libnsl.so.1\"" -c -o expression.o expression.c gcc -march=athlon -O2 -I. -I/usr/src/linux/include -Wall -DLIBNSL="\"/lib/libnsl.so.1\"" -c -o compat_name.o compat_name.c gcc -fomit-frame-pointer -march=athlon -O2 -c check_kernel.c check_kernel.c: In function `create_module': check_kernel.c:11: error: can't find a register in class `BREG' while reloading `asm' make: *** [check_kernel.o] Error 1 !!! ERROR: sys-fs/devfsd-1.3.25-r5 failed. !!! Function src_compile, Line 38, Exitcode 2 !!! (no error message)
Created attachment 25099 [details, diff] devfsd-1.3.25-r5.ebuild.diff verified working on i686 Please test. ebuild devfsd-1.3.25-r5.ebuild clean unpack compile >>> md5 src_uri ;-) devfsd-v1.3.25.tar.gz >>> Unpacking source... >>> Unpacking devfsd-v1.3.25.tar.gz to /var/tmp/portage/devfsd-1.3.25-r5/work * Applying devfsd-1.3.25-kernel-2.5.patch... [ ok ]>>> Source unpacked. >>> md5 src_uri ;-) devfsd-v1.3.25.tar.gz gcc -march=i686 -O3 -pipe -mcpu=pentium4 -fforce-addr -yet_exec -I. -I/usr/src/linux/include -Wall -DLIBNSL="\"/lib/libnsl.so.1\"" -c -o devfsd.o devfsd.c gcc -march=i686 -O3 -pipe -mcpu=pentium4 -fforce-addr -yet_exec -I. -I/usr/src/linux/include -Wall -DLIBNSL="\"/lib/libnsl.so.1\"" -c -o expression.o expression.c gcc -march=i686 -O3 -pipe -mcpu=pentium4 -fforce-addr -yet_exec -I. -I/usr/src/linux/include -Wall -DLIBNSL="\"/lib/libnsl.so.1\"" -c -o compat_name.o compat_name.c gcc -fomit-frame-pointer -march=i686 -O3 -pipe -mcpu=pentium4 -fforce-addr -yet_exec -c check_kernel.c gcc -march=i686 -O3 -pipe -mcpu=pentium4 -fforce-addr -yet_exec -o devfsd devfsd.o expression.o compat_name.o check_kernel.o -yet_exec -export-dynamic -ldl
This actually should be pretty easy to fix to make it PIC aware.. Looks like it's just a standard _sysctl2() define.. #ifndef __ia64 /* breaks ia64. */ static _syscall2(long, create_module, const char *, name, size_t, size); #else #define create_module(name, size) \ syscall(__NR_create_module, (name), (size)) #endif
comment 1 works at least
Created attachment 25104 [details, diff] devfsd-1.3.25-pic.patch Remove backwords compat stuff that was ignorantly take from mode-init-tools. This allows us to build devsfd with PIC/PIE
Created attachment 25105 [details, diff] devfsd-1.3.25-r5.ebuild.diff
Note this should work for all arches.
pic patch seems to have done the trick too.
cool.. I'll -r6 this in about 3-4 cups of coffee from now
glibc is not playing along for me when I do a repoman --pretend scan thus blocking me from commiting at this time. I'm getting conflicts from ppc64. If I did merge it I would have fudge a little and I would rather not. I dont know if this a bug or feature so I'm going to try to get some input here.
in portage as ~arch # file `which devfsd` /sbin/devfsd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), stripped CFLAGS="-fPIC" LDFLAGS="-pie" ACCEPT_KEYWORDS="~x86" emerge devfsd # file `which devfsd` /sbin/devfsd: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped