From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C7DB3858C78; Thu, 18 Apr 2024 18:10:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C7DB3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713463832; bh=SOGxrypiZ2cx7KIyDt6WjkJeze8MYqfo2KmHbYMp1eA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FKnyOMTVOir2h3AKVQ+VIE2PtALuD8nb0Kpa0dss0IKyFD7rgPjMdSTScmVASjl00 c4r3vcpfg7ck16lKTuYhOBG2Yrz6e5X0mHoPVsXbRM0BzY352XxCqvry8cSvIVAl8Y niQIIAHczT8MzVB4kawxf/IFkjqlDhCofmDV/TEI= From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/31655] clang can't build glibc with stack protector Date: Thu, 18 Apr 2024 18:10:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31655 --- Comment #4 from Adhemerval Zanella --- I think we make explicit the constraints in the code, where we can't call external symbols in static build. Something like: diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h index 5a98f70364..1943dc7db6 100644 --- a/sysdeps/x86/dl-cacheinfo.h +++ b/sysdeps/x86/dl-cacheinfo.h @@ -98,6 +98,12 @@ static const struct intel_02_cache_info #define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known [0])) +/* The bsearch is called early during process initialization before TCB has + been set up; and if the compiler does not enable __extern_inline it mig= ht call + the symbol which might use an invalid thread-pointer. */ +#define bsearch bsearch_inline +#include + static int intel_02_known_compare (const void *p1, const void *p2) { @@ -214,8 +220,8 @@ intel_check_word (int name, unsigned int value, bool *has_level_2, struct intel_02_cache_info search; search.idx =3D byte; - found =3D bsearch (&search, intel_02_known, nintel_02_known, - sizeof (intel_02_known[0]), intel_02_known_compa= re); + found =3D bsearch_inline (&search, intel_02_known, nintel_02_know= n, + sizeof (intel_02_known[0]), intel_02_known_compare); if (found !=3D NULL) { if (found->rel_name =3D=3D folded_rel_name) --=20 You are receiving this mail because: You are on the CC list for the bug.=