Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40634 - devfsd-1.3.25-r5 BREG with -fPIC
Summary: devfsd-1.3.25-r5 BREG with -fPIC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-06 12:55 UTC by Scott Taylor (RETIRED)
Modified: 2004-02-13 00:26 UTC (History)
0 users

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


Attachments
devfsd-1.3.25-r5.ebuild.diff (devfsd-1.3.25-r5.ebuild.diff,832 bytes, patch)
2004-02-06 13:17 UTC, solar (RETIRED)
Details | Diff
devfsd-1.3.25-pic.patch (devfsd-1.3.25-pic.patch,529 bytes, patch)
2004-02-06 13:52 UTC, solar (RETIRED)
Details | Diff
devfsd-1.3.25-r5.ebuild.diff (devfsd-1.3.25-r5.ebuild.diff,753 bytes, patch)
2004-02-06 13:53 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Taylor (RETIRED) gentoo-dev 2004-02-06 12:55:54 UTC
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)
Comment 1 solar (RETIRED) gentoo-dev 2004-02-06 13:17:34 UTC
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
Comment 2 solar (RETIRED) gentoo-dev 2004-02-06 13:26:23 UTC
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 3 Scott Taylor (RETIRED) gentoo-dev 2004-02-06 13:47:07 UTC
comment 1 works at least
Comment 4 solar (RETIRED) gentoo-dev 2004-02-06 13:52:06 UTC
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
Comment 5 solar (RETIRED) gentoo-dev 2004-02-06 13:53:13 UTC
Created attachment 25105 [details, diff]
devfsd-1.3.25-r5.ebuild.diff
Comment 6 solar (RETIRED) gentoo-dev 2004-02-06 14:03:49 UTC
Note this should work for all arches.
Comment 7 Scott Taylor (RETIRED) gentoo-dev 2004-02-06 20:16:39 UTC
pic patch seems to have done the trick too.
Comment 8 solar (RETIRED) gentoo-dev 2004-02-07 04:36:02 UTC
cool.. I'll -r6 this in about 3-4 cups of coffee from now
Comment 9 solar (RETIRED) gentoo-dev 2004-02-08 01:05:01 UTC
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.

Comment 10 solar (RETIRED) gentoo-dev 2004-02-13 00:26:05 UTC
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