Skip to content

add linux-aarch64 build#812

Merged
LibretroAdmin merged 1 commit into
libretro:masterfrom
theofficialgman:master
May 16, 2026
Merged

add linux-aarch64 build#812
LibretroAdmin merged 1 commit into
libretro:masterfrom
theofficialgman:master

Conversation

@theofficialgman

Copy link
Copy Markdown
Contributor

this is untested on the libretro CI. Documentation is sparse on how to actually test these changes. If anyone could provide details on that process please do.

this is untested on the libretro CI. Documentation is sparse on how to actually test these changes. If anyone could provide details on that process please do.
@theofficialgman

Copy link
Copy Markdown
Contributor Author

@warmenhoven I see you added the CI files for aarch64-linux. Is there a more automated way of testing this or should I just install the dockerfile https://git.libretro.com/libretro-infrastructure/libretro-build-aarch64-ubuntu/-/blob/master/Dockerfile?ref_type=heads and then manually clone and execute these build commands in it to test?

@warmenhoven

Copy link
Copy Markdown
Collaborator

Yes so that image is already built and available from hub.docker.com at reallibretroretroarch/libretro-build-aarch64-ubuntu. Pulling the image and building locally is how I was verifying all of the builds for the cores.

@warmenhoven

Copy link
Copy Markdown
Collaborator

https://git.libretro.com/libretro/parallel-n64/-/jobs/1337646

@LibretroAdmin LibretroAdmin merged commit 08ec547 into libretro:master May 16, 2026
LibretroAdmin added a commit that referenced this pull request May 16, 2026
The arm64 dynarec trampoline files were only ever exercised on Apple
ARM64 before the linux-aarch64 CI job landed (PR #812). Building them
under non-Apple GCC aarch64 surfaces three issues:

* clear_cache.h
  The guard 'defined(__arm64__) || defined(__arm__)' excludes Linux
  ARM64, which predefines '__aarch64__' but not '__arm64__'. With the
  header empty, every caller of clear_instruction_cache fails to link.
  Added __aarch64__ to the guard.

* arm64/trampoline_arm64.h
  The header used size_t in prototypes but only pulled in <stdint.h>.
  Added <stddef.h> so size_t is declared on every platform, not just
  Apple (where <sys/types.h> was being included conditionally and
  pulling it in transitively).

* arm64/trampoline_arm64.cpp
  Replaced the lone (u_int) cast with (uint32_t). The BSD-ism u_int
  is unavailable from <sys/types.h> on glibc unless __USE_MISC is set,
  which it isn't under -std=c++11 strict mode. uint32_t comes from
  <stdint.h>, which the header already includes.
@theofficialgman

Copy link
Copy Markdown
Contributor Author

@warmenhoven @LibretroAdmin thanks for merging and fixing the issues that preventing a successful compilation!

@theofficialgman

theofficialgman commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

@warmenhoven @LibretroAdmin Just tried this nightly build and I get an Illegal instruction (core dumped). Seems to happen with all games on launch.

nothing really useful from gdb

Thread 1 "retroarch" received signal SIGILL, Illegal instruction.
0x0000007f997efb20 in ?? ()
(gdb) bt
#0  0x0000007f997efb20 in ?? ()
#1  0x00000000ffffffff in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I was previously using a self build of this without issues (that I make on my own bionic system through my own custom CI https://github.com/theofficialgman/RetroPie-Binaries/tree/master/Binaries/tegra-x1/libretrocores although it looks like retropie (which my CI uses) has an old fork of this core so its older https://github.com/RetroPie/parallel-n64)

@theofficialgman

Copy link
Copy Markdown
Contributor Author

Same issue with my selfbuild I made on Ubuntu Noble aarch64. Seems like a legitimate emulator issue.

compile options I used (copied from the CI)

WITH_DYNAREC=aarch64 HAVE_THR_AL=1 HAVE_PARALLEL=1 HAVE_PARALLEL_RSP=1 make -j8

@theofficialgman

Copy link
Copy Markdown
Contributor Author

also tried

HAVE_NEON=0 WITH_DYNAREC=aarch64 HAVE_THR_AL=1 HAVE_PARALLEL=1 HAVE_PARALLEL_RSP=1 make -j8 CPUFLAGS="-DNO_ASM -DARM -DARM_ASM -DDONT_WANT_ARM_OPTIMIZATIONS -DARM_FIX -DCLASSIC -DARM64"

which adds a lot more flags found in the pi4 arm64 target from the makefile

CPUFLAGS += -DNO_ASM -DARM -DARM_ASM -DDONT_WANT_ARM_OPTIMIZATIONS -DARM_FIX -DCLASSIC -DARM64
but same issue.

for reference, this is on Switchroot Ubuntu 24.04 (Nintendo Switch)

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

Successfully merging this pull request may close these issues.

3 participants