Bug 83251 - Reference to $PWD in usb/gadget Makefile causes build failure with `make O=someOtherLocation`
Summary: Reference to $PWD in usb/gadget Makefile causes build failure with `make O=so...
Status: CLOSED CODE_FIX
Alias: None
Product: Other
Classification: Unclassified
Component: Modules (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: other_modules
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-26 05:59 UTC by Dan Peebles
Modified: 2018-06-27 20:21 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.17-rc2
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Dan Peebles 2014-08-26 05:59:58 UTC
Overview:
If you build using the O= option to make and then later try a make from the specified build directory, the build will fail.

Steps to reproduce:
1) Download and unpack https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.17-rc2.tar.xz
2_ Configuration shouldn't matter, as long as you actually build gadget. Here's mine: https://dl.dropboxusercontent.com/u/361503/config
3) Make a separate directory for building
4) In the extracted source directory, run `make O=<your build directory> bzImage modules`. Let it set up the build directory and then stop it.
5) Copy your .config to your build directory, cd to it, and then run `make` to completion in there.
6) It should eventually fail, complaining about a missing include gadget_chips.h, in epautoconf.c.


From what I can tell, it seems to be caused by a recent change that introduced a reference to $PWD in https://github.com/torvalds/linux/blob/master/drivers/usb/gadget/Makefile#L6. This works fine if you're building from the root of the source tree, but will fail if you are not.

I'm happy to answer any questions if it proves hard to reproduce, but that doesn't seem likely.
Comment 1 Dan Peebles 2014-08-26 06:06:21 UTC
Relevant output (showing the failure) from the above instructions is here: https://dl.dropboxusercontent.com/u/361503/output
Comment 2 Dan Peebles 2014-08-28 05:37:24 UTC
Shea Levy submitted a patch for this to lkml: https://lkml.org/lkml/2014/8/28/11

It turns out my repro above wasn't perfect (I can't figure out how to edit my initial description), but https://dl.dropboxusercontent.com/u/361503/bug.tbz seems sufficient to reproduce it reliably. I have a small .config file in there and a bash script that downloads 3.17-rc2, unpacks it, and builds it with flags that make it fail for gadget_chips.h.
Comment 3 Randy Dunlap 2018-03-09 02:37:44 UTC
Fixed in 2014 by commit ID fa31409a82ee050e52caad9e4c483fe3edca163a.

Note You need to log in before you can comment on or make changes to this bug.