Problem compiling (gcc? glibc?)
Hi
I have recently started using Debian GNU / Linux, and have found that I am
unable to compile anything with GCC. Compiling even a trivial program gives a
number of 'undefined reference' errors:
$ cat test.c
int main() {
return 0;
}
$ gcc test.c
/lib/libc.so.6: undefined reference to
`_dl_lookup_versioned_symbol_skip@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to
`_dl_lookup_versioned_symbol@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_start_profile@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_check_map_versions@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `__libc_enable_secure@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_get_origin@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_dst_substitute@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_debug_state@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_init@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_dst_count@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_signal_error@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_debug_printf@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_map_object_deps@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_unload_cache@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_relocate_object@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_tls_symaddr@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `__libc_stack_end@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_catch_error@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_lookup_symbol_skip@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_lookup_symbol@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_dl_map_object@GLIBC_PRIVATE'
collect2: ld returned 1 exit status
Compiling with the -static flag succeeds without errors, but this is not
really a solution.
I am using the latest packages from the 'testing' section, including gcc
3.3.5-5 and glibc 2.3.2.ds1-20, on a Pentium II.
I found some similar reports in the mailing list archives and debian bug
databases, but they were either specific to other architectures or marked as
fixed by newer versions.
I noticed that these errors refer to /lib/libc.so.6, whereas
'ldd /bin/echo' (for example) reports linking against /lib/tls/libc.so.6. I
am not sure if this is relevant; what is the difference between the two
libraries?
What could be going wrong here, and what can I do to fix it?
Andrew Walbran
Reply to: