From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 7FD6F3857C5A for ; Tue, 19 Dec 2023 15:54:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FD6F3857C5A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7FD6F3857C5A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703001283; cv=none; b=t73xKWviHoD+t+4MwumWDQWvHcAalCodLA7Sllnz9pN9eF/qL3b+zNjleKKIQeSf2t4+D3XuXQ4gd+RXW3TKPTCSpifEWf7OXlPX82h1ufRHDr3hSWk+gfjAMkW4rG14UX0UHByn8i5xUSJKW10CN5kcDNEy4o9R558hQRswJqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703001283; c=relaxed/simple; bh=la/52nrQOZ1a9RuT+uCr32P1zCKVWVUAdZ9hbNNJRFI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Pk8YAZAc84HSi6mroiH9w6rC7i83fi1tLzsgEHuUM6ZiFVBwhXOnu2azlgyDgeaT1RZ3ro0R6ZhvLm+Ge9uyAuJ75YGzbkBqXIvWGkAwPTYqSvCpyxPEoYD1O2PzKbyn41IWRlvymuZ18ZAGhMAtyoWB05uKOtam8pyDmI1v6vI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d04c097e34so32544205ad.0 for ; Tue, 19 Dec 2023 07:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703001280; x=1703606080; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ok7HC4p71vERjPQRRXn9tMop3Iv9bp5S8nbpo6CrYko=; b=yAmqELr78bq5PeLcILfw6tpWPnI8EnJOHdRDkIEy8WHFSmH95kqK2wJVlA79uZpa1w WmxX4DBicp98i3CjR1xDGd7hsS3L2b0eVJrPsWkW88DF4p4BHdTawptp8nK1dFJ3C7Qk MSwCehDopgJTa5UNCRyIGJE6TJ9dVskBLrbs1WlLJaRIcoS2ywvjOMDRmMnqEfVgLMGK 34QfLRAqfQzRM+dMj0QSLu3+LKFNbsoC5bdkEpnGllRSa3jel7SWpRGgO5VHzGDCudSV G47BxpY+s6lBpEOH2rATZFFqO0vQBxJC0NBw9Fx5//Jo/6WMgOIDK3DJdBMYju9ZNLap rNcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703001280; x=1703606080; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ok7HC4p71vERjPQRRXn9tMop3Iv9bp5S8nbpo6CrYko=; b=NkwSSxfLz0fZy0F7qbWgXxTtYnD6GgiNBIauPVeM22oaBnFaLKsvst3/XMV7BQY31j equcrlRGlTxKx7TA0n2jw4WKlTzb2NKrEFJDYVyszpQw5Pp1Xof02PL1hloDAmy8M3S0 K1l+k4aB4T68gpczmN7hl3e2fSwUf62uY2/XlQgG53zjCBwKJSViFF5mdAEYyV49FbNf L/t8t/G/QlkDe/FkdMwnvCdYEjIxyEnOGA5mrAF5/h+85d8nRzBaIJONRtCJHuCIhLrm KIPYPiSjsQ8lSX2Nw9otm66e88jyjg46gwSjzNpOWlzhpWtrXyKtZXEtp6TrgpTc6zua oDAg== X-Gm-Message-State: AOJu0Yz/wFno9m1tLu4HgdobLe2+mV2zWy4B/IvzWsdCQTe4ERej4+Kv CtbDvSeYonETkbw0rRbITXxqftC5kO9Exc0SpRU= X-Google-Smtp-Source: AGHT+IHjVOTwwkBRT9pz7wuFeJjCIFicK0FG3eNGsE6psrEeIQEW2+s05gV9O3kSRMNPXuf9bGJGZQ== X-Received: by 2002:a17:902:ead2:b0:1d3:e5a9:1ea6 with SMTP id p18-20020a170902ead200b001d3e5a91ea6mr791044pld.23.1703001280449; Tue, 19 Dec 2023 07:54:40 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c3:f221:61c5:6e1b:a722:cc66? ([2804:1b3:a7c3:f221:61c5:6e1b:a722:cc66]) by smtp.gmail.com with ESMTPSA id ju11-20020a170903428b00b001d3dfebc05esm1470466plb.21.2023.12.19.07.54.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Dec 2023 07:54:39 -0800 (PST) Message-ID: <206d026c-31d1-4f6b-90e0-ecbc0cd5cd2d@linaro.org> Date: Tue, 19 Dec 2023 12:54:37 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Do not build sparc32 libgcc functions into static libc Content-Language: en-US To: Joseph Myers , libc-alpha@sourceware.org References: <53dc50f-8f2b-da88-fa85-44883878201b@codesourcery.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <53dc50f-8f2b-da88-fa85-44883878201b@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 07/12/23 17:11, Joseph Myers wrote: > Since GCC commit f31a019d1161ec78846473da743aedf49cca8c27 "Emit > funcall external declarations only if actually used.", the glibc > testsuite has failed to build for 32-bit SPARC with GCC mainline. > > /scratch/jmyers/glibc-bot/install/compilers/sparc64-linux-gnu/lib/gcc/sparc64-glibc-linux-gnu/14.0.0/../../../../sparc64-glibc-linux-gnu/bin/ld: /scratch/jmyers/glibc-bot/install/compilers/sparc64-linux-gnu/lib/gcc/sparc64-glibc-linux-gnu/14.0.0/32/libgcc.a(_divsi3.o): in function `.div': > /scratch/jmyers/glibc-bot/src/gcc/libgcc/config/sparc/lb1spc.S:138: multiple definition of `.div'; /scratch/jmyers/glibc-bot/build/glibcs/sparcv9-linux-gnu/glibc/libc.a(sdiv.o):/scratch/jmyers/glibc-bot/src/glibc/gnulib/../sysdeps/sparc/sparc32/sparcv9/sdiv.S:13: first defined here > /scratch/jmyers/glibc-bot/install/compilers/sparc64-linux-gnu/lib/gcc/sparc64-glibc-linux-gnu/14.0.0/../../../../sparc64-glibc-linux-gnu/bin/ld: disabling relaxation; it will not work with multiple definitions > collect2: error: ld returned 1 exit status > make[3]: *** [../Rules:298: /scratch/jmyers/glibc-bot/build/glibcs/sparcv9-linux-gnu/glibc/nptl/tst-cancel24-static] Error 1 > > https://sourceware.org/pipermail/libc-testresults/2023q4/012154.html > > I'm not sure of the exact sequence of undefined references that cause > first the glibc object file defining .div and then the libgcc object > file defining both .div and .udiv to be pulled in (which must have > been perturbed by that GCC change in a way that introduced the build > failure), but I think the failure illustrates that it's inherently > fragile for glibc to define symbols in separate object files that > libgcc defines in the same object file - and indeed for glibc to > redefine libgcc symbols at all, since the division into object files > shouldn't really be part of the interface between libgcc and libc. > > These symbols appear to be in libc only for compatibility, maybe one > of the cases where they were accidentally exported from shared libc in > glibc 2.0 before the introduction of symbol versioning and so programs > started expecting shared libc to provide them. Thus, there is no need > to have them in static libc. Add this set of libgcc functions to > shared-only-routines so they are no longer provided in static libc. > (No change is made regarding .mul - dotmul source file - since unlike > the other symbols in this grouping, it doesn't actually appear to be a > libgcc symbol, at least in current GCC.) > > Tested with build-many-glibcs.py for sparcv9-linux-gnu with GCC > mainline. > > diff --git a/sysdeps/sparc/sparc32/Makefile b/sysdeps/sparc/sparc32/Makefile > index b792e56710..cc1db68cc6 100644 > --- a/sysdeps/sparc/sparc32/Makefile > +++ b/sysdeps/sparc/sparc32/Makefile > @@ -17,6 +17,7 @@ > > ifeq ($(subdir),gnulib) > sysdep_routines = dotmul umul $(divrem) alloca > +shared-only-routines += umul $(divrem) > endif # gnulib > > divrem := sdiv udiv rem urem > LGTM, thanks. Reviewed-by: Adhemerval Zanella