镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Link static libstdc++ with libicuc in NativeAOT - #79501

Merged
jkotas merged 4 commits into
dotnet:mainfrom
am11:feature/nativeaot/static-icu
Dec 12, 2022
Merged

jkotas merged 4 commits into
dotnet:mainfrom
am11:feature/nativeaot/static-icu

Conversation

@am11

@am11 am11 commented Dec 10, 2022 •

Copy link
Copy Markdown
Member

libicuc depends on libstdc++. Statically linking the ICU requires stdc++ to be linked. Also, to produce 100% static executable -Wl,-Bdynamic is unnecessary.

$ ldd --version 2>&1 | head -1
musl libc (aarch64)

$ dotnet publish -p:PublishAot=true -o dist
$ file dist/gh-79498
dist/gh-79498: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=8b2876d810f668a4713963382c5d31f635426b6f, with debug_info, not stripped

Fixes #79498

@ghost ghost added area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member labels Dec 10, 2022
@ghost

ghost commented Dec 10, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

libicuc depends on libstdc++. Statically linking the ICU requires stdc++ to be linked. Also, to produce 100% static executable -Wl,-Bdynamic is unnecessary.

$ uname -a
Linux 4405bca6c481 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 Linux

$ dotnet publish -p:PublishAot=true -o dist
$ file dist/gh-79498
dist/gh-79498: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=8b2876d810f668a4713963382c5d31f635426b6f, with debug_info, not stripped

Fixes #79498

Author: am11
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@am11
am11 requested a review from jkotas December 10, 2022 23:39
@am11
am11 force-pushed the feature/nativeaot/static-icu branch from a3ae425 to 9dde554 Compare December 10, 2022 23:43
@am11
am11 force-pushed the feature/nativeaot/static-icu branch from 9dde554 to 26c7c02 Compare December 11, 2022 00:40
@jkotas

jkotas commented Dec 11, 2022

Copy link
Copy Markdown
Member

@smhmhmd @Beau-Gosse-dev Does this change look good?

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@smhmhmd

smhmhmd commented Dec 12, 2022 •

Copy link
Copy Markdown
Contributor

@jkotas
Thanks for letting us know.
Looks good to me.

Also, progress on full-static builds for Alpine is awesome.

@jkotas

jkotas commented Dec 12, 2022

Copy link
Copy Markdown
Member

All known failures according to the build analysis

@jkotas
jkotas merged commit 21a8eb5 into dotnet:main Dec 12, 2022
kant2002 added a commit to kant2002/NativeAOTDocker that referenced this pull request Dec 26, 2022
dotnet/runtime#79501 is landed, so workaround is not needed
@ghost ghost locked as resolved and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NativeAOT on Alpine with StaticICULinking

3 participants