Skip to content

[Driver] Remove FreeBSD/riscv32 support #67277

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
merged 1 commit into from
Sep 25, 2023

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Sep 25, 2023

FreeBSD does not support riscv32 and has no intention of doing so.

FreeBSD does not support riscv32 and has no intention of doing so.
@brad0 brad0 requested a review from emaste September 25, 2023 02:34
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Sep 25, 2023
@llvmbot
Copy link
Member

llvmbot commented Sep 25, 2023

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Changes

FreeBSD does not support riscv32 and has no intention of doing so.


Full diff: https://github.com/llvm/llvm-project/pull/67277.diff

4 Files Affected:

  • (modified) clang/lib/Basic/Targets.cpp (-3)
  • (modified) clang/lib/Driver/ToolChains/FreeBSD.cpp (-5)
  • (modified) clang/test/Driver/freebsd.c (-3)
  • (modified) clang/test/Preprocessor/predefined-macros-no-warnings.c (-1)
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 35d1d0d2c45c530..80822f65662850d 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -430,9 +430,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
 
   case llvm::Triple::riscv32:
     switch (os) {
-    case llvm::Triple::FreeBSD:
-      return std::make_unique<FreeBSDTargetInfo<RISCV32TargetInfo>>(Triple,
-                                                                    Opts);
     case llvm::Triple::NetBSD:
       return std::make_unique<NetBSDTargetInfo<RISCV32TargetInfo>>(Triple,
                                                                    Opts);
diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp
index 4c46861bbbd74ef..67a8bb863b3b6b0 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -210,11 +210,6 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     else
       CmdArgs.push_back("elf64ltsmip_fbsd");
     break;
-  case llvm::Triple::riscv32:
-    CmdArgs.push_back("-m");
-    CmdArgs.push_back("elf32lriscv");
-    CmdArgs.push_back("-X");
-    break;
   case llvm::Triple::riscv64:
     CmdArgs.push_back("-m");
     CmdArgs.push_back("elf64lriscv");
diff --git a/clang/test/Driver/freebsd.c b/clang/test/Driver/freebsd.c
index 8ac0cb011638a8a..afa0a17249851b3 100644
--- a/clang/test/Driver/freebsd.c
+++ b/clang/test/Driver/freebsd.c
@@ -73,9 +73,6 @@
 //
 // Check that RISC-V passes the correct linker emulation.
 //
-// RUN: %clang --target=riscv32-freebsd -### %s %s 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-RV32I-LD %s
-// CHECK-RV32I-LD: ld{{.*}}" {{.*}} "-m" "elf32lriscv"
 // RUN: %clang --target=riscv64-freebsd -### %s %s 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-RV64I-LD %s
 // CHECK-RV64I-LD: ld{{.*}}" {{.*}} "-m" "elf64lriscv"
diff --git a/clang/test/Preprocessor/predefined-macros-no-warnings.c b/clang/test/Preprocessor/predefined-macros-no-warnings.c
index 56573af6fc7ba82..e0617f8de4da385 100644
--- a/clang/test/Preprocessor/predefined-macros-no-warnings.c
+++ b/clang/test/Preprocessor/predefined-macros-no-warnings.c
@@ -103,7 +103,6 @@
 // RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple amdgcn
 // RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple r600
 // RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv32
-// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv32-freebsd
 // RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv32-linux
 // RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64
 // RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64-freebsd

Copy link
Member

@emaste emaste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure; we're generally moving away from supporting any 32-bit platforms so it is exceedingly unlikely that we would add riscv32 support.

@brad0 brad0 merged commit c1300ef into llvm:main Sep 25, 2023
@brad0 brad0 deleted the clang_driver_freebsd_riscv32 branch September 25, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants