Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure breaks when cross-compiling #158

Closed
jonathan-geisler opened this issue May 4, 2020 · 4 comments
Closed

configure breaks when cross-compiling #158

jonathan-geisler opened this issue May 4, 2020 · 4 comments

Comments

@jonathan-geisler
Copy link

The configure script tries to build a program that it can execute to determine the compiler version being used. This does not work properly when cross-compiling because the executable cannot run on the host machine. There needs to be a way to provide this information when cross compiling so that this step can be avoided. Maybe do something like ${CC} --version and parse the output there since the compiler must execute on the host?

@sbahra
Copy link
Member

sbahra commented May 6, 2020

Makes sense. Will look into addressing this and otherwise happy to take patches sooner!

@sbahra
Copy link
Member

sbahra commented May 8, 2020

@jonathan-geisler One thing I forgot to mention: Cross-compilation is usually done today using build profiles. See the --profile option. If you're blocked on this, you may want to take this route. This removes the need to do a lot checks as well. Does this work for your use-case?

Parsing compiler version output is a bit of a PITA given the number of supported compilers, it also becomes a maintenance burden as more compilers are supported, but I'll check for feasibility of it.

@jonathan-geisler
Copy link
Author

I am not blocked because I was able to make this change to the code:

#COMPILER=`./.` 2> /devnull`
COMPILER="gcc" # hack to allow cross-compiling

The --profile option could work in the long run, but it doesn't get checked until after this line of code, so it is not quite enough to fix the problem permanently.

@igorpupkinable
Copy link

igorpupkinable commented Nov 30, 2023

Parsing compiler version output is a bit of a PITA given the number of supported compilers, it also becomes a maintenance burden as more compilers are supported, but I'll check for feasibility of it.

I am not sure you need to parse compiler output. $CC --version || return 1 or $CC --help || return 1 should be just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants