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