undefined reference to `__gcov_init' when using FLAGS+='-fprofile-arcs -ftest-coverage'

John Smith lbalbalba at gmail.com
Wed Dec 12 04:53:48 PST 2012


On Wed, Dec 12, 2012 at 12:28 PM, Michael Stahl <mstahl at redhat.com> wrote:
>
> but apparently LDFLAGS don't
>
> hmmm... you could try editing these and adding your options there:
>
> solenv/inc/unxgcc.mk:LINKFLAGSSHLGUI= -shared
> solenv/inc/unxgcc.mk:LINKFLAGSSHLCUI= -shared
>
This works, by the way, for setup_native. But even after editing those
files the same behavior (LDFLAGS not set) appears when building odk.
And I cant seem to be able to figure out what makefile to hack to fix
it. Of course I can just do './configure --disable-odk'...








# LDFLAGS+='-fprofile-arcs' CFLAGS+='-fprofile-arcs -ftest-coverage'
CXXFLAGS+='-fprofile-arcs -ftest-coverage' CPPFLAGS+='-fprofile-arcs
-ftest-coverage' make odk VERBOSE=t
make -r -f /usr/local/src/libreoffice/Makefile.top odk
make[1]: Entering directory `/usr/local/src/libreoffice'
cd odk && unset MAKEFLAGS &&
/usr/local/src/libreoffice/solenv/bin/build.pl -P2 -- -P2


=============
(1/1) Building module odk
=============
Entering /usr/local/src/libreoffice/odk/inc

Entering /usr/local/src/libreoffice/odk/pack/unzip_udk

Entering /usr/local/src/libreoffice/odk/source/unowinreg/win

Entering /usr/local/src/libreoffice/odk/source/com/sun/star/lib/loader

/bin/cp /usr/local/src/libreoffice/src/185d60944ea767075d27247c3162b3bc-unowinreg.dll
../../../unxlngi6.pro/bin/unowinreg.dll
Entering /usr/local/src/libreoffice/odk/source/unoapploader/unx

Making:    com_sun_star_lib_loader.dpj

rm -f ../../../../../../unxlngi6.pro/misc/com_sun_star_lib_loader_dummy.java
rm -f ../../../../../../unxlngi6.pro/misc/com_sun_star_lib_loader_dummy.java
Compiling: odk/source/unoapploader/unx/unoapploader.c
rm -f ../../../../../../unxlngi6.pro/misc/com_sun_star_lib_loader_dummy.java
gcc -fprofile-arcs -ftest-coverage  -fmessage-length=0 -c -Os   -I.
-I../../../unxlngi6.pro/inc/unoapploader -I../inc -I../../../inc
-I../../../unx/inc -I../../../unxlngi6.pro/inc -I.
-I/usr/local/src/libreoffice/solver/unxlngi6.pro/inc/external
-I/usr/local/src/libreoffice/solver/unxlngi6.pro/inc
-I/usr/local/src/libreoffice/solenv/inc
-I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.5/include
-I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.5/include/linux
-I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.5/include/native_threads/include
 -I/usr/local/src/libreoffice/solver/unxlngi6.pro/inc/udkapi
-I/usr/local/src/libreoffice/solver/unxlngi6.pro/inc/offapi
-I/usr/local/src/libreoffice/solver/unxlngi6.pro/inc/oovbaapi -I.
-I../../../res -I. -pipe -mtune=pentiumpro -fprofile-arcs
-ftest-coverage  -fmessage-length=0 -c -Os   -Wall -Wextra
-Wendif-labels -Wdeclaration-after-statement  -DLINUX -DUNX -DGCC
-DINTEL -DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR
-D_USE_NAMESPACE=1 -DHAVE_GCC_VISIBILITY_FEATURE -DX86 -D__DMAKE
-DUNIX -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=/usr/include/c++/4.7.2
-DSUPD=410 -DPRODUCT -DNDEBUG -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE
-DHAVE_THREADSAFE_STATICS -DRTL_USING -DSOLAR_JAVA      -o
../../../unxlngi6.pro/obj/unoapploader.o unoapploader.c
: &&     LD_LIBRARY_PATH=/usr/local/src/libreoffice/solver/unxlngi6.pro/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
/usr/local/src/libreoffice/solver/unxlngi6.pro/bin/makedepend
@/tmp/mkfV0F2B > ../../../unxlngi6.pro/misc/o_unoapploader.dpcc
rm -f ../../../../../../unxlngi6.pro/misc/com_sun_star_lib_loader_dummy.java
/bin/javac -source 1.5 -target 1.5 -classpath
".:../../../../../../unxlngi6.pro/class:" -d
../../../../../../unxlngi6.pro/class  @/tmp/mkIqMQRk
Making:    unoapploader
gcc -Wl,-z,noexecstack -Wl,-z,combreloc -Wl,-z,defs
-Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new
-Wl,--dynamic-list-cpp-typeinfo -Wl,--hash-style=gnu
-Wl,-export-dynamic
-Wl,-rpath-link,../../../unxlngi6.pro/lib:/usr/local/src/libreoffice/solver/unxlngi6.pro/lib:/lib:/usr/lib
-L../../../unxlngi6.pro/lib -L../lib
-L/usr/local/src/libreoffice/solenv/unxlngi6/lib
-L/usr/local/src/libreoffice/solver/unxlngi6.pro/lib
-L/usr/local/src/libreoffice/solenv/unxlngi6/lib
../../../unxlngi6.pro/obj/unoapploader.o \
-lfindsofficepath -ldl -o ../../../unxlngi6.pro/bin/unoapploader
../../../unxlngi6.pro/obj/unoapploader.o:(.data+0x14): undefined
reference to `__gcov_merge_add'
../../../unxlngi6.pro/obj/unoapploader.o: In function `main':
unoapploader.c:(.text.startup+0x56f): undefined reference to `__gcov_execvp'
../../../unxlngi6.pro/obj/unoapploader.o: In function
`_GLOBAL__sub_I_65535_0_SEPARATOR':
unoapploader.c:(.text.startup+0x5c7): undefined reference to `__gcov_init'
/usr/local/src/libreoffice/solver/unxlngi6.pro/lib/libfindsofficepath.a(findsofficepath.o):
In function `_GLOBAL__sub_I_65535_0_findsofficepath.c':
findsofficepath.c:(.text+0x429): undefined reference to `__gcov_init'
/usr/local/src/libreoffice/solver/unxlngi6.pro/lib/libfindsofficepath.a(findsofficepath.o):(.data.rel+0x10):
undefined reference to `__gcov_merge_add'
collect2: error: ld returned 1 exit status
dmake:  Error code 1, while making '../../../unxlngi6.pro/bin/unoapploader'

-----------------------------------------------------------------------
        Oh dear - something failed during the build - sorry !
  For more help with debugging build errors, please see the section in:
            http://wiki.documentfoundation.org/Development

warning: [options] bootstrap class path not set in conjunction with -source 1.5
Note: Loader.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Making:    com_sun_star_lib_loader.dpj

  internal build errors:

ERROR: error 65280 occurred while making
/usr/local/src/libreoffice/odk/source/unoapploader/unx

 it seems that the error is inside '', please re-run build
 inside this module to isolate the error and/or test your fix.

-----------------------------------------------------------------------
To rebuild a specific module:

make .clean # optional
make

when the problem is isolated and fixed, re-run 'make'
make[1]: *** [odk] Error 1
make[1]: Leaving directory `/usr/local/src/libreoffice'
make: *** [odk] Error 2
[root at localhost libreoffice]#


More information about the LibreOffice mailing list