This is an archive of the discontinued LLVM Phabricator instance.

[Clang][LoongArch] Pass the -mabi and -target-abi options to as and cc1as respectively
ClosedPublic

Authored by SixWeining on May 14 2023, 10:56 PM.

Details

Summary

This change is necessary to set correct EFlags according to the
options (-m*-float and -mabi=) passed to clang when input is assembly.

Note: -mabi= is not documented by as.

$ as --version
GNU assembler (GNU Binutils) 2.40.50.20230316
...
$ as --target-help
LARCH options:

But we can see gcc invokes as and passes the -mabi= option when compiling C or assembly.

$ gcc -c a.c -v 2>&1 -msoft-float | grep "as -v"
 as -v -mabi=lp64s -o a.o /tmp/ccFrxzZi.s
$ gcc -c a.s -v 2>&1 -msoft-float | grep "as -v"
 as -v -mabi=lp64s -o a.o a.s

Diff Detail

Event Timeline

SixWeining created this revision.May 14 2023, 10:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2023, 10:56 PM
SixWeining requested review of this revision.May 14 2023, 10:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2023, 10:56 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xen0n accepted this revision.May 14 2023, 11:16 PM
This revision is now accepted and ready to land.May 14 2023, 11:16 PM