Allow building on FreeBSD/i386

Open
#114,705 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
cmake

Research direction

Start with eng/native/configureplatform.cmake and eng/native/configurecompiler.cmake, focusing on the existing Unix architecture and FreeBSD detection branches. Build using the lang/dotnet-host port on FreeBSD/i386 and verify that the runtime executable can be attempted without an unsupported-architecture failure. Done means both files recognize FreeBSD/i386 consistently and the reported build succeeds or proceeds to its actual platform limitations.

Written by the indexing model from the issue text.

Description

arch-x86 area-Meta os-freebsd

Generally, I don't think, explicitly prohibiting build on a platform is wise. If it fails -- it fails, but it should not be prevented from trying...

In particular, the below patch allows build to be attempted on FreeBSD/i386 -- setting the already used CLR_CMAKE_HOST_UNIX_X86:

--- eng/native/configureplatform.cmake	2025-03-13 17:40:22.000000000 -0400
+++ eng/native/configureplatform.cmake	2025-04-15 11:53:10.858273000 -0400
@@ -168,4 +168,6 @@
     elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
         set(CLR_CMAKE_HOST_UNIX_ARM64 1)
+    elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i386)
+        set(CLR_CMAKE_HOST_UNIX_X86 1)
     else()
         clr_unknown_arch()
--- eng/native/configurecompiler.cmake	2025-03-13 17:40:22.000000000 -0400
+++ eng/native/configurecompiler.cmake	2025-04-15 11:55:26.890280000 -0400
@@ -429,4 +429,6 @@
     elseif(CLR_CMAKE_HOST_UNIX_AMD64)
       message("Detected FreeBSD amd64")
+    elseif(CLR_CMAKE_HOST_UNIX_X86)
+      message("Detected FreeBSD i386")
     else()
       message(FATAL_ERROR "Unsupported FreeBSD architecture")

With the above changes, I was able to build the dotnet-executable on my FreeBSD-14/i386 here using the lang/dotnet-host port.

Maybe, if this is merged, the boostrap binaries -- which our lang/dotnet port is using -- will eventually appear.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.