This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Add LoongArch to config.guess
ClosedPublic

Authored by xen0n on Jul 30 2022, 6:37 AM.

Details

Summary

Necessary for native builds on LoongArch. Only Linux is added for now,
matching upstream config.git changes.

Unfortunately, the upstream config.guess is GPLv3+ since 2012, and
LLVM is without autoconf support for a long time, so the script's
licensing exception no longer works and a bump could not be trivially
done.

This is the same as the upstream commit adding LoongArch,
but rewritten to match the 2011 style that our script is holding on
to.

Diff Detail

Event Timeline

xen0n created this revision.Jul 30 2022, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2022, 6:37 AM
xen0n requested review of this revision.Jul 30 2022, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2022, 6:37 AM
xen0n added a subscriber: gonglingqin.
MaskRay accepted this revision.Jul 30 2022, 10:38 AM

LGTM.

This revision is now accepted and ready to land.Jul 30 2022, 10:38 AM
SixWeining added inline comments.Jul 31 2022, 3:49 AM
llvm/cmake/config.guess
925

I'm not sure it exists or not. Let me double check with others internally. Thanks.

926

Unlike the upstream config.git, this file misses the initialization of LIBC. Perhaps we can use gnu for now?

xen0n updated this revision to Diff 448849.Jul 31 2022, 3:55 AM

Fix libc detection; the 2011 script is not initializing $LIBC beforehand.

xen0n added inline comments.Jul 31 2022, 3:58 AM
llvm/cmake/config.guess
925

IIRC it was planned to be something like the MIPS n32, but due to the later shift to the RISC-V-like model it should no longer exist. The "LPX32" ABI should never see the light of day.

But again here I'm just updating the script to match the upstream behavior. If loongarchx32 should be deleted here, then the upstream config.git should get updated too.

926

I just found out this a few minutes ago (in my test repo I just copied over the upstream script so I didn't notice). Fixed.

SixWeining accepted this revision.Jul 31 2022, 8:21 PM

LGTM. Thanks.

llvm/cmake/config.guess
925

I agree with you. Let's remove it after upstream config.git has done so.

Note to $random_passer_by_with_commit_access: I don't currently have commit access, so please help me land the patch (and also D130821 which is also accepted) at your leisure. Thanks.

This revision was landed with ongoing or failed builds.Aug 1 2022, 12:07 AM
This revision was automatically updated to reflect the committed changes.