Skip to content

Commit

Permalink
litecross: force gcc to use init/fini arrays
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richfelker committed Jul 9, 2021
1 parent 5b40568 commit 3398364
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions litecross/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 3398364

Please sign in to comment.