Skip to content

[K/N] fixed GCC linker order #5418

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

vickyleu
Copy link

When building with Kotlin Native, all static libraries from klib files are extracted, but there is a lack of ordering/sorting for these static libraries. This can cause dependent static libraries to be linked in an unordered manner. Since the ld linker processes libraries sequentially from left to right during linking, the current modification introduces Konan properties that allow:

Ordered sorting of static libraries via -Xoverride-konan-properties=linkerStaticSortingRegexFlags="...",

Alternatively, performing multiple linking passes to resolve dependencies.

 // type1: "order@regex&order@regex&..."
 // type2: "--whole-archive"
 // type3: "--use-group"
 -Xoverride-konan-properties=linkerStaticSortingRegexFlags=--use-group;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants