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

Cross compilation broken since #146 #151

Closed
igiona opened this issue Oct 11, 2023 · 3 comments
Closed

Cross compilation broken since #146 #151

igiona opened this issue Oct 11, 2023 · 3 comments

Comments

@igiona
Copy link
Contributor

igiona commented Oct 11, 2023

Since #146 our build is broken.

| error: linker `cc` not found
|   |
|   = note: No such file or directory (os error 2)
| 

Reverting to 7ac87ec the build works again.

Our setup

It looks like the linker configuration is not properly set.
In the changes you switched to the "environment variable configuration" approach instead of the config file approach.

Likely CARGO_TARGET_${@rust_target(d, 'BUILD').replace('-','_')}_LINKER gets somehow wrongly set.

Could this be the issue pherhaps?

@benjamin-nw
Copy link

benjamin-nw commented Oct 11, 2023

Hello,

Same problem with the setup:

  • Host: Ubuntu 20.04
  • Target: aarch64-unknown-linux-gnu

I also found that the line you mentioned CARGO_TARGET_${@rust_target(d, 'BUILD').replace('-','_')}_LINKER is not working correctly.

I've managed to fix it with 2 steps:

  • Replace rust_target(d, 'BUILD') by rust_target(d, 'TARGET)`.
    • The BUILD was returning x86_64 architecture instead of aarch64.
  • Apply uppercase to the rust_target returned, else the variable is a mix of uppercase and lowercase.
    • The correct cargo variable is uppercase (i.e CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER).
- CARGO_TARGET_${@rust_target(d, 'BUILD').replace('-','_')}_LINKER
+ CARGO_TARGET_${@rust_target(d, 'TARGET').replace('-','_').upper()}_LINKER

I've also looked at the implementation in buildroot in order to see if it was correct.

Everything else seems alright and I was able to build.

Tell me if this is working for you too.

@igiona
Copy link
Contributor Author

igiona commented Oct 11, 2023

@Benji-NW I came to your same conclusion and it fixed in the same way.
I also created a PR for this: #152

@eldruin
Copy link
Member

eldruin commented Dec 11, 2023

Closing since this was fixed in #152.
Thank you and feel free to comment or reopen if there are additional concerns.

@eldruin eldruin closed this as completed Dec 11, 2023
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