Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 353195 - AX_CREATE_PKGCONFIG_INFO pollutes .pc files with CPPFLAGS/LDFLAGS (such as dev-libs/zziplib)
Summary: AX_CREATE_PKGCONFIG_INFO pollutes .pc files with CPPFLAGS/LDFLAGS (such as de...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-30 04:23 UTC by Andrew Savchenko
Modified: 2011-02-06 07:14 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,299.43 KB, text/plain)
2011-01-30 04:26 UTC, Andrew Savchenko
Details
environment (environment,52.11 KB, text/plain)
2011-01-30 04:26 UTC, Andrew Savchenko
Details
emerge --info (emerge.info,5.60 KB, text/plain)
2011-01-30 04:26 UTC, Andrew Savchenko
Details
zziplib.pc (zziplib.pc,790 bytes, text/plain)
2011-01-30 04:27 UTC, Andrew Savchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2011-01-30 04:23:38 UTC
Hello,

luatex-0.65.0 fails to build with multiple --param options passed to gcc. This bug looks similar to bug 317475, but this time dev-libs/zziplib-0.13.60 seems to be guilty, because it installs compile flags into *.pc file. Without --param options in *FLAGS luatex will nevertheless fail if these options were used during zziplib compilation.

Anyway luatex mechanism for the duplicated options stripping should be more clever, otherwise this error will occur here and there.
Comment 1 Andrew Savchenko gentoo-dev 2011-01-30 04:26:11 UTC
Created attachment 261065 [details]
build.log
Comment 2 Andrew Savchenko gentoo-dev 2011-01-30 04:26:24 UTC
Created attachment 261066 [details]
environment
Comment 3 Andrew Savchenko gentoo-dev 2011-01-30 04:26:41 UTC
Created attachment 261068 [details]
emerge --info
Comment 4 Andrew Savchenko gentoo-dev 2011-01-30 04:27:41 UTC
Created attachment 261070 [details]
zziplib.pc

pkgconfig *.pc file from zziplib-0.13.60 installation.
Comment 5 Andrew Savchenko gentoo-dev 2011-01-30 04:35:10 UTC
zziplib installs all $LDFLAGS to the *.pc file. This should not be done.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-01 20:47:17 UTC
Er, your LDFLAGS seem to include gcc flags and you should fix that.

So the real problem is that LDFLAGS gets propagated into zziplib.pc. Here's mine:

# generated by configure / remove this line to disable regeneration                     
prefix=/usr                                                                             
exec_prefix=${prefix}                                                                   
bindir=${exec_prefix}/bin                                                               
libdir=${exec_prefix}/lib                                                               
datarootdir=${prefix}/share                                                             
datadir=/usr/share                                                                      
sysconfdir=/etc                                                                         
includedir=${prefix}/include                                                            
package=zziplib                                                                         
suffix=                                                                                 
                                                                                        
Name: zziplib                                                                           
Description: ZZipLib - libZ-based ZIP-access Library with an Easy-to-Use API            
Version: 0.13.60                                                                        
Requires: zzip-zlib-config                                                              
Libs: -L${libdir} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lzzip                   
Cflags: -I${includedir}

Which is a minor problem compared to yours.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-01 20:48:45 UTC
# grep Libs:.*-Wl /usr/lib/pkgconfig/zzip*
/usr/lib/pkgconfig/zzipfseeko.pc:Libs: -L${libdir} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as
-needed -lzzipfseeko                                                                    /usr/lib/pkgconfig/zziplib.pc:Libs: -L${libdir} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-ne
eded -lzzip                                                                             /usr/lib/pkgconfig/zzipmmapped.pc:Libs: -L${libdir} -Wl,-O1 -Wl,--hash-style=gnu -Wl,--a
s-needed -lzzipmmapped
Comment 8 Andrew Savchenko gentoo-dev 2011-02-02 04:06:36 UTC
(In reply to comment #6)
> Er, your LDFLAGS seem to include gcc flags and you should fix that.

Why do you consider this inheritance as an error? This was done intentionally, because absolute majority of the packages use gcc for linking instead of plain ld and gcc can perform additional optimizations at the linking stage. The most prominent of them is upcoming -flto — yes, at this too buggy and unstable now, but it will definitely be production at some day — and for -flto to be effective you must use it on both compilation and linking stages. Further optimizations like -march or -On may affect linking as well, according to gcc manual.

I had problems with LDFLAGS="${CFLAGS}  -Wl,-O1 -Wl,--as-needed" with only two packages from 2336 installed: bintutils and live, and simple workaround is to use /etc/portage/env/ to set more conventional LDFLAGS. But ideally these packages should be fixed instead, however some people may argue that formally there is nothing to be fixed in them.
Comment 9 SpanKY gentoo-dev 2011-02-06 06:57:51 UTC
not a bug in zziplib itself ...
Comment 10 SpanKY gentoo-dev 2011-02-06 07:14:10 UTC
sent a patch to the AX_CREATE_PKGCONFIG_INFO authors and worked around the issue in zziplib-0.13.60-r1