FS#20337 - [glibc] Cannot compile static libraries with glibc-2.12
Attached to Project:
Arch Linux
Opened by Alexander Dunlap (ajd) - Sunday, 01 August 2010, 23:31 GMT
Last edited by Allan McRae (Allan) - Saturday, 11 September 2010, 04:56 GMT
Opened by Alexander Dunlap (ajd) - Sunday, 01 August 2010, 23:31 GMT
Last edited by Allan McRae (Allan) - Saturday, 11 September 2010, 04:56 GMT
|
Details
When I try to compile a program statically with glibc-2.12
installed, I get the following error when I run the compiled
program:
../sysdeps/unix/sysv/linux/ia64/getpagesize.c:35: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed. This does not happen with glibc-2.11. However, it makes it impossible to compile statically-linked applications. |
This task depends upon
Closed by Allan McRae (Allan)
Saturday, 11 September 2010, 04:56 GMT
Reason for closing: Upstream
Additional comments about closing: Waiting on upstream response.
Saturday, 11 September 2010, 04:56 GMT
Reason for closing: Upstream
Additional comments about closing: Waiting on upstream response.
> gcc -o hello -static hello.c
allan@mugen ~/tmp/hello
> readelf -d hello
There is no dynamic section in this file.
allan@mugen ~/tmp/hello
> ./hello
hello, world
That looks fine... can you please provide an example that fails so that I can investigate further?
$ cat Hello.hs
module Main
where
main = print "hello, world!"
$ ghc --make Hello.hs -optl-static -static -fforce-recomp -optl-pthread
[1 of 1] Compiling Main ( Hello.hs, Hello.o )
Linking Hello ...
$ ./Hello
Hello: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
Aborted
Note that I am running a custom kernel, machine is an AMD Athlon 64 X2 / 4GB with PAE.
[djgera@gerardo ~]$ cat x.c
#include <sys/types.h>
#include <pwd.h>
int main() {
getpwnam("root");
return 0;
}
[djgera@gerardo ~]$ gcc x.c -static -o x
/tmp/ccKJt0lB.o: In function `main':
x.c:(.text+0x11): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
[djgera@gerardo ~]$ ./x
x: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
Aborted
[djgera@gerardo ~]$
$ ./x
x: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
Aborted
> sudo /etc/rc.d/nscd start
Password:
:: Starting nscd [DONE]
allan@mugen ~/tmp/static
> ./test
allan@mugen ~/tmp/static
> sudo /etc/rc.d/nscd stop
:: Stopping nscd [DONE]
allan@mugen ~/tmp/static
> ./test
test: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
Aborted
Hmmm...
http://sourceware.org/bugzilla/show_bug.cgi?id=11929
Waiting on a glibc dev to comment...
http://bugs.gentoo.org/332927