This is an archive of the discontinued LLVM Phabricator instance.

Test infra: expose CFLAGS_NO_ARCH for use by test custom build rules
AbandonedPublic

Authored by tfiala on Oct 24 2016, 1:11 PM.

Details

Reviewers
jingham
labath
Summary

The TestUniversal.py test was attempting to build its own CFLAGS unreliably. Essentially it just wanted the prevailing CFLAGS without the arch spec.

This change does the following:

  • introduces a new makefile variable CFLAGS_NO_ARCH, which custom build rules can use to grab the prevailing CFLAGS for the build without the arch-specific flags, and
  • uses this new flag in TestUniversal.py's Makefile, eliminating the divergence it had from the CFLAGS used for standard test inferiors.

Diff Detail

Event Timeline

tfiala updated this revision to Diff 75636.Oct 24 2016, 1:11 PM
tfiala retitled this revision from to Test infra: expose CFLAGS_NO_ARCH for use by test custom build rules.
tfiala updated this object.
tfiala added reviewers: jingham, labath.
tfiala added a subscriber: lldb-commits.
labath edited edge metadata.Oct 25 2016, 4:24 AM

I am not that excited by this, but I don't see a much better way to achieve the result. :)
Possibly I'd consider making the variable name positive (instead of CFLAGS_NO_DEBUG, have a INCLUDES var, and then the test can use $(INCLUDES) $(TRIPLE_CFLAGS)).

Python/lldbsuite/test/make/Makefile.rules
197

Are you sure this won't actually be missed on darwin for other tests? -archi386 does not seem to be a valid argument to clang (you need the space here).

I am not that excited by this, but I don't see a much better way to achieve the result. :)
Possibly I'd consider making the variable name positive (instead of CFLAGS_NO_DEBUG, have a INCLUDES var, and then the test can use $(INCLUDES) $(TRIPLE_CFLAGS)).

Jim and I tried a few different ways to skin this. The actual problem shows up on some CI downstream from here, where we need (but fail to get) the isysroot settings. Those are built with a few more variables that have not yet moved up into the Makefile rules in LLVM.org.

The other way to skin this, since it is a macOS only test, is to strip out the arch flags in the TestUniversal Makefile. This approach would work both here and downstream since it doesn't require accessing Makefile variables that don't exist here.

I'll come back with something slightly different here.

Python/lldbsuite/test/make/Makefile.rules
197

Hmm I ran it through x86_64 and that worked. I didn't try i386. I'll give that a shot. If it blows up, I'll have a look at why a space is needed in one case and not the other on the macOS clang. Thanks for highlighting. (It looked like a meaningless divergence that I thought perhaps came from code motion over time).

tfiala abandoned this revision.Dec 15 2016, 4:18 PM

@jingham, there may be some reconciliation needed between here and swift-lldb.

I'm bowing out of this one.