When both mlkem-native and mldsa-native AArch64 assembly backends are linked into a single translation unit (as in AWS-LC), the build fails because of a duplicate-symbol. The issue here is mlkem-native and mldsa-native using the same local labels in the AArch64 assembly files. Other symbols are prefixed with the ASM namespace via MLX_ASM_NAMESPACE(...), but labels aren't.
At the moment, AWS-LC patches up the labels at import time. Not a big issue, but avoidable. Complete list of conflicts:
| Label |
mlkem file |
mldsa file |
Lntt_layer123_start |
ntt_aarch64_asm.S |
ntt_aarch64_asm.S |
Lrej_uniform_initial_zero |
rej_uniform_aarch64_asm.S |
rej_uniform_aarch64_asm.S |
Lrej_uniform_loop48 |
rej_uniform_aarch64_asm.S |
rej_uniform_aarch64_asm.S |
Lrej_uniform_loop48_end |
rej_uniform_aarch64_asm.S |
rej_uniform_aarch64_asm.S |
Lrej_uniform_memory_copy |
rej_uniform_aarch64_asm.S |
rej_uniform_aarch64_asm.S |
Lrej_uniform_final_copy |
rej_uniform_aarch64_asm.S |
rej_uniform_aarch64_asm.S |
Lrej_uniform_return |
rej_uniform_aarch64_asm.S |
rej_uniform_aarch64_asm.S |
Interestingly, the x86_64 backends do not clash (0 shared local labels), so this is AArch64-specific.
Suggested fix
Add explicit label prefixes so mlkem-native and mldsa-native do not share any two label names.
When both mlkem-native and mldsa-native AArch64 assembly backends are linked into a single translation unit (as in AWS-LC), the build fails because of a duplicate-symbol. The issue here is mlkem-native and mldsa-native using the same local labels in the AArch64 assembly files. Other symbols are prefixed with the ASM namespace via
MLX_ASM_NAMESPACE(...), but labels aren't.At the moment, AWS-LC patches up the labels at import time. Not a big issue, but avoidable. Complete list of conflicts:
Lntt_layer123_startntt_aarch64_asm.Sntt_aarch64_asm.SLrej_uniform_initial_zerorej_uniform_aarch64_asm.Srej_uniform_aarch64_asm.SLrej_uniform_loop48rej_uniform_aarch64_asm.Srej_uniform_aarch64_asm.SLrej_uniform_loop48_endrej_uniform_aarch64_asm.Srej_uniform_aarch64_asm.SLrej_uniform_memory_copyrej_uniform_aarch64_asm.Srej_uniform_aarch64_asm.SLrej_uniform_final_copyrej_uniform_aarch64_asm.Srej_uniform_aarch64_asm.SLrej_uniform_returnrej_uniform_aarch64_asm.Srej_uniform_aarch64_asm.SInterestingly, the x86_64 backends do not clash (0 shared local labels), so this is AArch64-specific.
Suggested fix
Add explicit label prefixes so mlkem-native and mldsa-native do not share any two label names.