Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538382 - net-print/cups fails due to CFLAGS="-mabm" and compiling with clang
Summary: net-print/cups fails due to CFLAGS="-mabm" and compiling with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 All
: Lowest minor (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-31 22:59 UTC by jeremiah
Modified: 2015-02-01 00:40 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jeremiah 2015-01-31 22:59:56 UTC
This bug was solved before finishing the initial report, but is being filing anyway for posterity (in case someone else comes across it), as no other examples could be found.

tl;dr: If you have the flag "-mabm" set in CFLAGS and/or CXXFLAGS in /etc/portage/make.conf, replace it with the flags "-mpopcnt -mlzcnt".

Compiling net-print/cups would while running ./configure fail with the following:

checking for x86_64-pc-linux-gnu-clang... x86_64-pc-linux-gnu-clang
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/net-print/cups-1.7.5/work/cups-1.7.5-abi_x86_64.amd64':
configure: error: C compiler cannot create executables


Trying to force cups to use gcc with 'CC="gcc" emerge cups' would allow the tests in ./configure to pass, but once it hit some .cxx files during the compile phase, it would give the following error:

x86_64-pc-linux-gnu-clang-3.5.1: error: unknown argument: '-mabm'


The inherent issue was "-mabm" was set for my CFLAGS and CXXFLAGS, which gcc understood but clang didn't. (see <http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20121112/068376.html> for more info) Instead of "-mabm", "-mpopcnt -mlzcnt" should be used, which is equivalent and understood by both gcc and clang.