3
votes

On building Glibc on my toolchain . The libraries make succesfully (and test ok) all FLAGS unset except for those specified for building default glibc. then i start building the programs both with and without FLAGS on seperate fresh build attempts and every time something in the iconv folder always breaks...

I'll diverge for a second to moan how its always iconv that breaks in GLibc for me and always has done for as long as i can remember... moving on though....

When gcc-4.8.0 is passed gcc -nostdlib -nostartfiles -o /glibc-build/iconv/iconvconfig -Wl,-dynamic-linker=/tools/lib/ld-linux-x86-64.so.2 -Wl,--hash-style=both -Wl,--warn-shared-textrel,--fatal-warnings /glibc-build/csu/Scrt1.o /glibc-build/csu/crti.o gcc --print-file-name=crtbeginS.o /glibc-build/iconv/iconvconfig.o /glibc-build/iconv/strtab.o /glibc-build/iconv/xmalloc.o /glibc-build/iconv/hash-string.o -Wl,-rpath-link=/glibc-build:/glibc-build/math:/glibc-build/elf:/glibc-build/dlfcn:/glibc-build/nss:/glibc-build/nis:/glibc-build/rt:/glibc-build/resolv:/glibc-build/crypt:/glibc-build/nptl /glibc-build/libc.so.6 /glibc-build/libc_nonshared.a -Wl,--as-needed /glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc gcc --print-file-name=crtendS.o /glibc-build/csu/crtn.o gcc -nostdlib -nostartfiles -o /glibc-build/iconv/iconv_prog -Wl,-dynamic-linker=/tools/lib/ld-linux-x86-64.so.2 -Wl,--hash-style=both -Wl,--warn-shared-textrel,--fatal-warnings /mnt/lfs/glibc-build/csu/Scrt1.o /glibc-build/csu/crti.o gcc --print-file-name=crtbeginS.o /glibc-build/iconv/iconv_prog.o /glibc-build/iconv/iconv_charmap.o /glibc-build/iconv/charmap.o /glibc-build/iconv/charmap-dir.o /glibc-build/iconv/linereader.o /glibc-build/iconv/dummy-repertoire.o /glibc-build/iconv/simple-hash.o /glibc-build/iconv/xstrdup.o /glibc-build/iconv/xmalloc.o -Wl,-rpath-link=/glibc-build:/glibc-build/math:/glibc-build/elf:/glibc-build/dlfcn:/glibc-build/nss:/glibc-build/nis:/glibc-build/rt:/glibc-build/resolv:/glibc-build/crypt:/glibc-build/nptl /glibc-build/libc.so.6 /glibc-build/libc_nonshared.a -Wl,--as-needed /glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc gcc --print-file-name=crtendS.o /glibc-build/csu/crtn.o

i get 2 pages of referencing issues

/glibc-build/iconv/iconvconfig.o: In function more_help': iconvconfig.c:(.text+0x12e): undefined reference to__tsan_func_entry' iconvconfig.c:(.text+0x136): undefined reference to __tsan_write8' iconvconfig.c:(.text+0x150): undefined reference to__tsan_func_exit' iconvconfig.c:(.text+0x1cc): undefined reference to __tsan_read8' /glibc-build/iconv/iconvconfig.o: In functionalias_compare': iconvconfig.c:(.text+0x226): undefined reference to __tsan_func_entry' iconvconfig.c:(.text+0x233): undefined reference to__tsan_read1' iconvconfig.c:(.text+0x246): undefined reference to __tsan_read8' iconvconfig.c:(.text+0x25d): undefined reference to__tsan_read1' iconvconfig.c:(.text+0x26e): undefined reference to __tsan_read8' iconvconfig.c:(.text+0x282): undefined reference to__tsan_func_exit' iconvconfig.c:(.text+0x2b4): undefined reference to __asan_report_load8' iconvconfig.c:(.text+0x2b9): undefined reference to__asan_report_load8' /glibc-build/iconv/iconvconfig.o: In function module_compare': iconvconfig.c:(.text+0x2fb): undefined reference to__tsan_func_entry' iconvconfig.c:(.text+0x308): undefined reference to __tsan_read1' iconvconfig.c:(.text+0x326): undefined reference to__tsan_read8' iconvconfig.c:(.text+0x337): undefined reference to __tsan_read1' iconvconfig.c:(.text+0x34a): undefined reference to__tsan_read8' iconvconfig.c:(.text+0x36f): undefined reference to __tsan_func_exit' iconvconfig.c:(.text+0x3a6): undefined reference to__asan_report_load8' iconvconfig.c:(.text+0x3ab): undefined reference to __asan_report_load8' /glibc-build/iconv/iconvconfig.o: In functionname_compare':

after 2 weeks of trying to get it to compile every which way possible im getting a bit fed up. Any ideas please?

Emma

1

1 Answers

1
votes

A bit late, but hopefully useful.

The symbols with tsan and asan in their name are related to the address sanitizer project that provides LLVM clang and gcc with tools to detect and report a whole range of problems related to illegal memory access.

To use them you have to install tools and libraries, use the correct versions of the compilers and the correct combinations of flags during compile and linking depending on your version.

In my experience the documentation is only so useful, and the topic is pretty advanced. In my project over which I have full control, I ended up disabling all but the one commandline parameter -fsanitize=address together with the recommended -fno-omit-frame-pointer for both compile and link (gcc 4.8 on x64 ubuntu 14.04LTS).

Since you are attempting to build an existing project, you are at the mercy of their settings. I would look at docs for that project and try to determine the recommended versions of compiler and sanitizer tools from there, or maybe some configuration options to disable it if you don't care.