Summary: | x11-libs/qt-sql-4.7.2 fails to build with --param in flags | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Andrew Savchenko <bircoph> |
Component: | [OLD] Library | Assignee: | Qt Bug Alias <qt> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | audvare, bircoph |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
environment emerge --info |
Description
Andrew Savchenko
![]() Created attachment 266015 [details]
build.log
Created attachment 266017 [details]
environment
Created attachment 266019 [details]
emerge --info
Hmm, I removed --param val=arg from CFLAGS/CXXFLAGS/LDFLAGS, but problem still persists. It looks like qmake takes them from some system wide config or pc file, but at this moment I can't figure out its whereabouts. Problem was triggered by mysql_config --libs_r call, which returned full set of LDFLAGS used to compile mysql, and consequent removal of "duplicated" --param argument by qmake. As a temporary workaround, mysql may be recompiled with reduced LDFLAGS, or just mysql_config script may be tuned manually. But the proper solution will be to fix mishappen qmake function for the removing of duplicates. From your emerge --info: LDFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -mstackrealign -ftree-loop-linear -ftree-loop-im -fweb -frename-registers -fomit-frame-pointer -mfpmath=sse -fexcess-precision=fast -pipe -Wl,-O1 -Wl,--as-needed" wtf? Compiler flags in LDFLAGS? Are there any valid reasons for this? Can you reproduce with saner LDFLAGS? (In reply to comment #6) > wtf? Compiler flags in LDFLAGS? Are there any valid reasons for this? Yes, according to the gcc manual, further optimizations may take place when linking with gcc/g++. The most prominent example is -flto which is required to be present on both object compilation and linking stages. Of course, at this moment -flto is unsupported, because it is too unstable, but its support is just a matter of time. > Can you reproduce with saner LDFLAGS? As I wrote in comment #4, reduced flags does not help. In fact I used LDFLAGS="-Wl,-O1 -Wl,--as-needed" and got the same error. As I wrote in comment #5, I investigated this problem further and found out that dev-db/mysql saves all LDFLAGS to its /usr/bin/mysql_config script and reports them to qmake during `mysql_config --libs_r` call. Afterwards, qmake strips out from an obtained list all duplicated arguments, which leads to the compilation error. Thus with "fixed" mysql_config and even with original complicated LDFLAGS qt-sql-4.7.2 builds well. Of course, the real fix will be make qmake's argument stripper more intelligent. I understand, that using CFLAGS in LDFLAGS is uncommon, but it is not illegal as long as you are linking with gcc and not plain ld. I believe that only a very limited subset of compiler flags are valid at link time (e.g. -flto as you said). Anyway, qmake indeed mishandles --param flags in LDFLAGS, that's a bug that should be fixed, but there's little we can do about it. You're encouraged to open a bug in upstream tracker at http://bugreports.qt.nokia.com/ and report your findings there. Thank you! *** Bug 425392 has been marked as a duplicate of this bug. *** |