Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481810 - app-arch/dpkg-1.17.1 - i686-pc-linux-gnu-gcc: error: unrecognized command line option ‘-fpredictive-commoning,--as-needed’
Summary: app-arch/dpkg-1.17.1 - i686-pc-linux-gnu-gcc: error: unrecognized command lin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Debian-related package maintainers [DISBANDED]
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-08-21 02:42 UTC by Andrew Savchenko
Modified: 2013-11-18 14:38 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,33.89 KB, text/x-log)
2013-08-21 02:43 UTC, Andrew Savchenko
Details
environment (environment,110.28 KB, text/plain)
2013-08-21 02:43 UTC, Andrew Savchenko
Details
config.log (config.log,156.03 KB, text/x-log)
2013-08-21 02:44 UTC, Andrew Savchenko
Details
dpkg-1.17.1-flags.patch (dpkg-1.17.1-flags.patch,397 bytes, patch)
2013-08-21 02:45 UTC, Andrew Savchenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2013-08-21 02:42:58 UTC
Hello,

dpkg-1.17.1 mangles CFLAGS and LDFLAGS up to the point where application is no longer compilable:

i686-pc-linux-gnu-gcc  -march=native -m32 -O0 -funswitch-loops -fpredictive-commoning  -fgcse-after-reload -ftree-loop-im -fweb -frename-registers -fomit-frame-pointer -mfpmath=sse -pipe -frecord-gcc-switches  -march=native -m32 -O2 -funswitch-loops -fpredictive-commoning,--as-needed -pipe -o dpkg-deb build.o extract.o info.o main.o ../lib/dpkg/libdpkg.a ../lib/compat/libcompat.a  -lz -llzma -lbz2
i686-pc-linux-gnu-gcc: error: unrecognized command line option ‘-fpredictive-commoning,--as-needed’

From config.log:
ac_cv_env_LDFLAGS_value='-march=native -m32 -O2 -funswitch-loops -fpredictive-commoning -Wl,-O1,--as-needed -pipe'
turns to:
LDFLAGS='-march=native -m32 -O2 -funswitch-loops -fpredictive-commoning,--as-needed -pipe'
which is obviously invalid.

Proposed patch removes CFLAGS and LDFLAGS mangling and allows application to compile.
Comment 1 Andrew Savchenko gentoo-dev 2013-08-21 02:43:35 UTC
Created attachment 356554 [details]
build.log
Comment 2 Andrew Savchenko gentoo-dev 2013-08-21 02:43:48 UTC
Created attachment 356556 [details]
environment
Comment 3 Andrew Savchenko gentoo-dev 2013-08-21 02:44:20 UTC
Created attachment 356558 [details]
config.log
Comment 4 Andrew Savchenko gentoo-dev 2013-08-21 02:45:16 UTC
Created attachment 356560 [details, diff]
dpkg-1.17.1-flags.patch

Disable flags mangling thus both respecting Gentoo build policy and allowing app to compile.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-18 14:28:08 UTC
Comment on attachment 356560 [details, diff]
dpkg-1.17.1-flags.patch

I don't see how this helps. The ebuild already does this:

econf ... \
    --disable-compiler-optimisations \
    --disable-compiler-warnings \
    --disable-linker-optimisations \
    ...

In fact all the ebuilds currently in the tree already do this.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-18 14:34:28 UTC
Comment on attachment 356560 [details, diff]
dpkg-1.17.1-flags.patch

Oh, right. m4/dpkg-compiler.m4 and dpkg-linker.4 do the mangling, and an option like --disable-compiler-warnings is interpreted as doing whatever it can to not optimise...
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-18 14:38:39 UTC
Fixed in -r1. Thanks for the (partial) patch.