kotlin
                                
                                 kotlin copied to clipboard
                                
                                    kotlin copied to clipboard
                            
                            
                            
                        [K/N] fixed GCC linker order
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;