Skip to content

[compiler-rt] Only query llvm-config in the orc tests #83705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions compiler-rt/test/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,22 +738,6 @@ def is_windows_lto_supported():
if config.have_rpc_xdr_h:
config.available_features.add("sunrpc")

# Ask llvm-config about assertion mode.
try:
llvm_config_cmd = subprocess.Popen(
[os.path.join(config.llvm_tools_dir, "llvm-config"), "--assertion-mode"],
stdout=subprocess.PIPE,
env=config.environment,
)
except OSError as e:
print("Could not launch llvm-config in " + config.llvm_tools_dir)
print(" Failed with error #{0}: {1}".format(e.errno, e.strerror))
exit(42)

if re.search(r"ON", llvm_config_cmd.stdout.read().decode("ascii")):
config.available_features.add("asserts")
llvm_config_cmd.wait()

# Sanitizer tests tend to be flaky on Windows due to PR24554, so add some
# retries. We don't do this on otther platforms because it's slower.
if platform.system() == "Windows":
Expand Down
12 changes: 12 additions & 0 deletions compiler-rt/test/orc/lit.cfg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- Python -*-

import os
import subprocess

# Setup config name.
config.name = "ORC" + config.name_suffix
Expand Down Expand Up @@ -79,3 +80,14 @@ def build_invocation(compile_flags):

if config.host_os not in ["Darwin", "FreeBSD", "Linux", "Windows"]:
config.unsupported = True

# Ask llvm-config about assertion mode.
try:
llvm_config_result = subprocess.check_output(
[os.path.join(config.llvm_tools_dir, "llvm-config"), "--assertion-mode"],
env=config.environment,
)
if llvm_config_result.startswith(b"ON"):
config.available_features.add("asserts")
except OSError as e:
lit_config.warning(f"Could not determine if LLVM was built with assertions: {e}")