Bug 190518 - Changes in gcc break libxml2 compilation
Changes in gcc break libxml2 compilation
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
: Reopened
Depends On:
Blocks: 234547
  Show dependency treegraph
Reported: 2006-05-03 04:53 EDT by Bastien Nocera
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2007-0195
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-01 18:45:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch fixing the spec file to avoid the linking problem (464 bytes, patch)
2006-12-11 12:29 EST, Daniel Veillard
no flags Details | Diff

  None (edit)
Description Bastien Nocera 2006-05-03 04:53:28 EDT

While recompile libxml2-2.6.16-6:

/bin/sh ./libtool --mode=link gcc  -O2 -g -pipe -m32 -march=i386 -mtune=pentium4
-fprofile-generate -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type
-Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized
-Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Winline -Wredundant-decls   -o xmllint  xmllint.o ./libxml2.la -lpthread -lz  -lm
gcc -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -fprofile-generate -pedantic
-W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs
-Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow
-Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline
-Wredundant-decls -o .libs/xmllint xmllint.o  ./.libs/libxml2.so -lpthread -lz -lm
/usr/bin/ld: .libs/xmllint: hidden symbol `__gcov_merge_single' in
/usr/lib/gcc/i386-redhat-linux/3.4.5/libgcov.a(_gcov_merge_single.o) is
referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[2]: *** [xmllint] Error 1
make[2]: Leaving directory `/home/bnocera/Projects/packages/BUILD/libxml2-2.6.16'

Work-around is to disable profiling in the libxml2 spec file:
     77 if [ $GCC_VERSION -ge 34 ]
    78 then
    79     PROF_GEN='-fprofile-generate'
    80     PROF_USE='-fprofile-use'
    81 fi
Comment 1 Jakub Jelinek 2006-05-03 05:05:20 EDT
That sounds like libxml2 bug.
From the above error message it sounds like ./.libs/libxml2.so was compiled
with -fprofile-generate (well, at least one of the source files for that
library), yet when libxml2.so was linked, gcc was not given the needed
-fprofile-generate option, therefore -lgcov was not linked in.
I have verified that gcc 3.4.5-2 driver adds -lgcov whenever linking with
-fprofile-generate, so I'm very sure the bug is not on the gcc side.
Comment 2 Daniel Veillard 2006-05-03 05:21:55 EDT
The spec file does:

if [ $GCC_VERSION -ge 34 ]

if [ "$PROF_GEN" != "" ]
    # First generate a profiling version
    CFLAGS="${RPM_OPT_FLAGS} ${PROF_GEN}"  %configure

that used to work, that breaks now, I didn't changed anything.

Comment 3 Jakub Jelinek 2006-05-03 05:28:59 EDT
If it doesn't use those flags when linking the shared library, then it is broken.
If it worked before, it was by pure accident.
Comment 4 Bastien Nocera 2006-05-03 05:42:18 EDT
Reopening and reassigning to libxml2 for fixing.
Comment 5 Daniel Veillard 2006-05-03 06:11:58 EDT
It's not used in Fedora. Only in RHEL4 package, where fixing means a respin
and I'm not try to do that unless everybody needed to get such a push line up
saying it's needed...

Comment 8 Daniel Riek 2006-08-29 10:31:02 EDT
The component of this request is planned to be updated in Red Hat enterprise
Linux 4.5.

This enhancement request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux maintenance release.

Product Management has requested further review of this request by Red Hat
Engineering, for potential inclusion in a Red Hat Enterprise Linux Update
release for currently deployed products.

This request is not yet committed for inclusion in an Update release. 
Comment 10 Daniel Veillard 2006-12-11 12:28:04 EST
The following patch seems to fix the link problem while keeping the profiling
in the spec, and work on my RHEL-4 U4 i386 box,

Comment 11 Daniel Veillard 2006-12-11 12:29:29 EST
Created attachment 143305 [details]
Patch fixing the spec file to avoid the linking problem
Comment 13 Daniel Veillard 2006-12-12 06:10:51 EST
452596 build (dist-4E-qu-candidate, RHEL-4:libxml2-2_6_16-8)

A version with the fix has been built in dist-4E-qu-candidate,
but profiling has been deactivated for s390 since build with profiling
breaks on that platform.

Comment 17 Red Hat Bugzilla 2007-05-01 18:45:59 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.