From patchwork Wed Oct 23 21:43:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 2001316 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XYjNN1ZTTz1xw0 for ; Thu, 24 Oct 2024 08:48:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 404D440716; Wed, 23 Oct 2024 21:48:33 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Ko-JoaPzHOzH; Wed, 23 Oct 2024 21:48:32 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D36884070C Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id D36884070C; Wed, 23 Oct 2024 21:48:31 +0000 (UTC) X-Original-To: buildroot@buildroot.org Delivered-To: buildroot@buildroot.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id 599AC2073 for ; Wed, 23 Oct 2024 21:48:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4674540148 for ; Wed, 23 Oct 2024 21:48:30 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IZNSxxTfzU6m for ; Wed, 23 Oct 2024 21:48:29 +0000 (UTC) X-Greylist: delayed 305 seconds by postgrey-1.37 at util1.osuosl.org; Wed, 23 Oct 2024 21:48:28 UTC DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 62C8B40102 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 62C8B40102 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.227.17.21; helo=mout.gmx.net; envelope-from=j.neuschaefer@gmx.net; receiver= Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by smtp2.osuosl.org (Postfix) with ESMTPS id 62C8B40102 for ; Wed, 23 Oct 2024 21:48:27 +0000 (UTC) X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from probook ([89.1.59.23]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbzuB-1tcE0U0RH5-00qSaw; Wed, 23 Oct 2024 23:43:21 +0200 Date: Wed, 23 Oct 2024 23:43:20 +0200 MIME-Version: 1.0 Message-Id: <20241023-microblaze-v1-1-7ad68e2f271c@gmx.net> X-B4-Tracking: v=1; b=H4sIAPdtGWcC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxNDAyNj3dzM5KL8pJzEqlRdAyOLNAND0ySj1BQTJaCGgqLUtMwKsGHRsbW 1AICypDpcAAAA X-Change-ID: 20241023-microblaze-028f015b2ed4 To: buildroot@buildroot.org Cc: Thomas Petazzoni , =?utf-8?q?J=2E_Neusch?= =?utf-8?q?=C3=A4fer?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1729719800; l=2824; i=j.neuschaefer@gmx.net; s=20240329; h=from:subject:message-id; bh=BrOXd6O8RI3Po0vIgVbv4rX/WlUUokDIC48OLxGq5sk=; b=lWxbUJc5wFw1kw49cfD9+Ys1wmTLlyRt5q4xAkXJzgj0ZJbDA0aIBJnEdOLlqFw/MGfHIte9u UKUcCvXDiVGAwD5ElzaNKu66U1Dof/ZDC6zz2GnjeAMDi5dQXOmXbkC X-Developer-Key: i=j.neuschaefer@gmx.net; a=ed25519; pk=NIe0bK42wNaX/C4bi6ezm7NJK0IQE+8MKBm7igFMIS4= X-Provags-ID: V03:K1:ZNI8lkQvhlM/9Y3D72blBl2NobOBNjxTfgFseJp7jhL0mldM+Xb v+fluhmUTupfkR/01Z5lhwH3yB0HgUwRAaWM4lSRm2XPUMUfrlECqWhWVeaUjIliTJbsepO m4TM+UT5Kv5NB0Ypgs0evcRXTrUXYSaJW143Anr/aEnGmiOH89SCjZ8vX20vxyi7tnfadIS DP8NPgHab0m7OQOWXUWFA== UI-OutboundReport: notjunk:1;M01:P0:RiAIUMTpG7A=;vyDjApUEbdpk/UJSPDX8/uBqsNj niVBfEMv/BdfZLjOI9HHANzOeVLWCA0d6nZe4LoxBmhc0bCAeVDm7dnAJCty/uo+hhD7etFFs lf+QKXSnNNjFG4oT80kvqUHPjwos88num8l34QPShMT282XcZZlJjonP/W8DWk3PT4B8ikr5v UYO/XohWhBkCIVQDOgZ4EY1l6X1Q5rTvJ/OPAL1MKcrRlpG1Tv/Ur02iT2U1HgYWZKZdnNOeU X0c05q8ZKHpyfDnn1y9JlkUqLq6IpDXIYBBFbn2/Hc5edrMHVscv6ftQyc1HYmmX7ssWFCUuY DFTslPjiCLZyZ/rgkkzMOlWDObO3LVSMnSwoQZ13FGK9bggsfl9pIf1jkBXoPlOB3lvgPIzo9 k+ZoZn85+G0O+dHK19r3zBCGxVunWO4GUGh3DSwRyvn5a9bG4ne7+5tBiqshSS+DX/JaIjMsH 5yNzo7Wg11BY1jDnAzPT2GBh96nts31lD5bbx3TmdqrzAi+Px0Pv+FAKP6aDZJx++NvCjlgUC 9bNSSNQ3T2Ptzq0q1JsOxL9DrGnd9S12P0Tv6BVsGFcyPhj/VHgKkrA1dow+2tSmdWPvVza8X 2jdHv1VI9ciWmtOpVcZOPdc+k51xjVOx8aQYbWFoV0xnHzuxO4ZMmtBGQ8YQkhrEBq58Oyfbc OVsghrURe1aJ6z6xTLMzQKr/njrRyAomAqiynWE1MWvD6QTcVPsFXLK0k5Q+8Ag1sDhOGrwer s4i/kGHJhiR2ouHbTFOWtbGBCMITh10rRBXKb3h/x3EPatpWexxYzlekLB7L5sKhBcwjYCidG hycjyvFvsD1xLFD3+XmSChiA== X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729720106; x=1730324906; i=j.neuschaefer@gmx.net; bh=5RjRMKA0/X2WEqw9kuilKJjHcT8rrAhPP1BmmrCgmXI=; h=X-UI-Sender-Class:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:To:Cc:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=D/JsVxk7f1lPeKE+J2Dp+2Du0XJV47CXA8YJSEalyaG5V5ZX7Chn3b8MdyRejVaB 3v4uFkQlehaMkdjvGDnte9K5zjbfK+Rsfs4ImVEPnh3WwH+IldkkF2APpZpVSbO6m TEPPXVhU+QOZQGpx78m3G8QLT4QNt2/xVaHV5HLMzJOUl/BokE5BzFXM0aCUbqv+l +5x7XcbavmEuFYvmaMJbq736bnMOdPSBkjpxv8cYfUXyWNpe5m+XQvYDIeVyC34lu fBBwXL+lZ4xAW6WBuUGo0TrdDzbyEB9zn2KO00ied8VzFF7qwAe1kWUltE3NEW1Hk V7W2PB8pl9ijqFdZow== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=j.neuschaefer@gmx.net header.a=rsa-sha256 header.s=s31663417 header.b=D/JsVxk7 Subject: [Buildroot] [PATCH] package/musl: Fix -ztext build failures on microblaze X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?J=2E_Neusch=C3=A4fer_via_buildroot?= From: =?utf-8?q?J=2E_Neusch=C3=A4fer?= Reply-To: =?utf-8?q?J=2E_Neusch=C3=A4fer?= Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The particular combination of LVM2 (which enables -PIE), musl-libc with dynamic linking (and thus -ztext, banning TEXTRELs), and microblaze leads to an error because a TEXTREL is produced in musl-libc's Scrt1.o. The upstream patch added in this commit fixes (or works around) the problem. Fixes: http://autobuild.buildroot.net/results/5bb283eff4b4a2b17d1028bbe0b3e1bea8fbeba8/ Signed-off-by: J. Neuschäfer --- ...visibility-for-C-entry-point-function-_st.patch | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) --- base-commit: 4a9a4c3cd5f416b44b8ab6c3c7cdfc3cc991a5de change-id: 20241023-microblaze-028f015b2ed4 Best regards, -- J. Neuschäfer diff --git a/package/musl/0003-use-hidden-visibility-for-C-entry-point-function-_st.patch b/package/musl/0003-use-hidden-visibility-for-C-entry-point-function-_st.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3f4f1def0500200e7f616c56cc4183d6b1440f8 --- /dev/null +++ b/package/musl/0003-use-hidden-visibility-for-C-entry-point-function-_st.patch @@ -0,0 +1,42 @@ +From 9c78557af0a5e521cdb46a4ca7630f2987d2523e Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Sat, 10 Aug 2024 19:49:24 -0400 +Subject: [PATCH] use hidden visibility for C entry point function _start_c + +the file-level crt_arch.h asm fragments generally make direct +(non-PLT) calls from _start to _start_c, which is only valid when +there is a local, non-interposable definition for _start_c. generally, +the linker is expected to know that local definitions in a main +executable (as opposed to shared library) output are non-interposable, +making this work, but historically there have been linker bugs in this +area, and microblaze is reportedly still broken, flagging the +relocation for the call as a textrel. + +the equivalent _dlstart_c, called from the same crt_arch.h asm +fragments, has always used hidden visibility without problem, and +semantically it should be hidden, so make it hidden. this ensures the +direct call is always valid regardless of whether the linker properly +special-cases main executable output. + +Upstream: https://git.musl-libc.org/cgit/musl/commit/?id=9c78557af0a5e521cdb46a4ca7630f2987d2523e +Signed-off-by: J. Neuschäfer +--- + crt/crt1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/crt/crt1.c b/crt/crt1.c +index 8fe8ab5d..10601215 100644 +--- a/crt/crt1.c ++++ b/crt/crt1.c +@@ -11,7 +11,7 @@ weak void _fini(); + int __libc_start_main(int (*)(), int, char **, + void (*)(), void(*)(), void(*)()); + +-void _start_c(long *p) ++hidden void _start_c(long *p) + { + int argc = p[0]; + char **argv = (void *)(p+1); +-- +2.45.2 +