Pass the $(CC) variable to the configurator executable when building config.h - #1035
Merged
Conversation
…ng ccan/config.h When cross compiling it's important that the resulting config.h reflects the platform we are building for and not the one we are building on. Otherwise we end up with a config.h that defines headers that are not there on the target platform, wrong endnianness and so on. The -static flag is there to be able to easily run the configurator test executables on the build machine with qemu-*. E.g. Without the -static flag the resulting dynamically linked ARM executables complain about the lack of linker (/lib/ld-linux-armhf.so or /system/bin/linker for Android), since these files are not usually available on the build machine building statically avoids this problem and results in a proper config.h for cross compiling.
Contributor
|
Would ACK, but do not know enough about target device to judge well. I am concerned about the forced use of |
Contributor
Author
|
@ZmnSCPxj I am concerned as well. Tests inside |
Member
|
I think @rustyrussell will be able to shed some light on our doubts, so deferring final judgement to him ^^ |
Contributor
|
I'm going to apply this, ugly as it is. This will make configurator spit out a CCAN_CFLAGS line with "-static" in it, but it works because we don't use that for the actual build. A proper ./configure step is TBA.... ACK 79efee5 |
rustyrussell
approved these changes
Feb 20, 2018
rustyrussell
added a commit
to rustyrussell/lightning
that referenced
this pull request
Feb 26, 2018
…URATOR_CC This should solve what @icota wanted in ElementsProject#1035 in a much cleaner way. In particular, this allows you to say what configurator should use, independent of what other compilation should use, and reverts the '-static' which broke MacOS. Fixes: ElementsProject#1059 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
cdecker
pushed a commit
that referenced
this pull request
Feb 26, 2018
…URATOR_CC This should solve what @icota wanted in #1035 in a much cleaner way. In particular, this allows you to say what configurator should use, independent of what other compilation should use, and reverts the '-static' which broke MacOS. Fixes: #1059 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When cross compiling it's important that the resulting config.h reflects the platform we are building for and not the one we are building on. Otherwise we end up with a config.h that defines headers that are not there on the target platform, wrong endianness and so on.
The -static flag is there to be able to easily run the configurator test executables on the build machine with qemu-*.
E.g. Without the -static flag the resulting dynamically linked ARM executables complain about the lack of linker (/lib/ld-linux-armhf.so or /system/bin/linker for Android), since these files are not usually available on the build machine building statically avoids this problem and results in a proper config.h for cross compiling.
Related to #653