Skip to content

clang fails because response files have BOM #132378

Closed

Description

@corngood

Description

https://github.com/dotnet/runtime/pull/128553/changes#diff-a8c821001409a0c4d6589a59e663d4d07e53b0127b345f17640410828c580b37R433

This change introduced response files which are written like:

    <WriteLinesToFile File="%(_AggregateExecutableReferencePath.ShimCompileLinkRspFile)" Lines="@(_AggregateExecutableShimCompilerAndLinkerArg);&quot;%(_AggregateExecutableReferencePath.ShimSource)&quot;;@(_AggregateExecutableShimNativeLibraryArg);-o;&quot;%(_AggregateExecutableReferencePath.ShimBinary)&quot;" Overwrite="true" Encoding="utf-8" WriteOnlyWhenDifferent="true" />

The Encoding="utf-8" causes them to have a BOM, which clang doesn't like.

Cc: @MichalStrehovsky

Reproduction Steps

I get this when building VMR v11.0.0-preview.7.26381.103 from nixpkgs (NixOS/nixpkgs#552339).

The clang error happens when building aspnetcore.

Expected behavior

VMR builds correctly.

Actual behavior

clang : error : no such file or directory: '-fuse-ld=bfd' [/var/tmp/nix-shell.GRrUp4/dotnet-11.0.100-preview.7.26381.103/src/aspnetcore/src/Tools/NativeAot/aspnetcoretools/aspnetcoretools.csproj]
/var/tmp/nix-shell.GRrUp4/dotnet-11.0.100-preview.7.26381.103/src/aspnetcore/artifacts/.packages/microsoft.dotnet.ilcompiler/11.0.0-preview.7.26381.103/build/Microsoft.NETCore.Native.Unix.targets(417,5): error MSB3073: The command ""/nix/store/9r3c3di5srkvkqzhvq66aggpl95630vk-clang-wrapper-20.1.8/bin/clang" @"/var/tmp/nix-shell.GRrUp4/dotnet-11.0.100-preview.7.26381.103/src/aspnetcore/artifacts/obj/aspnetcoretools/Release/net11.0/linux-x64/native/dotnet-dev-certs.aggregateexe.rsp"" exited with code 1. [/var/tmp/nix-shell.GRrUp4/dotnet-11.0.100-preview.7.26381.103/src/aspnetcore/src/Tools/NativeAot/aspnetcoretools/aspnetcoretools.csproj]

Regression?

No response

Known Workarounds

Removing the encoding attribute from the WriteLinesToFile tasks for response files fixes the build.

Configuration

$ clang --version
clang version 20.1.8
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/7a7i8r23rkz7xshivsgk1rgj6ax7zqbl-clang-20.1.8/bin

Other information

No response

Activity

  1. corngood commented on Aug 17, 2026

    @corngood
    ContributorAuthor

    I can't find a recent version of gcc or clang that accepts response files with a BOM that start with -fuse-ld=bfd. They all seem to fail in the same way (treating it as an input filename).

  2. dotnet-policy-service commented on Aug 17, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
    See info in area-owners.md if you want to be subscribed.

  3. added a commit that references this issue on Aug 17, 2026
    76be9c1
  4. added a commit that references this issue on Aug 17, 2026
    85c082e
  5. locked and limited conversation to collaborators on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions