Skip to content

ILCompiler in .NET9 for FreeBSD does not produce usable binaries #105358

@Thefrank

Description

@Thefrank

Description

Under FreeBSD, .NET9 the ILCompiler (/p:PublishAOT=true) does not generate usable binaries. Even a simple "Hello, World!"

Discovered #104497 (comment) as a part of #104497

Reproduction Steps

Copied in part from above issue:

./dotnet --version
9.0.100-preview.5.24307.3
---

# ./dotnet new console -o /root/test
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /root/test/test.csproj:
Restore succeeded.
---

# ./dotnet publish -c Release /root/test/test.csproj /p:PublishAot=true -t:Rebuild && /root/test/bin/Release/net9.0/freebsd-x64/publish/test
Restore complete (4.4s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  test succeeded (18.8s) → /root/test/bin/Release/net9.0/freebsd-x64/publish/

Build succeeded in 25.6s
Segmentation fault (core dumped)

Expected behavior

Hello, World!

Actual behavior

Segmentation fault (core dumped)

Regression?

Yes. This works in .NET8

# ./dotnet --version
8.0.100

---
# ./dotnet new console -o /root/testnet8/
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /root/testnet8/testnet8.csproj:
  Determining projects to restore...
  Restored /root/testnet8/testnet8.csproj (in 1.62 sec).
Restore succeeded.
---
./dotnet publish -c Release /root/testnet8/testnet8.csproj /p:PublishAot=true -t:Rebuild && /root/testnet8/bin/Release/net8.0/freebsd-x64/publish/testnet8
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored /root/testnet8/testnet8.csproj (in 3.75 sec).
  testnet8 -> /root/testnet8/bin/Release/net8.0/freebsd-x64/testnet8.dll
  Generating native code
  testnet8 -> /root/testnet8/bin/Release/net8.0/freebsd-x64/publish/
Hello, World!

Known Workarounds

No known workarounds

Configuration

Versions used: .NET8 (8.0.100) and .NET9 (9.0.100-preview.5.24307.3)
OS: FreeBSD 13.3 & 14.1
Arch: (x64)

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions