This is an archive of the discontinued LLVM Phabricator instance.

Check default target triple during config
Needs ReviewPublic

Authored by urnathan on Apr 14 2023, 12:13 PM.

Details

Summary

I wasted some time setting a default target triple to 'arm-eabi', thinking it would be canonicalized. The build succeeded but testing blew up because utils/lit/lit/llvm/config.py has:

def make_itanium_abi_triple(self, triple):
     m = re.match(r'(\w+)-(\w+)-(\w+)', triple)
    ...

and that regex expects at least two '-'. Notice that regex isn't anchored and some triplets have '.' (solaris2.10 is the example I recall, dunno if anyone cares enough now though, it also doesn't affect the semantics of what's being checked there either.)

Anyway, this inserts a regex check in set_llvm_target_triplet to look for something at least reasonable at cmake config time -- somewhat earlier.

Includes a bit of line wrap reformatting while there.

Diff Detail

Event Timeline

urnathan created this revision.Apr 14 2023, 12:13 PM
urnathan requested review of this revision.Apr 14 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 12:13 PM
urnathan edited the summary of this revision. (Show Details)Apr 14 2023, 12:18 PM
urnathan added reviewers: nicolerabjohn, chandlerc.