[libcxx] r220724 - Add special case handling of linux target triples that do not contain `-gnu`.
Hal Finkel
hfinkel at anl.gov
Tue Oct 28 07:51:07 PDT 2014
----- Original Message -----
> From: "Eric Fiselier" <eric at efcs.ca>
> To: cfe-commits at cs.uiuc.edu
> Sent: Monday, October 27, 2014 5:14:25 PM
> Subject: [libcxx] r220724 - Add special case handling of linux target triples that do not contain `-gnu`.
>
> Author: ericwf
> Date: Mon Oct 27 17:14:25 2014
> New Revision: 220724
>
> URL: http://llvm.org/viewvc/llvm-project?rev=220724&view=rev
> Log:
> Add special case handling of linux target triples that do not contain
> `-gnu`.
>
> For targets that end it `redhat-linux` and `suse-linux` manually add
> the `-gnu`
> section of the target since `linux-gnu` is needed in the testsuite.
>
> This patch also moves the removal of minor and patchlevel numbers
> from OSX
> triples to be handled when deducing the triple instead of when adding
> available
> features.
>
> Modified:
> libcxx/trunk/test/lit.cfg
>
> Modified: libcxx/trunk/test/lit.cfg
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=220724&r1=220723&r2=220724&view=diff
> ==============================================================================
> --- libcxx/trunk/test/lit.cfg (original)
> +++ libcxx/trunk/test/lit.cfg Mon Oct 27 17:14:25 2014
> @@ -349,13 +349,8 @@ class Configuration(object):
> # markers for tests that are known to fail with versions of
> libc++ as
> # were shipped with a particular triple.
> if self.use_system_lib:
> - # Drop sub-major version components from the triple,
> because the
> - # current XFAIL handling expects exact matches for
> feature checks.
> - sanitized_triple = re.sub(
> - r"([^-]+)-([^-]+)-([^-.]+).*", r"\1-\2-\3",
> - self.config.target_triple)
> self.config.available_features.add(
> - 'with_system_lib=%s' % sanitized_triple)
> + 'with_system_lib=%s' % self.config.target_triple)
>
> if 'libcpp-has-no-threads' in
> self.config.available_features:
> self.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
> @@ -456,8 +451,22 @@ class Configuration(object):
> # If no target triple was given, try to infer it from the
> compiler
> # under test.
> if not self.config.target_triple:
> - self.config.target_triple = lit.util.capture(
> + target_triple = lit.util.capture(
> [self.cxx, '-dumpmachine']).strip()
> + # Drop sub-major version components from the triple,
> because the
> + # current XFAIL handling expects exact matches for
> feature checks.
> + # Example: x86_64-unknown-linux-gnu ->
> x86_64-unknown-linux-gnu.
I don't understand this example, both look the same to me.
-Hal
> + # The 5th group handles triples greater than 3 parts
> + # (ex x86_64-pc-linux-gnu).
> + target_triple =
> re.sub(r'([^-]+)-([^-]+)-([^.]+)([^-]*)(.*)',
> + r'\1-\2-\3\5', target_triple)
> + # linux-gnu is needed in the triple to properly identify
> linuxes
> + # that use GLIBC. Handle redhat and opensuse triples as
> special
> + # cases and append the missing `-gnu` portion.
> + if target_triple.endswith('redhat-linux') or \
> + target_triple.endswith('suse-linux'):
> + target_triple += '-gnu'
> + self.config.target_triple = target_triple
> self.lit_config.note(
> "inferred target_triple as: %r" %
> self.config.target_triple)
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
--
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory
More information about the cfe-commits
mailing list