[PATCH] D89696: [OpenMP] Fixing OpenMP/driver.c failing on 32-bit hosts

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 06:57:40 PDT 2020


jhuber6 updated this revision to Diff 299672.
jhuber6 added a comment.

Changing test to be similar to LLVM's method, checks the linker flags for 32-bit library and only if the target triple is one of the known 64-bit triples.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89696/new/

https://reviews.llvm.org/D89696

Files:
  clang/test/lit.cfg.py
  clang/test/lit.site.cfg.py.in


Index: clang/test/lit.site.cfg.py.in
===================================================================
--- clang/test/lit.site.cfg.py.in
+++ clang/test/lit.site.cfg.py.in
@@ -31,6 +31,7 @@
 config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
 config.has_plugins = @LLVM_ENABLE_PLUGINS@
 config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
+config.host_ldflags = '@HOST_LDFLAGS@'
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: clang/test/lit.cfg.py
===================================================================
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -1,7 +1,6 @@
 # -*- Python -*-
 
 import os
-import sys
 import platform
 import re
 import subprocess
@@ -168,11 +167,14 @@
 if platform.system() not in ['Windows']:
     config.available_features.add('can-remove-opened-file')
 
-# Check 64-bit host
-if sys.maxsize > 2**32:
+# Features
+known_arches = ["x86_64", "mips64", "ppc64", "aarch64"]
+if (config.host_ldflags.find("-m32") < 0
+    and any(config.host_triple.startswith(x) for x in known_arches)):
   config.available_features.add("clang-64-bits")
 
 
+
 def calculate_arch_features(arch_string):
     features = []
     for arch in arch_string.split():


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89696.299672.patch
Type: text/x-patch
Size: 1322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201021/a83dc0ca/attachment.bin>


More information about the cfe-commits mailing list