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

Make fails on arm64 #12

Open
pepie34 opened this issue Sep 2, 2022 · 4 comments
Open

Make fails on arm64 #12

pepie34 opened this issue Sep 2, 2022 · 4 comments

Comments

@pepie34
Copy link

pepie34 commented Sep 2, 2022

There is a pointer alignement problem for arm64 arch (macOS)

ld: warning: pointer not aligned at address 0x10002072B (_ServerRequest_fields + 43 from CMakeFiles/sacd_extract.dir/XXXX/sacd-ripper-extract/libs/libsacd/sacd_ripper.pb.c.o)
ld: warning: pointer not aligned at address 0x10002071A (_ServerRequest_fields + 26 from CMakeFiles/sacd_extract.dir/XXXXsacd-ripper-extract/libs/libsacd/sacd_ripper.pb.c.o)
ld: unaligned pointer(s) for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [sacd_extract] Error 1
make[1]: *** [CMakeFiles/sacd_extract.dir/all] Error 2
make: *** [all] Error 2

Is compilation working on amd64 ?

@crismi2
Copy link

crismi2 commented Sep 8, 2022

Same issue on my Mac mini M1 running Xcode 13.4.1

@captaineos
Copy link

Same issue with MacBook Pro M1 / Ventura / Xcode 14
Verbatim as pepie34

@crismi2
Copy link

crismi2 commented Sep 23, 2023

I finally managed to build for arm64 on M1 Mac:
I transformed the cmake project into Xcode with:

cd path to tools/sacd_extract
cmake -G Xcode

In Xcode you can see generated errors more easily, I added two frameworks
Built phase > Link binaries with library:
libiconv.tbd and libxml2.dylib

In Build Setting > Apple Clang Custom Compiler flags > other flags > debug
remove

` xml2-config --cflags --libs`

if unaligned pointer error

General > Deployment info > Deployment target > 11.0

see also
https://stackoverflow.com/questions/7464851/libiconv-not-linking-to-ios-project/72529004#72529004?newreg=c7bf51997d98451e99b9dc926892c5a7

@carbjo
Copy link

carbjo commented Sep 3, 2024

I finally managed to build for arm64 on M1 Mac: I transformed the cmake project into Xcode with:

cd path to tools/sacd_extract
cmake -G Xcode

In Xcode you can see generated errors more easily, I added two frameworks Built phase > Link binaries with library: libiconv.tbd and libxml2.dylib

In Build Setting > Apple Clang Custom Compiler flags > other flags > debug remove

` xml2-config --cflags --libs`

if unaligned pointer error

General > Deployment info > Deployment target > 11.0

see also https://stackoverflow.com/questions/7464851/libiconv-not-linking-to-ios-project/72529004#72529004?newreg=c7bf51997d98451e99b9dc926892c5a7

This worked for me! Thanks 🙌

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

4 participants