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

sacd_extrackt arm64 #1

Open
antonellocaroli opened this issue Apr 5, 2020 · 9 comments
Open

sacd_extrackt arm64 #1

antonellocaroli opened this issue Apr 5, 2020 · 9 comments

Comments

@antonellocaroli
Copy link

would you be able to adapt the configuration and build files so that arm64 and arm build is also possible?

as setmind did

https://github.com/setmind/sacd-ripper

@antonellocaroli
Copy link
Author

I think we just need to change this part:

Extra flags for GCC

if (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
add_definitions(
-pipe
-Wall -Wextra -Wcast-align -Wpointer-arith -O3
-Wno-unused-parameter -msse2 xml2-config --cflags --libs)
endif (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))

in

STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
if(NOT CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG")
if (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
add_definitions(
-pipe
-Wall -Wextra -Wcast-align -Wpointer-arith -O3
-Wno-unused-parameter)
endif ()
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm*")
add_definitions(
-msse2)
endif ()
endif ()

@antonellocaroli
Copy link
Author

anyway then comes to this error

[ 97%] Building C object CMakeFiles/sacd_extract.dir/tmp/sacd-ripper/libs/libsacd/scarletbook_xml.c.o
/tmp/sacd-ripper/libs/libsacd/scarletbook_xml.c:5:10: fatal error: libxml/xmlreader.h: No such file or directory
5 | #include <libxml/xmlreader.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

@EuFlo
Copy link
Owner

EuFlo commented May 26, 2020

Dear Antonello,
Sorry for late response, but I had no spare time.
Thanks for your interest !
I think the cause is LIBXML2 library. I use this library for exporting all metadate in xml format.
Changed CMakeLists.txt and main.c to compile without libxml2 (only for ARM processors).

@ArminiusTux
Copy link

Buonasera @antonellocaroli ,

could you try again to compile on ARM hardware.

For Linux on RPis you need to install the following dependency:

sudo apt install libxml2-dev

Regards,

ArminiusTux

@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`

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

@fayep
Copy link

fayep commented Aug 8, 2024

The last working version for me on M series Mac is MrWicked's 0.3.6 - is there a newer server side that I need for your client? When I try to compile, I get a bunch of alignment errors and it will not link. I wonder if the packed structs need a bit of rethinking? I also noticed that mkdir is configured with a char* 2nd parameter instead of a mode_t (int). I'm honestly not sure where to start with the alignment issues, it's been a while since I coded in C and this seems to be a side-effect of clang, 64bit registers and ARM CPUs. I have tried to compile with GCC, clang and zig cc and none of them are successful.

@EuFlo
Copy link
Owner

EuFlo commented Aug 9, 2024

A) Try to build on your macOS Mx/Apple Silicon using brew and cmake:

xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install cmake
git clone https://github.com/EuFlo/sacd-ripper.git
cd sacd-ripper/tools/sacd_extract
cmake .
make

B) where did you spotted that mkdir configured with a char* 2nd param ?
C) There is no newer server. No needed. This commit - 117 of sacd_extract client- solve an incompatibility on macOS Sonoma 14.4/14.5.

@EuFlo
Copy link
Owner

EuFlo commented Aug 27, 2024

I have tried to compile with GCC, clang and zig cc and none of them are successful.

Hello Fayep! Have you tried again to compile using the above A) instructions?

@fayep
Copy link

fayep commented Sep 3, 2024

Hi, sorry for taking a while to get back to you. I updated my XCode and that seems to have fixed everything. Compiled first time. 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

5 participants