setmind / sacd-ripper

Improved sacd_extract
GNU General Public License v2.0
74 stars 21 forks source link

Make fails on arm64 #12

Open pepie34 opened 2 years ago

pepie34 commented 2 years ago

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 commented 2 years ago

Same issue on my Mac mini M1 running Xcode 13.4.1

captaineos commented 1 year ago

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

crismi2 commented 1 year ago

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 commented 3 months ago

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 🙌