I'm very motivated and a bit technically adept, so anything I can do to
help resolve this--I'm your guy. After building gcc from trunk and
installing under /usr/local, some apps won't run. An example of this is
firefox. When I try to run it, dynamically linking against the libs in
/usr/local/lib:
/usr/lib/firefox-3.5.7pre/firefox: error while loading shared libraries:
libstdc++.so.6: failed to map segment from shared object: Permission denied
strace shows us:
open("/usr/local/lib/libstdc++.so.6", O_RDONLY) = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\37\4\0004\0\0\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=4419480, ...}) = 0
mmap2(NULL, 939000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = -1 EACCES (Permission denied)
close(3) = 0
and the man page for mmap tells us that EACCES means:
EACCES A file descriptor refers to a non-regular file. Or
MAP_PRIVATE
was requested, but fd is not open for reading. Or
MAP_SHARED
was requested and PROT_WRITE is set, but fd is not
open in
read/write (O_RDWR) mode. Or PROT_WRITE is set, but the
file is
append-only.
fd is open for reading, MAP_SHARED not requested, and PROT_WRITE not
requested, which only leaves A file descriptor refers to a non-regular file.
patrick@dell$ ls -l /usr/local/lib/libstdc++.so.6
lrwxrwxrwx 1 patrick patrick 19 2009-12-25 15:48
/usr/local/lib/libstdc++.so.6 -> libstdc++.so.6.0.14*
ls -l /usr/local/lib/libstdc++.so.6.0.14
-rwxr-xr-x 1 patrick patrick 4419480 2009-12-25 15:48
/usr/local/lib/libstdc++.so.6.0.14*
Making it a hard link instead of a soft link doesn't help.
hexdump -C libstdc++.so.6 | head
00000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
|.ELF............|
00000010 03 00 03 00 01 00 00 00 80 1f 04 00 34 00 00 00
|............4...|
00000020 80 3a 3f 00 00 00 00 00 34 00 20 00 07 00 28 00 |.:?.....4.
....(.|
00000030 29 00 26 00 01 00 00 00 00 00 00 00 00 00 00 00
|).&.............|
00000040 00 00 00 00 08 94 0d 00 08 94 0d 00 05 00 00 00
|................|
00000050 00 10 00 00 01 00 00 00 48 95 0d 00 48 a5 0d 00
|........H...H...|
00000060 48 a5 0d 00 e8 45 00 00 b0 ae 00 00 06 00 00 00
|H....E..........|
00000070 00 10 00 00 02 00 00 00 78 c9 0d 00 78 d9 0d 00
|........x...x...|
00000080 78 d9 0d 00 f0 00 00 00 f0 00 00 00 06 00 00 00
|x...............|
00000090 04 00 00 00 07 00 00 00 48 95 0d 00 48 a5 0d 00
|........H...H...|
If I remove /usr/local/libstdc++* then I have the same problem with
libgcc* -- removing libgcc* allows everything to start working again.
Please let me know if I need to send this to some other list, (is there
a toolcom list?)
Patrick