From 3398364d6e3251cd097024182a8cb9f667c23bda Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 9 Jul 2021 12:33:39 -0400 Subject: [PATCH] litecross: force gcc to use init/fini arrays I overlooked that GCC was not doing this by default for musl, since binutils ld automatically converts the .ctors/.dtors GCC emits to init/fini arrays at link time. unfortunately lld does not do the same, so without --enable-initfini-array, GCC produces object files that lld will mislink unless it was configured with support for legacy GCC ctors. --- litecross/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/litecross/Makefile b/litecross/Makefile index 8ec0ed2..9cd691b 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -78,6 +78,7 @@ FULL_GCC_CONFIG = --enable-languages=c,c++ \ --disable-libmudflap --disable-libsanitizer \ --disable-gnu-indirect-function \ --disable-libmpx \ + --enable-initfini-array \ --enable-libstdcxx-time=rt FULL_MUSL_CONFIG = $(MUSL_CONFIG) \