Skip to content

mlkem-native / mldsa-native AArch64 local-label clash #1308

Description

@hanno-becker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions