From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28459 invoked by alias); 7 Feb 2020 23:13:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 28450 invoked by uid 89); 7 Feb 2020 23:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=sk:gcc_ac_, HX-Spam-Relays-External:209.85.217.65, H*RU:209.85.217.65 X-HELO: mail-vs1-f65.google.com Received: from mail-vs1-f65.google.com (HELO mail-vs1-f65.google.com) (209.85.217.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 23:13:15 +0000 Received: by mail-vs1-f65.google.com with SMTP id g23so690784vsr.7 for ; Fri, 07 Feb 2020 15:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=o0hAxPX5Bmw/I2TlrqBxq7FMExUdYLOCk4Ij+RDAmOo=; b=dDa2dM+kVPlGFxfvNaOmZRapEbCswQz+c749VwGRBsbj0UAlOsIMI1SJlhSKKnGOas knGAfoYDl7Joq+t2HWaaixsh6PdYLDzDb9xr6dC6NyoFEEoQg+x14aW6jvNmgztUST+u 9uYMZ0gE0vQZBymnwW0xFXjhAHdY7tmMGPNSWGzB15ZFpwICNW2HBOuTr+HaUtVrWiRX lFPEveLIk8yE/A9u6JSEAYK17QbYA8lM82ui/RsefHTOtjyqWVP1YZecSeRt1/VAkaqF lDg/uZkdACMUHaCZHXuzOSUjnswHJzQmxBUrukX67fOo6Fz1oUyrluWyh5uB0aioR+2h jOWw== MIME-Version: 1.0 References: <20200130223606.23481-1-jimw@sifive.com> In-Reply-To: <20200130223606.23481-1-jimw@sifive.com> From: Jim Wilson Date: Fri, 07 Feb 2020 23:13:00 -0000 Message-ID: Subject: Re: [PATCH] RISC-V: Fix combined tree builds. To: GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00468.txt.bz2 ping Jim On Thu, Jan 30, 2020 at 2:36 PM Jim Wilson wrote: > > The RISC-V toolchain doesn't support leb128 because of linker relaxation > to reduce code size. This prevents us from computing the leb128 size of a > value at compile time. So do a configure time gas feature check regardless > of gas version. > > The libiconv configure change comes from the recent config/lib-link.m4 > patch. The gcc configure wasn't rebuilt after this change as this was > intended for library configure files. > > Tested with riscv32-elf and arm-eabi combined tree builds. The riscv build > fails without the patch and works with the patch where HAVE_AS_LEB128 is now > false. The arm build still works and still has HAVE_AS_LEB128 true. > > OK? > > Jim > > gcc/ > PR target/91602 > * configure.ac (HAVE_AS_LEB128): Delete gas version number in > gcc_GAS_CHECK_FEATURE call. > * configure: Regenerated. > --- > gcc/configure | 39 +++++++++++++++++++++++++++------------ > gcc/configure.ac | 5 ++++- > 2 files changed, 31 insertions(+), 13 deletions(-) > > diff --git a/gcc/configure b/gcc/configure > index e2c8fc71772..2f57fbf3223 100755 > --- a/gcc/configure > +++ b/gcc/configure > @@ -974,6 +974,7 @@ with_zstd_include > with_zstd_lib > enable_rpath > with_libiconv_prefix > +with_libiconv_type > enable_sjlj_exceptions > with_gcc_major_version_only > enable_secureplt > @@ -1811,6 +1812,7 @@ Optional Packages: > --with-gnu-ld assume the C compiler uses GNU ld default=no > --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib > --without-libiconv-prefix don't search for libiconv in includedir and libdir > + --with-libiconv-type=TYPE type of library to search for (auto/static/shared) > --with-gcc-major-version-only > use only GCC major number in filesystem paths > --with-pic try to use only PIC/non-PIC objects [default=use > @@ -10730,6 +10732,16 @@ if test "${with_libiconv_prefix+set}" = set; then : > > fi > > + > +# Check whether --with-libiconv-type was given. > +if test "${with_libiconv_type+set}" = set; then : > + withval=$with_libiconv_type; with_libiconv_type=$withval > +else > + with_libiconv_type=auto > +fi > + > + lib_type=`eval echo \$with_libiconv_type` > + > LIBICONV= > LTLIBICONV= > INCICONV= > @@ -10767,13 +10779,13 @@ fi > found_so= > found_a= > if test $use_additional = yes; then > - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$additional_libdir" > found_so="$additional_libdir/lib$name.$shlibext" > if test -f "$additional_libdir/lib$name.la"; then > found_la="$additional_libdir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$additional_libdir/lib$name.$libext"; then > found_dir="$additional_libdir" > found_a="$additional_libdir/lib$name.$libext" > @@ -10797,13 +10809,13 @@ fi > case "$x" in > -L*) > dir=`echo "X$x" | sed -e 's/^X-L//'` > - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then > + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then > found_dir="$dir" > found_so="$dir/lib$name.$shlibext" > if test -f "$dir/lib$name.la"; then > found_la="$dir/lib$name.la" > fi > - else > + elif test x$lib_type != xshared; then > if test -f "$dir/lib$name.$libext"; then > found_dir="$dir" > found_a="$dir/lib$name.$libext" > @@ -11031,8 +11043,13 @@ fi > done > fi > else > - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > + if x$lib_type = xauto || x$lib_type = xshared; then > + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" > + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" > + else > + LIBICONV="${LIBICONV}${LIBICONV:+ }-l:lib$name.$libext" > + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l:lib$name.$libext" > + fi > fi > fi > fi > @@ -23695,18 +23712,16 @@ _ACEOF > > > # Check if we have .[us]leb128, and support symbol arithmetic with it. > +# Targets with aggressive linker relaxation to reduce code size may not be > +# able to support this regardless of gas version, so we don't pass a gas > +# version to force a configure time gas feature check. RISC-V is an example. > { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .sleb128 and .uleb128" >&5 > $as_echo_n "checking assembler for .sleb128 and .uleb128... " >&6; } > if ${gcc_cv_as_leb128+:} false; then : > $as_echo_n "(cached) " >&6 > else > gcc_cv_as_leb128=no > - if test $in_tree_gas = yes; then > - if test $in_tree_gas_is_elf = yes \ > - && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0` > - then gcc_cv_as_leb128=yes > -fi > - elif test x$gcc_cv_as != x; then > + if test x$gcc_cv_as != x; then > $as_echo ' .data > .uleb128 L2 - L1 > L1: > diff --git a/gcc/configure.ac b/gcc/configure.ac > index a7521ee9943..a8e7ad91732 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -2945,8 +2945,11 @@ AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix) > gcc_AC_INITFINI_ARRAY > > # Check if we have .[us]leb128, and support symbol arithmetic with it. > +# Targets with aggressive linker relaxation to reduce code size may not be > +# able to support this regardless of gas version, so we don't pass a gas > +# version to force a configure time gas feature check. RISC-V is an example. > gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128, > - [elf,2,11,0],, > + ,, > [ .data > .uleb128 L2 - L1 > L1: > -- > 2.17.1 >