glibc build with gcov support

Tatiana Udalova t.udalova@samsung.com
Tue Nov 19 06:54:00 GMT 2013


Hi!

Could you advise the right way to build Glibc2.17 with gcov coverage testing
support?

I couldn't find any working solution on how to do it.

I was trying to add extra CFLAGS="--coverage" (or CFLAGS="-fprofile-arcs
-ftest-coverage") for glibc configuration and build.
The following configuration error occur:
./configure --prefix=/usr --host=arm-none-linux-gnueabi
--enable-add-ons=ports,nptl --without-fp ...
checking whether to put _rtld_local into .sdata section... no checking for
.preinit_array/.init_array/.fini_array support... no
configure: error: Need linker with .init_array/.fini_array support.

Hence I can successfully build Glibc without mentioned CFLAGS.

The second solution I've tried was configuring Glibc without extra CFLAGS
and adding these CFLAGS on make stage only.
Make stage failed with the following error:

arm-none-linux-gnueabi-gcc   -nostdlib -nostartfiles -r -o
/home/t.udalova/glibc-build/elf/librtld.map.o '-Wl,-('
/home/t.udalova/glibc-build/elf/dl-allobjs.os
/home/t.udalova/glibc-build/libc_pic.a -lgcc '-Wl,-)'
-Wl,-Map,/home/t.udalova/glibc-build/elf/librtld.mapT
/home/t.udalova/glibc-build/libc_pic.a(dl-addr.os): In function
`_GLOBAL__sub_I_65535_0_dl_addr.c':
/home/t.udalova/sources/glibc/libc/elf/dl-addr.c:155: multiple definition of
`_dl_addr_inside_object'
/home/t.udalova/glibc-build/elf/dl-allobjs.os:/home/t.udalova/fox-p/vd47_a15
/toolchain/build/sources/glibc/libc/elf/dl-open.c:755: first defined here
/home/t.udalova/glibc-build/libc_pic.a(init-first.os):(.data+0x0): multiple
definition of `__libc_multiple_libcs'
/home/t.udalova/glibc-build/elf/dl-allobjs.os:/home/t.udalova/fox-p/vd47_a15
/toolchain/build/sources/glibc/libc/elf/rtld.c:2160: first defined here
/home/t.udalova/glibc-build/libc_pic.a(_itoa.os): In function `_itoa':
/home/t.udalova/sources/glibc/libc/stdio-common/_itoa.c:199: multiple
definition of `_itoa'
/home/t.udalova/glibc-build/elf/dl-allobjs.os:/home/t.udalova/sources/glibc/
libc/elf/dl-minimal.c:317: first defined here
collect2: error: ld returned 1 exit status

There are no --enable-coverage or --enable-gcov options for Glibc
configuration.

Tatiana





More information about the Libc-help mailing list