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

zigcc: Not working cross-compiling #3

Closed
kassane opened this issue Jun 12, 2024 · 3 comments
Closed

zigcc: Not working cross-compiling #3

kassane opened this issue Jun 12, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kassane
Copy link
Owner

kassane commented Jun 12, 2024

@import("builtin") get only native target.

tested in ldc2-druntime/gist


This is a workaround for a previous problem with Darwin target support.
Note that when using the -mtriple flag, except for Darwin targets, ldc2 does not set the -target flag to CC.
Thus, zig cc will assume that the target is native (which is the default), and will not recognize a specific triple-target.
Likewise, looking at ldc2 internally, it appears that, like rustc, it calls the CC (like arm-none-eabi-gcc) of the selected target.

Reference

@kassane kassane added bug Something isn't working help wanted Extra attention is needed labels Jun 12, 2024
@kassane
Copy link
Owner Author

kassane commented Jun 13, 2024

Partial fix applied, but occurs some errors:

# rustc - arm64/macos
error: unable to run `dsymutil`: No such file or directory (os error 2)
# rustc - arm64/windows
error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not support target 'aarch64-pc-windows-gnu'
note: you can see a list of supported targets with `rustc --print=target-list`
note: if you are adding support for a new target to rustc itself, see https://rustc-dev-guide.rust-lang.org/building/new-target.html
install
+- hellors
   +- rustup failure
error: the following command exited with error code 1:
/home/runner/.cargo/bin/rustup target add aarch64-pc-windows-gnu 

Rust-std not have mipsel and riscv64gc-musl support!

ldc2-druntime no have arm64/windows-msvc, mingw and wasm32 support

@kassane
Copy link
Owner Author

kassane commented Jun 21, 2024

refactored: 58b6c8e
Now cross-compile works in flang-new (fortran) and ldc2 (D/dlang)... rust need rewrite using cargo!! 😮‍💨

@kassane kassane closed this as completed Jun 21, 2024
@kassane
Copy link
Owner Author

kassane commented Jun 21, 2024

Waiting more flags for extend flang support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant