Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/nativeaot/NativeLibrary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ where `<Configuration>` is your project configuration (such as Debug or Release)

The above command will drop a static library (Windows `.lib`, OSX/Linux `.a`) in `./bin/[configuration]/netstandard2.0/[RID]/publish/` folder and will have the same name as the folder in which your source file is present.

<!-- markdownlint-disable MD033 -->
<details>
<summary>Extra requirements to link static libraries produced by .NET 7 (click to expand)</summary>
When linking the generated static library, it is important to also include additional framework dependencies in the linker settings, and add `NativeAOT_StaticInitialization` to the symbol table. This can be accomplished by appending the following flag to the linker settings:

* Windows: `/INCLUDE:NativeAOT_StaticInitialization`
* Linux: `-Wl,--require-defined,NativeAOT_StaticInitialization`
* macOS: `-Wl,-u,_NativeAOT_StaticInitialization`

</details>
<!-- markdownlint-enable MD033 -->

You can find a list of additional framework libraries by publishing the project as shared library (`/p:NativeLib=Shared`) with detailed verbosity (`-v d`), and looking at the output generated by the `LinkNative` target.

## References
Expand Down