This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Undefined Reference to dl_iterate_phdr from libgcc_eh.a


Hi,

When I try to build a program statically, I get the following ld
error: libgcc_eh.a(unwind-dw2-fde-glibc.o): In function
`_Unwind_Find_FDE':
(.text+0x1a20): undefined reference to `dl_iterate_phdr'

Any guidance about why this is happening and how to fix this will be
highly appreciated!

The build command:
/usr/bin/g++ -O3 -funroll-loops -fprefetch-loop-arrays -fpermissive
-fno-exceptions -static-libgcc
-Wl,--hash-style=both,--as-needed,-static  -pthread -DENABLE_THREADS
-DN=960 -DNCO=4   test.cpp -L/usr/lib64 -L/usr/lib -o test

output of g++ -v:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)

I am using ubuntu 8.04 with 2.6.24-19-server kernel version.

Interestingly if I use '-static' instead of '-Wl,static' the program
compiles and I get a static binary. This is also puzzling to me, and
sadly I am not very familiar with the details of the compile and link process.

Thank you!
-- 
Abhisek
Live Long and Prosper


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]