From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id D2BC13858C50 for ; Tue, 12 Jul 2022 13:59:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2BC13858C50 Received: by mail-wm1-x32f.google.com with SMTP id l22-20020a05600c4f1600b003a2e10c8cdeso816113wmq.1 for ; Tue, 12 Jul 2022 06:59:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=V4mPcddHkLteMIAyZs+znOxdrxkSP/8FIUYiHlfkGqk=; b=IhXVGMOuaEfJ0X9vxlwOTHaCs5QBLfypABVUGOJh76YoiwopU6Kg15jaNEc/pfaE5F mPpZ1WN+Q/s0VW/dVi0yTAMivPEfnPNEKFzJkE+Gh7tKKZVpwSMN371fUvKU0ySuq86C Iv6KLyMPVDMryNSkEsOhr05LXHhfgMiZQHg+CqgW3+6iWEuMfTgpq7sgqeUW2T8jNqZK sKuTzjBervAI+wHd7lqjxypfJRSgmq2CEyKGNUs6jjBBE69xDVo6lHJXbbgXS8QttvYO qS/P3KhRSkDBLeMU86FVFRmwB05l4k5OzZnoFC0X0CtW0nYgjuihs1VB/Aj7a+xobT2G 4MIA== X-Gm-Message-State: AJIora99R4DbgLPzXRdKbY3K8y+Ra1S2+gaGWM5X3BKW6tRcevc5T5yy neU5qIuN/gc2VlkoQVE+oLo= X-Google-Smtp-Source: AGRyM1tS9aQY8MOSOv9OZEFwkqtXPoUsVgnDpQ6eV7V4J6QZnxeamGnLwpHvDGv/RJ3v4APbBOXytw== X-Received: by 2002:a05:600c:3d11:b0:3a1:8c05:6e75 with SMTP id bh17-20020a05600c3d1100b003a18c056e75mr3920631wmb.203.1657634370452; Tue, 12 Jul 2022 06:59:30 -0700 (PDT) Received: from [192.168.1.95] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id f17-20020a5d50d1000000b0021b956da1dcsm8417359wrt.113.2022.07.12.06.59.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2022 06:59:30 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PING][PATCH][gdb/build] Fix build breaker with --enabled-shared From: Iain Sandoe In-Reply-To: <557d86be-4768-4bf3-74ae-e2c9f78da857@suse.de> Date: Tue, 12 Jul 2022 14:59:29 +0100 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220627130323.GA7270@delia.com> <247a3c89-35e9-e1f3-0c60-b371c12e2043@suse.de> <557d86be-4768-4bf3-74ae-e2c9f78da857@suse.de> To: Tom de Vries X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 13:59:34 -0000 Hi Tom > On 12 Jul 2022, at 14:42, Tom de Vries via Gcc-patches = wrote: >=20 > [ dropped gdb-patches, since already applied there. ] >=20 > On 6/27/22 15:38, Tom de Vries wrote: >> On 6/27/22 15:03, Tom de Vries wrote: >>> Hi, >>>=20 >>> 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 >>> ... >>>=20 >>> This is a regression since commit a08bdb159bb ("[gdb/build] Fix = gdbserver >>> build with -fsanitize=3Dthread"). >>>=20 >>> 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. >>>=20 >>> Fix this by handling libiberty and zlib each in its own case = statement. >>>=20 >>> Build on x86_64-linux, with and without --enable-shared. >>>=20 >>> OK for gcc trunk? >>>=20 >=20 > Ping. see also=20 https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597263.html which is approved but i didn=E2=80=99t yet push it ..=20 do you not see any issues with GMP et. al. (or are they not used)? Iain >=20 > Thanks, > - Tom >=20 >> To fix the buildbot breakage, I already pushed to the gdb repo. >> Thanks, >> - Tom >>>=20 >>> [gdb/build] Fix build breaker with --enabled-shared >>>=20 >>> ChangeLog: >>>=20 >>> 2022-06-27 Tom de Vries >>>=20 >>> * configure.ac: Set extra_host_libiberty_configure_flags and >>> extra_host_zlib_configure_flags in separate case statements. >>> * configure: Regenerate. >>>=20 >>> --- >>> configure | 8 ++++++-- >>> configure.ac | 8 ++++++-- >>> 2 files changed, 12 insertions(+), 4 deletions(-) >>>=20 >>> 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=3D >>> -extra_host_zlib_configure_flags=3D >>> 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=3D--enable-shared >>> ;; >>> +esac >>> + >>> + >>> +# Sometimes we have special requirements for the host zlib. >>> +extra_host_zlib_configure_flags=3D >>> +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=3D >>> -extra_host_zlib_configure_flags=3D >>> 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=3D--enable-shared >>> ;; >>> +esac >>> +AC_SUBST(extra_host_libiberty_configure_flags) >>> + >>> +# Sometimes we have special requirements for the host zlib. >>> +extra_host_zlib_configure_flags=3D >>> +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.