Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker warning when generating native dynamic .NET 5 library on MacOS #430

Closed
BasTossings opened this issue Dec 6, 2020 · 2 comments
Closed
Labels
area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation

Comments

@BasTossings
Copy link

BasTossings commented Dec 6, 2020

When I compile my .net 5 class library into a native MacOS library I get the following linker warnings:

Generating native code
ld : warning : could not create compact unwind for _S_P_CoreLib_System_Number__Dragon4: stack subq instruction is too different from dwarf stack size [/Users/X/Documents/Source/AzureDevOps/Isotope/Frameworks/Aelian.Applications.MosNet.VST3Bootstrap/Aelian.Applications.MosNet.VST3Bootstrap.csproj]
ld : warning : can't parse dwarf compilation unit info in obj/Release/net5.0/osx-x64/native/Aelian.Applications.MosNet.VST3Bootstrap.o [/Users/X/Documents/Source/AzureDevOps/Isotope/Frameworks/Aelian.Applications.MosNet.VST3Bootstrap/Aelian.Applications.MosNet.VST3Bootstrap.csproj]

Is this going to give me trouble down the line?

I used dotnet publish /p:NativeLib=Shared -r osx-x64 -c Release to build the project

Also, on MacOS it produces a 14 MB dylib whereas the native windows x64 dll is only 5 MB. I used the following trimming options in the csproj:

<PropertyGroup>
    <IlcInvariantGlobalization>true</IlcInvariantGlobalization>
    <RootAllApplicationAssemblies>false</RootAllApplicationAssemblies>
    <IlcGenerateCompleteTypeMetadata>false</IlcGenerateCompleteTypeMetadata>
    <IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
</PropertyGroup>

Is there a reason the dylib is that much larger? And is there any way I can slim it down?

@jkotas
Copy link
Member

jkotas commented Dec 6, 2020

Is this going to give me trouble down the line?

We have not seen these warnings to result in real problems.

MacOS it produces a 14 MB dylib whereas the native windows x64 dll is only 5 MB

Is it after you have stripped the symbols? https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/optimizing.md#special-considerations-for-linuxmacos

@jkotas jkotas added the area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation label Dec 6, 2020
@MichalStrehovsky
Copy link
Member

Closing in favor of #956.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation
Projects
None yet
Development

No branches or pull requests

3 participants