From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 6DC53385355A for ; Tue, 6 Sep 2022 12:58:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6DC53385355A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 79E3833793 for ; Tue, 6 Sep 2022 12:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662469133; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z5He+Xv0vl3iKXsbB3s8/N7KWCnFQUlh0KMryjBhmPo=; b=oGPGGwoWHL5gRG+Ycc0qP55x/Zvi8QVaAQahOk+5Us9Dp2UKHl9Y5Z/n/66+H+/wy7g0mg SyExLemrgvQFk3QXTD3upamGxoFoIeUWN4iZhe1Y887CEMrV7hkI+ek+ShPXDvhQyG2l/4 2JhbY3pt2GJeBOPUnoaOF/gEJIXV9Q0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662469133; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z5He+Xv0vl3iKXsbB3s8/N7KWCnFQUlh0KMryjBhmPo=; b=L/Sg8kO/inRssA5HyB/U671WOhkVLIztjaRl8eqtvW1yhVgzdrwRRlEK/Yh7Wi1hzu7JkQ I/XozoN7hLmUI6Cw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6775C13A7A for ; Tue, 6 Sep 2022 12:58:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id S4vZFw1EF2OIUQAAMHmgww (envelope-from ) for ; Tue, 06 Sep 2022 12:58:53 +0000 Message-ID: <676d0347-6292-2348-0845-80b65d4196c5@suse.de> Date: Tue, 6 Sep 2022 14:58:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: [PING^2][PATCH][gdb/build] Fix build breaker with --enabled-shared Content-Language: en-US From: Tom de Vries To: gcc-patches@gcc.gnu.org References: <20220627130323.GA7270@delia.com> <247a3c89-35e9-e1f3-0c60-b371c12e2043@suse.de> <557d86be-4768-4bf3-74ae-e2c9f78da857@suse.de> In-Reply-To: <557d86be-4768-4bf3-74ae-e2c9f78da857@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 7/12/22 15:42, Tom de Vries wrote: > [ dropped gdb-patches, since already applied there. ] > > On 6/27/22 15:38, Tom de Vries wrote: >> On 6/27/22 15:03, Tom de Vries wrote: >>> Hi, >>> >>> When building gdb with --enabled-shared, I run into: >>> ... >>> ld: build/zlib/libz.a(libz_a-inffast.o): relocation R_X86_64_32S >>> against \ >>>    `.rodata' can not be used when making a shared object; recompile >>> with -fPIC >>> ld: build/zlib/libz.a(libz_a-inflate.o): warning: relocation against \ >>>    `inflateResetKeep' in read-only section `.text' >>> collect2: error: ld returned 1 exit status >>> make[3]: *** [libbfd.la] Error 1 >>> ... >>> >>> This is a regression since commit a08bdb159bb ("[gdb/build] Fix >>> gdbserver >>> build with -fsanitize=thread"). >>> >>> The problem is that a single case statement in configure is shared to >>> handle >>> special requirements for both the host libiberty and host zlib, which >>> has the >>> effect that only one is handled. >>> >>> Fix this by handling libiberty and zlib each in its own case statement. >>> >>> Build on x86_64-linux, with and without --enable-shared. >>> >>> OK for gcc trunk? >>> > Ping^2. Thanks, - Tom >> To fix the buildbot breakage, I already pushed to the gdb repo. >> >> Thanks, >> - Tom >> >>> >>> [gdb/build] Fix build breaker with --enabled-shared >>> >>> ChangeLog: >>> >>> 2022-06-27  Tom de Vries  >>> >>>     * configure.ac: Set extra_host_libiberty_configure_flags and >>>     extra_host_zlib_configure_flags in separate case statements. >>>     * configure: Regenerate. >>> >>> --- >>>   configure    | 8 ++++++-- >>>   configure.ac | 8 ++++++-- >>>   2 files changed, 12 insertions(+), 4 deletions(-) >>> >>> diff --git a/configure b/configure >>> index aac80b88d70..be433ef6d5d 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -6962,13 +6962,18 @@ fi >>>   # Sometimes we have special requirements for the host libiberty. >>>   extra_host_libiberty_configure_flags= >>> -extra_host_zlib_configure_flags= >>>   case " $configdirs " in >>>     *" lto-plugin "* | *" libcc1 "* | *" gdbserver "*) >>>       # When these are to be built as shared libraries, the same >>> applies to >>>       # libiberty. >>>       extra_host_libiberty_configure_flags=--enable-shared >>>       ;; >>> +esac >>> + >>> + >>> +# Sometimes we have special requirements for the host zlib. >>> +extra_host_zlib_configure_flags= >>> +case " $configdirs " in >>>     *" bfd "*) >>>       # When bfd is to be built as a shared library, the same applies to >>>       # zlib. >>> @@ -6979,7 +6984,6 @@ case " $configdirs " in >>>   esac >>> - >>>   # Produce a warning message for the subdirs we can't configure. >>>   # This isn't especially interesting in the Cygnus tree, but in the >>> individual >>>   # FSF releases, it's important to let people know when their >>> machine isn't >>> diff --git a/configure.ac b/configure.ac >>> index 29f74d10b5a..1651cbf3b02 100644 >>> --- a/configure.ac >>> +++ b/configure.ac >>> @@ -2342,13 +2342,18 @@ fi >>>   # Sometimes we have special requirements for the host libiberty. >>>   extra_host_libiberty_configure_flags= >>> -extra_host_zlib_configure_flags= >>>   case " $configdirs " in >>>     *" lto-plugin "* | *" libcc1 "* | *" gdbserver "*) >>>       # When these are to be built as shared libraries, the same >>> applies to >>>       # libiberty. >>>       extra_host_libiberty_configure_flags=--enable-shared >>>       ;; >>> +esac >>> +AC_SUBST(extra_host_libiberty_configure_flags) >>> + >>> +# Sometimes we have special requirements for the host zlib. >>> +extra_host_zlib_configure_flags= >>> +case " $configdirs " in >>>     *" bfd "*) >>>       # When bfd is to be built as a shared library, the same applies to >>>       # zlib. >>> @@ -2357,7 +2362,6 @@ case " $configdirs " in >>>       fi >>>       ;; >>>   esac >>> -AC_SUBST(extra_host_libiberty_configure_flags) >>>   AC_SUBST(extra_host_zlib_configure_flags) >>>   # Produce a warning message for the subdirs we can't configure.