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

Compilation failing on ARM (both macOS and Debian container) #80

Open
jacksonbenete opened this issue Jan 28, 2022 · 10 comments
Open

Compilation failing on ARM (both macOS and Debian container) #80

jacksonbenete opened this issue Jan 28, 2022 · 10 comments

Comments

@jacksonbenete
Copy link

Looks like I can install VitaSDK using all the provided scripts and following the instructions.
But every time I try a "cmake ." it fails to compile the test program.

I'm on M1, is it possible to have a release on autobuild for arm macOS?
(not sure if it would solve the problem though)
I also tried on a debian container and it fails compiling the test program.

root@b89ca405054d:/build/samples/hello_world# cmake .
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/local/vitasdk/bin/arm-vita-eabi-gcc
-- Check for working C compiler: /usr/local/vitasdk/bin/arm-vita-eabi-gcc -- broken
CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/usr/local/vitasdk/bin/arm-vita-eabi-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /build/samples/hello_world/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_9b445/fast"
    /usr/bin/make -f CMakeFiles/cmTC_9b445.dir/build.make CMakeFiles/cmTC_9b445.dir/build
    make[1]: Entering directory '/build/samples/hello_world/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_9b445.dir/testCCompiler.c.obj
    /usr/local/vitasdk/bin/arm-vita-eabi-gcc   -Wl,-q    -o CMakeFiles/cmTC_9b445.dir/testCCompiler.c.obj   -c /build/samples/hello_world/CMakeFiles/CMakeTmp/testCCompiler.c
    /usr/local/vitasdk/bin/arm-vita-eabi-gcc: 1: /usr/local/vitasdk/bin/arm-vita-eabi-gcc: ELF: not found
    /usr/local/vitasdk/bin/arm-vita-eabi-gcc: 3: /usr/local/vitasdk/bin/arm-vita-eabi-gcc: Syntax error: Unterminated quoted string
    make[1]: *** [CMakeFiles/cmTC_9b445.dir/build.make:66: CMakeFiles/cmTC_9b445.dir/testCCompiler.c.obj] Error 2
    make[1]: Leaving directory '/build/samples/hello_world/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_9b445/fast] Error 2
 
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:18 (project)

-- Configuring incomplete, errors occurred!
See also "/build/samples/hello_world/CMakeFiles/CMakeOutput.log".
See also "/build/samples/hello_world/CMakeFiles/CMakeError.log".
@erfg12
Copy link

erfg12 commented Aug 23, 2022

Same here. On my MacBook Air M1 and in an Ubuntu Arm VM compiling fails.

@SonicMastr
Copy link
Contributor

For M1, there's nothing for you right now. But for Linux based AARCH64/ARM64 systems, there is a fork with ARM support here.

It's been a while, but the problem is this is entirely a self-hosted autobuild runner, so it cannot be merged into VitaSDK right now until public ARM runners are added to actions.

@iamcco
Copy link

iamcco commented Oct 6, 2023

same here.

@xfangfang
Copy link

@iamcco I've encountered a similar issue before. For ARM Mac, the problem arises because some executable files like arm-vita-eabi-gcc were compiled for Intel Mac, and they have dependencies on x86 libraries. On an ARM Mac, only the ARM libraries are available, so they cannot execute properly. The solution is either to distribute these dependencies along with the files or locally compile these executable files.

@iamcco
Copy link

iamcco commented Oct 6, 2023

@iamcco I've encountered a similar issue before. For ARM Mac, the problem arises because some executable files like arm-vita-eabi-gcc were compiled for Intel Mac, and they have dependencies on x86 libraries. On an ARM Mac, only the ARM libraries are available, so they cannot execute properly. The solution is either to distribute these dependencies along with the files or locally compile these executable files.

@xfangfang Thanks, I'll look into it.

@rreha
Copy link

rreha commented Jun 25, 2024

I'm currently experiencing the same issue, except that I'm actually on an Intel Mac and not M1...

@hammerill
Copy link

Fresh MacBook Air M1 user here. Currently compiling my Vita project using x86 emulator version of Lima as described in here.

Compilation feels like 5x slower. But hey, it gets the job done!

@hammerill
Copy link

But for Linux based AARCH64/ARM64 systems, there is a fork with ARM support here.

Oh, probably I had to try that first with normal version of Lima (which emulates normal Ubuntu with ARM).

@xfangfang
Copy link

@hammerill I am using using https://orbstack.dev, running a Docker image of vitasdk to compile for vita, compared to Docker Desktop, OrbStack supports rosetta to run Docker images or Linux, which makes the running speed almost similar to x86_64.

https://docs.orbstack.dev/compare/colima

@hammerill
Copy link

hammerill commented Jul 18, 2024

@xfangfang thank you for suggesting that! But still I've decided to stay with Lima.
As I said that the Arm64 version of VDPM could possibly work with default conf of Lima, I've tried it out, and it worked flawlessly! Now, it compiles everything at acceptable speed.

By the way, @SonicMastr , I've merged the upstream branch in my fork in order to compile the project I've worked on with latest VDPM version. Your version was kind of stale and complained about libxmp being absent. Merging with upstream VDPM fixed that. You could accept my PR if you want.

In general, I find this Lima + Arm64 VDPM technique a viable solution for developing Vita homebrew on Macs.

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

7 participants