Page MenuHomePhabricator

[Clang][Driver] Handle LoongArch multiarch tuples
Needs ReviewPublic

Authored by xen0n on Jan 26 2023, 10:39 PM.

Details

Summary

This follows v1.00 of the LoongArch Toolchain Conventions.

Only loongarch64 is implemented in Linux::getMultiarchTriple
because support for LA32 and ILP32* ABIs are incomplete right now.

Diff Detail

Event Timeline

xen0n created this revision.Jan 26 2023, 10:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 10:39 PM
xen0n requested review of this revision.Jan 26 2023, 10:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 10:39 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
SixWeining added inline comments.Jan 28 2023, 6:12 PM
clang/lib/Driver/ToolChains/Linux.cpp
41

Missing test. Perhaps add some in clang/test/Driver/linux-ld.c and clang/test/Driver/linux-header-search.cpp? Or postpone this change until loongarch is upstreamed to Debian?

93

Should only check {GNU|GNUF32|GNUF64}?

95

Should only check Triple::Musl?

MaskRay added inline comments.Jan 28 2023, 9:34 PM
clang/lib/Driver/ToolChains/Linux.cpp
116

return (... + ...).str(); if an operand of + is a Twine

xen0n added inline comments.Jan 31 2023, 8:17 PM
clang/lib/Driver/ToolChains/Linux.cpp
41

Thanks, I'll try adding the tests in the next revision.

But given the recent reversal of upstream dpkg support (apparently due to miscommunication) it may be prudent to wait until a consensus is reached Debian-side.

93

While technically only gnu{,sf,f32,f64} are permitted by the LoongArch Toolchain Conventions (with the bare -gnu being somewhat de-facto standard but not officially so), I believe the user's intent to specify a GNU environment still holds even in cases of "errors" like applying "gnuabi64" or "gnueabi" to LoongArch. Same applies for the musl case.

95

Explained above in the GNU case.

116

Thanks, will change in next revision.

SixWeining added inline comments.Thu, Mar 16, 1:01 AM
clang/lib/Driver/ToolChains/Arch/LoongArch.cpp
66

Better to be f? (Probably most 32-bit hardwares do not support double-float? But I'm not sure about this.)

clang/lib/Driver/ToolChains/Linux.cpp
41

The multiarch tuples have been upstreamed to dpkg. I think we can amend the change and move on now.

xry111 added inline comments.Thu, Mar 16, 1:08 AM
clang/lib/Driver/ToolChains/Arch/LoongArch.cpp
66

The ISA manual says 64-bit float support is not limited by 32-bit basic ISA support (except the moving instructions accessing 64-bit GPR).