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

feat: pass sysroot when cross compiling #469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charles-huet-ixxi
Copy link

@charles-huet-ixxi charles-huet-ixxi commented Dec 6, 2023

pass sysroot when cross compiling

This is necessary when using a crate that will compile native libraries (in my case, sqlx with bundled sqlite), otherwise the native lib will not find system headers.

Also passing the cflags is necessary, as it may define the ABI (e.g. hard float on arm)i

@jschwe
Copy link
Collaborator

jschwe commented Dec 11, 2023

Also passing the cflags is necessary, as it may define the ABI (e.g. hard float on arm)

There are also CXX_FLAGS, $<LANG>_FLAGS_$<CONFIG> and c flags set as target properties.
If we start setting flags we should be consistent and think it through properly.

pass sysroot when cross compiling

It should be fine, but I'm a bit worried that this might break something in a different usecase. Corrosion doesn't really have a good test coverage of more complex projects.

For the moment I would lean towards not adding this to corrosion, and perhaps just encouraging users (by improving the documentation) to use corrosion_set_env_vars to set any required c-flags for cc-rs themselves.

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

Successfully merging this pull request may close these issues.

2 participants