Skip to content

camdusbmidi: build the class on arm and aarch64 - #1111

Closed
bsek wants to merge 1 commit into
aros-development-team:masterfrom
bsek:bsek/camdmidi-arm
Closed

camdusbmidi: build the class on arm and aarch64#1111
bsek wants to merge 1 commit into
aros-development-team:masterfrom
bsek:bsek/camdmidi-arm

Conversation

@bsek

@bsek bsek commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

camdusbmidi.class has not been built for ARM since e4b16b1, which
disabled the rule with:

disable build of camdusbmidid for ARM, until it is fixed (needs to use
objcopy instead of ld to produce the object file, which cannot then be
linked to the main binary!)

That is no longer what happens. The object links fine; what fails is two
flags reaching ld in a form it cannot parse.

1. lld emulation name. camd/mmakefile.src passed -m elf_$(AROS_TARGET_CPU).
That is correct for i386 and x86_64 only — lld calls the ARM emulations
armelf and aarch64elf:

ld.lld: error: unknown emulation: elf_arm

2. -Wl, in LDFLAGS on aarch64. %rule_link_binary hands $(LDFLAGS)
straight to $(KERNEL_LD), but LDFLAGS is written for the compiler driver.
On aarch64 config/make.cfg.in adds -Wl,--allow-multiple-definition for
clang's weak __aros_libreq_ marker, so:

ld.lld: error: unknown argument '-Wl,--allow-multiple-definition'

The other targets never hit this because none of them put a -Wl, option in
LDFLAGS.

With both fixed, the arm rule is re-enabled and an aarch64 rule added.

Testing

Compile-tested on both, each with poseidonusb.bin.o and the class binary
deleted first to force a full relink:

  • raspi-arm-smp (llvm-armhf, lld 11) — Building Module AROS/Classes/USB/camdusbmidi.class
  • raspi-aarch64 (llvm-aarch64-20)

The resulting poseidonusb.bin.o exports the symbols the class expects
(_binary_poseidonusb_start / _end / _size).

What this does not cover

Only that it builds. camd/poseidonusb.c — the CAMD driver blob that
camd.library loads and relocates — has never been run on any architecture; it
went in as "highly experimental and needs testing" (ea4b45f), and m68k
still uses the hardcoded hunk blob in CAMDDriver.c. So this makes the class
available on ARM, it does not claim USB MIDI works there. No behaviour change
on i386/x86_64/ppc/m68k: the emulation mapping falls through to the old
elf_$(cpu) for them, and their LDFLAGS contain no -Wl, options.

The arm rule was disabled in e4b16b1 over a link failure. That
failure is now just two wrong flags reaching ld: lld names the ARM
emulations armelf/aarch64elf rather than elf_arm/elf_aarch64, and
LDFLAGS carries a -Wl, option on aarch64 that ld cannot parse.
Compile-tested on both; the driver blob itself is still untested.
@bsek bsek closed this Sep 1, 2026
@bsek
bsek deleted the bsek/camdmidi-arm branch September 1, 2026 12:44
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.

1 participant