Skip to content

Runtime dylibs can't be stripped: error: symbols referenced by indirect symbol table entries that can't be stripped in: #124570

@rolfbjarne

Description

@rolfbjarne

Repro:

#!/bin/bash -eux

PKG=Microsoft.NETCore.App.Runtime.osx-x64
curl -L https://www.nuget.org/api/v2/package/$PKG/11.0.0-preview.1.26104.118 -o $PKG.nupkg

rm -rf nupkg
unzip -d nupkg $PKG.nupkg 'runtimes/osx-x64/native/libcoreclr.dylib'

xcrun strip nupkg/runtimes/osx-x64/native/libcoreclr.dylib

Result:

$ ./test.sh
+ PKG=Microsoft.NETCore.App.Runtime.osx-x64
+ curl -L https://www.nuget.org/api/v2/package/Microsoft.NETCore.App.Runtime.osx-x64/11.0.0-preview.1.26104.118 -o Microsoft.NETCore.App.Runtime.osx-x64.nupkg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   266    0   266    0     0    453      0 --:--:-- --:--:-- --:--:--   454
100 37.5M  100 37.5M    0     0  34.5M      0  0:00:01  0:00:01 --:--:-- 90.2M
+ rm -rf nupkg
+ unzip -d nupkg Microsoft.NETCore.App.Runtime.osx-x64.nupkg runtimes/osx-x64/native/libcoreclr.dylib
Archive:  Microsoft.NETCore.App.Runtime.osx-x64.nupkg
  inflating: nupkg/runtimes/osx-x64/native/libcoreclr.dylib
+ xcrun strip nupkg/runtimes/osx-x64/native/libcoreclr.dylib
/Applications/Xcode_26.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: error: symbols referenced by indirect symbol table entries that can't be stripped in: /Users/rolf/test/nupkg/runtimes/osx-x64/native/libcoreclr.dylib
_CCRandomGenerateBytes
_CFRelease
_CFStringCreateWithCString
_CFUserNotificationDisplayAlert
_SessionGetInfo
__NSGetEnviron
__NSGetExecutablePath
__Unwind_Resume
__ZSt9terminatev
[... numerous other symbols ... ]

I'm not sure if this is the expected behavior (i.e. these dylibs shouldn't be stripped), or if there's a bug somewhere, but filing an issue to get clarification on this at least.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions