Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 29 Dec 2020 12:56:53 +0100
From: Charlotte Delenk <>
Subject: [PATCH 1/2] Fix LTO shared library build on GCC and Clang

Both GCC and Clang are currently unable to compile the musl dynamic
library with link time optimizations enabled, due to them overzealously
removing certain symbols used on program start which they deem are not

This patch adds new link flags to the link that tell the linker
that a symbol is used externally, so that code for these functions is
always emitted.
  Makefile | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index e8cc4436..15190fb9 100644
--- a/Makefile
+++ b/Makefile
@@ -131,6 +131,9 @@ $(CRT_OBJS): CFLAGS_ALL += -DCRT


+# Work around LTO compiler bugs
+lib/ CFLAGS_ALL += -u_dlstart_c -u__dls2 -u__dls2b -u__dls3 
-u__stack_chk_guard -u_start_c
  CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<

  # Choose invocation of assembler to be used

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.