Skip to content

Overly dramatic error when trying to use wrong mcmodel with aarch64 targets. #46116

Closed
@qookei

Description

@qookei
Bugzilla Link 46772
Version 10.0
OS Linux
Attachments empty-8d13f1.sh
CC @qookei,@zygoloid

Extended Description

When compiling any bit of code (even an empty file) with for example "-target aarch64-none-elf" or any other aarch64 target, if "-mcmodel=kernel" is specified, the compiler prints an overly dramatic fatal error with a stack trace, and a plea to submit a bug report.

Sample output (no, there actually is no stack trace printed in this case for whatever reason):
$ touch empty.cpp
$ clang++ -target aarch64-none-elf -mcmodel=kernel empty.cpp
fatal error: error in backend: Only small, tiny and large code models are allowed on AArch64
clang-10: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 10.0.0
Target: aarch64-none-unknown-elf
Thread model: posix
InstalledDir: /usr/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
clang-10: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/empty-8d13f1.cpp
clang-10: note: diagnostic msg: /tmp/empty-8d13f1.sh
clang-10: note: diagnostic msg:


$

Attached is the empty-8d13f1.sh file; following is the empty-8d13f1.cpp contents:

1 ""

1 "empty.cpp"

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:AArch64bugzillaIssues migrated from bugzillacrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions