Skip to content
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

[clang] Remove support for old libcheri libcompat directory #707

Merged
merged 2 commits into from
Jul 5, 2023
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
5 changes: 0 additions & 5 deletions clang/lib/Driver/ToolChains/FreeBSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,10 @@ FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &Triple,
// When targeting 32-bit platforms, look for '/usr/lib32(c)/crt1.o' and fall
// back to '/usr/lib' if it doesn't exist. We also do the same for 64-bit
// targets with '/usr/lib64(c)'.
// XXX: For backwards-compatibility we have an extra '/usr/libcheri' fallback
// for purecap; remove this once it is no longer needed.
std::string CompatLib = (Twine("lib") + (Triple.isArch32Bit() ? "32" : "64") +
(IsCheriPurecap ? "c" : "")).str();
if (D.getVFS().exists(getDriver().SysRoot + "/usr/" + CompatLib + "/crt1.o"))
getFilePaths().push_back(getDriver().SysRoot + "/usr/" + CompatLib);
else if (IsCheriPurecap &&
D.getVFS().exists(getDriver().SysRoot + "/usr/libcheri/crt1.o"))
getFilePaths().push_back(getDriver().SysRoot + "/usr/libcheri");
else
getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
}
Expand Down
33 changes: 0 additions & 33 deletions clang/test/Driver/cheri/freebsd-cheri-libcheri.c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Check that we use the lib64 directory if it is available
/// Check that we use the lib32/lib64 directory if it is available
// RUN: %cheri_clang -no-canonical-prefixes \
// RUN: %s --sysroot=%S/Inputs/basic_cheribsd_libcompat_tree -### 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-HYBRID,CHECK-CHERI-HYBRID64 %s
Expand All @@ -9,7 +9,6 @@
// RUN: %s --sysroot=%S/Inputs/basic_cheribsd_libcompat_tree -### 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-HYBRID,CHECK-CHERI-HYBRID64 %s
// CHECK-CHERI-HYBRID: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
// TODO: should probably set /libexec/ld-elf64.so.1
// CHECK-CHERI-HYBRID: "-dynamic-linker" "/libexec/ld-elf.so.1"
// CHECK-CHERI-HYBRID64: "[[SYSROOT]]/usr/lib64/crt1.o"
// CHECK-CHERI-HYBRID32: "[[SYSROOT]]/usr/lib32/crt1.o"
Expand All @@ -19,16 +18,16 @@
// CHECK-CHERI-HYBRID: "crtend.o"
// CHECK-CHERI-HYBRID: "crtn.o"

/// Purecap should never look at lib64:
/// Check that we use the lib32c/lib64c directory if it is available
// RUN: %cheri_purecap_clang -no-canonical-prefixes -no-pie \
// RUN: %s --sysroot=%S/Inputs/basic_cheribsd_libcompat_tree -### 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-PURECAP %s
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-PURECAP,CHECK-CHERI-PURECAP64 %s
// RUN: %riscv32_cheri_purecap_clang -no-canonical-prefixes -no-pie \
// RUN: %s --sysroot=%S/Inputs/basic_cheribsd_libcompat_tree -### 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-PURECAP %s
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-PURECAP,CHECK-CHERI-PURECAP32 %s
// RUN: %riscv64_cheri_purecap_clang -no-canonical-prefixes -no-pie \
// RUN: %s --sysroot=%S/Inputs/basic_cheribsd_libcompat_tree -### 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-PURECAP %s
// RUN: | FileCheck --check-prefixes=CHECK-CHERI-PURECAP,CHECK-CHERI-PURECAP64 %s
// PURECAP-MIPS128: "-cc1" "-triple" "mips64c{{128|256}}-unknown-freebsd-purecap"
// PURECAP-MIPS128: "-target-abi" "purecap"
// PURECAP-RISCV32: "-cc1" "-triple" "riscv32-unknown-freebsd"
Expand All @@ -37,9 +36,12 @@
// PURECAP-RISCV64: "-target-abi" "l64pc128"
// CHECK-CHERI-PURECAP: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-CHERI-PURECAP: "-dynamic-linker" "/libexec/ld-elf.so.1"
// CHECK-CHERI-PURECAP: "crt1.o" "crtbegin.o"
// CHECK-CHERI-PURECAP64: "[[SYSROOT]]/usr/lib64c/crt1.o"
// CHECK-CHERI-PURECAP32: "[[SYSROOT]]/usr/lib32c/crt1.o"
// CHECK-CHERI-PURECAP-NOT: "crti.o"
// CHECK-CHERI-PURECAP: "-L[[SYSROOT]]/usr/lib"
// CHECK-CHERI-PURECAP: "crtbegin.o"
// CHECK-CHERI-PURECAP64: "-L[[SYSROOT]]/usr/lib64c"
// CHECK-CHERI-PURECAP32: "-L[[SYSROOT]]/usr/lib32c"
// CHECK-CHERI-PURECAP: "crtend.o"
// CHECK-CHERI-PURECAP-NOT: "crtn.o"

Expand Down