Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 499818 - dev-libs/openssl: `make depend` fails when CC doesn't end in "gcc"
Summary: dev-libs/openssl: `make depend` fails when CC doesn't end in "gcc"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-30 18:40 UTC by Michał Górny
Modified: 2014-08-13 20:53 UTC (History)
1 user (show)

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


Attachments
Build log (dev-libs:openssl-1.0.1f:20140130-182812.log,23.40 KB, text/x-log)
2014-01-30 18:40 UTC, Michał Górny
Details
Fix 'make depend' with non-/gcc$/ compilers (openssl-makedepend.patch,5.64 KB, patch)
2014-08-13 19:44 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-30 18:40:14 UTC
Created attachment 369146 [details]
Build log

I've got CC=${CHOST}-gcc-4.8.2 and dev-libs/openssl fails to build passing invalid arguments to gcc:

>>> Compiling source in /tmp/portage/dev-libs/openssl-1.0.1f/work/openssl-1.0.1f ...
make -j8 -j1 depend 
making depend in crypto...
make[1]: Wejście do katalogu '/tmp/portage/dev-libs/openssl-1.0.1f/work/openssl-1.0.1f/crypto'
x86_64-pc-linux-gnu-gcc-4.8.2: error: unrecognized command line option ‘--’
x86_64-pc-linux-gnu-gcc-4.8.2: error: unrecognized command line option ‘--’


Looks like this dumb conditional is reponsible for it:

util/domd:17:
  if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then

which obviously fails to match when gcc is actually versioned.

Possible solutions:

1. replace the stupid conditional with build-time check,

2. provide an explicit method of telling the build system that MAKEDEPEND is not makedepend instead of this guessing,

3. stop abusing MAKEDEPEND.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-13 19:44:01 UTC
Created attachment 382854 [details, diff]
Fix 'make depend' with non-/gcc$/ compilers

Two things:

1. replace the $MAKEDEPEND test with simple 'true' since we're always overriding MAKEDEPEND with the compiler,

2. add -Qunused-arguments to CFLAGS when clang is used to silence out the warnings about wrong kind of flags being passed to wrong kind of tool. This fixes a lot of warnings nobody's going to fix and also 'make depend' which failed because it uses -Werror for some reason.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-13 20:53:48 UTC
+  13 Aug 2014; Michał Górny <mgorny@gentoo.org> openssl-0.9.8z_p2.ebuild,
+  openssl-1.0.1i.ebuild, openssl-1.0.2_beta2.ebuild:
+  Short-circuit the $MAKEDEPEND-is-gcc to always-on since we are overriding
+  MAKEDEPEND unconditionally anyway. Pass -Qunused-arguments when clang is used
+  to silence the unused flag warnings that can not be fixed without major
+  changes to the build system, and to make -Werror in "make depend" happier.
+  Fixes build with CC values that do not end with "gcc", bug #499818, and with
+  clang, bug #417795. Reviewed by Chainsaw.