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

aarch64-apple-darwin build issue when using #24

Open
schafdog opened this issue Jul 30, 2024 · 2 comments
Open

aarch64-apple-darwin build issue when using #24

schafdog opened this issue Jul 30, 2024 · 2 comments

Comments

@schafdog
Copy link

Hi

I am having a problem when I am using the library on apple silicon. I thinks it's more of cargo than library problem

I can compile the library fine (after I remembered about submodules)

But when I include it in a project it fails to compile due to missing config.h (Static config?):

` cargo:warning=librsync/src/base64.c:22:10: fatal error: 'config.h' file not found
cargo:warning=#include "config.h"
cargo:warning= ^~~~~~~~~~
cargo:warning=1 error generated.

--- stderr

error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "--target=arm64-apple-darwin" "-mmacosx-version-min=14.4" "-I" "librsync/static/aarch64-apple-darwin" "-I" "librsync/static" "-I" "librsync/src" "-I" "librsync/src/blake2" "-Wall" "-Wextra" "-DSTDC_HEADERS=1" "-o" "/Users/dennis/Projects/dsync/target/aarch64-apple-darwin/debug/build/librsync-sys-e8f77933a44e3c30/out/3901d9deb342bdfa-base64.o" "-c" "librsync/src/base64.c" with args cc did not execute successfully (status code exit status: 1).`

I am new to cargo, so I am a bit when to look.

I can cross-compile to x86_64-apple-darwin on the machine so the tools seems to be working. I am curious why the
target is set to arm64-apple-darwin

@mbrt
Copy link
Owner

mbrt commented Aug 2, 2024

I haven't touched this in a long time, but I'm not sure why your target is set to arm64-apple-darwin. The list of supported architectures is here, and I think aarch64-apple-darwin should support your case?

@schafdog
Copy link
Author

schafdog commented Aug 5, 2024

yeah, but I am not specifying that arch. It's coming somehow from the build system. No clue where from. However it doesn't look like that is the issue. The include paths does use the right one "-I librsync/static/aarch64-apple-darwin"

Copying the command from the build log does works:
"cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "--target=arm64-apple-darwin" "-mmacosx-version-min=14.4" "-I" "librsync/static/aarch64-apple-darwin" "-I" "librsync/static" "-I" "librsync/src" "-I" "librsync/src/blake2" "-I/opt/homebrew/include" "-DSTDC_HEADERS=1" "-o" "/Users/dennis/Projects/dsync/target/debug/build/librsync-sys-a8822e77de9a545d/out/3901d9deb342bdfa-base64.o" "-c" "librsync/src/base64.c"

There are no problem locating the config.h above.

This doesn't include the beginning "Command env -u IPHONEOS_DEPLOYMENT_TARGET" which I also don't know where it comes from. There is a cargo issue around this: rust-lang/cargo#13115

Still investigating, but any input is welcome

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

2 participants