Skip to content

Command line option -mno-strict-align valid for C input but not valid for object input? #87945

@sh1boot

Description

@sh1boot

No problem with this:

$ clang-19 --target=riscv64-linux-gnu -march=rv64gcv -mno-strict-align test.c

But if you compile it and then try to pass the object file it becomes a problem:

$ clang-19 --target=riscv64-linux-gnu -march=rv64gcv -mno-strict-align test.o
clang-19: error: unsupported option '-mno-strict-align' for target 'riscv64-linux-gnu'

The same thing happens with --target=aarch64-linux-gnu.

And some build tools seem to like mixing CFLAGS in on top of LDFLAGS to make this a serious impediment.

Curiously, for -munaligned-access RISC-V seems to have this problem the other way around, where it's only accepted with object files; while aarch64 has no problem with that switch in either case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions