Skip to content

Normalize the loong64 alias in target attributes #780

Closed

Description

@LunaStev

Motivation

The case matrix names the architecture loong64, while target attributes only recognize the literal loongarch64 spelling. Other matrix names such as amd64 and arm64 already normalize to their compiler spellings. Reusing loong64 in an attribute silently removes the declaration.

Starting points: front/parser/src/arch/mod.rs, front/parser/src/import.rs, tests/cases/cases.toml.

Reproduction

At 4c3372157d8889fa8bbef0a7ccd2e72aab1c5c6c, save the following as alias.wave:

#[target(arch="loong64")]
fun selected() -> i32 { return 0; }
fun main() -> i32 { return selected(); }
target/debug/wavec build alias.wave --target loongarch64-unknown-linux-gnu --emit=check

The declaration is filtered out and selected is unavailable. Changing only the attribute to loongarch64 makes it available.

Scope

Normalize loong64 to loongarch64 in frontend architecture matching, including the existing case/whitespace normalization. Preserve unknown architecture strings and the canonical spelling.

Difficulty: easy.

Completion criteria

  • Both spellings select the same declarations for the LoongArch64 target.
  • Canonical-name unit tests cover both aliases and mixed case.
  • Other architectures and unknown future architecture strings keep their behavior.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    cross-platform
    on Sep 26, 2026
  2. self-assigned this
    on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cross-platformenhancementgood first issuehelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions