From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27405 invoked from network); 29 Dec 2020 11:57:17 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2020 11:57:17 -0000 Received: (qmail 9644 invoked by uid 550); 29 Dec 2020 11:57:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 9614 invoked from network); 29 Dec 2020 11:57:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=darkkirb.de; s=mail; t=1609243018; bh=zrr9uGxNdY/L7EGa9iL+Usq1J+qcZxnsSDU2FNqPAmE=; h=Subject:To:References:From:Date:In-Reply-To; b=tubUf+RqDbdW3Zca9URHsRxGSQssyCdXwHLvAXrvYeV/HcosPOC8kn3artSCtES7A B03eran6kuGBlMHa3bNznok+kYy/wMKvglATKO/PdXPpYKTSHqLiXMzcrHaXGoIyC0 G9zcRU0zf+NPgB+nIinET+KGp23x8/g9gVnZcseI= To: musl@lists.openwall.com References: <6106be97-2c82-75c0-ad88-2e49b17c68ee@darkkirb.de> <20201227230554.ddflrnbmyvjccj4n@gmail.com> <20201228005632.rezxjuehsgmr5ira@gmail.com> <0326d35a-4c1d-3d25-1917-166e5b580062@darkkirb.de> <865734a3-e4c6-eb06-5855-db74c00fb071@darkkirb.de> <104266ac-6da3-0fac-2394-54dca6675270@darkkirb.de> From: Charlotte Delenk Message-ID: <54089c13-88b2-6b8d-8e4a-b3e6b59075e3@darkkirb.de> Date: Tue, 29 Dec 2020 12:56:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <104266ac-6da3-0fac-2394-54dca6675270@darkkirb.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: [musl] [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 necessary. This patch adds new link flags to the libc.so 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  $(LOBJS) $(LDSO_OBJS): CFLAGS_ALL += -fPIC +# Work around LTO compiler bugs +lib/libc.so: 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 -- 2.29.2