Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 243370 - genkernel-3.4.10-r1: should properly handle LDFLAGS
Summary: genkernel-3.4.10-r1: should properly handle LDFLAGS
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-23 12:01 UTC by Klaus Birkelund Jensen
Modified: 2008-11-30 00:03 UTC (History)
0 users

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 Klaus Birkelund Jensen 2008-10-23 12:01:41 UTC
When running genkernel everything is going well, until:

* busybox: >> Applying patches...
* busybox: >> Configuring...
* busybox: >> Compiling...
* ERROR: Failed to compile the "all" target...

Snippet from genkernel.log:
---------------------------

  LD      applets/built-in.o
ld: unrecognized option '-Wl,-O1'
ld: use the --help option for usage information
make[1]: *** [applets/built-in.o] Error 1
make: *** [applets] Error 2

So the linking fails.

Reproducible: Always

Steps to Reproduce:
1. use genkernel to create initramfs and kernel
Actual Results:  
genkernel crashed doing linking (compiling busybox)

Expected Results:  
A freshly squeezed kernel and initramfs with busybox. 

Funtoo amd64 stage (from yesterday)
Running in automated build system. (chroot).
Comment 1 Klaus Birkelund Jensen 2008-10-23 12:11:45 UTC
I resolved the bug myself (only minutes after filing the bug *sigh*). I was going to post my `emerge --info`, and noticed this interesting line:

LDFLAGS="-Wl,-O1"

Exactly what ld was complaining about. So. Setting LDFLAGS="" on the commandline solved the problem.

Maybe LDFLAGS="-Wl,-O1" shouldn't be in /usr/portage/profiles/default/linux/make.defaults

I guess the bug shouldn't be closed, as this still is a bug, unless I misunderstood something :)
Comment 2 Klaus Birkelund Jensen 2008-10-23 12:14:55 UTC
(In reply to comment #1)
> Maybe LDFLAGS="-Wl,-O1" shouldn't be in
> /usr/portage/profiles/default/linux/make.defaults

Or, it should be there (because I've had no previous problems), and genkernel should do something about it.
Comment 3 Peter Alfredsen (RETIRED) gentoo-dev 2008-10-23 20:23:28 UTC
Probably it should just use something like raw-ldflags from flag-o-matic.eclass.
Comment 4 Andrew Gaffney (RETIRED) gentoo-dev 2008-11-30 00:03:33 UTC
The vars defined by the portage profiles have very little to do with running portage, unless those vars leak into the env, which they apparently do not:

kagome ~ # emerge --info | grep LDFLAGS
LDFLAGS="-Wl,-O1"
kagome ~ # echo "|${LDFLAGS}|"
||

You had to have "manually" set LDFLAGS in your env for it to bleed through like this. It's not really genkernel's job to sanitize the env.