Skip to content

LinkerArg doesn't seem to work on net8.0-macos NativeAOT app #97414

@vaind

Description

@vaind

Description

LinkerArg doesn't seem to work when publishing NativeAOT targeting net8.0-macos. Maybe I'm missing something, or misinterpreting the reproduction steps but at least that's what it looks like. The actual issue where I'm coming from is that the linker fails when adding a static library that depends on curl, even when -lcurl is added as LinkerArg. The same works just fine when targeting net8.0

Reproduction Steps

Steps to Reproduce

  1. Create new macOS app: dotnet new macos
  2. Add <PublishAot>true</PublishAot> to .csproj
  3. Add some linker args that should fail the build, e.g.
  <ItemGroup>
    <LinkerArg Include="-foobar"/>
    <LinkerArg Include="-lnonexistentlib"/>
  </ItemGroup>
  1. dotnet publish -flp:logfile=build.log --runtime=osx-arm64

Expected behavior

publishing fails

Actual behavior

publishing succeeds

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

Related to:

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions