From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2050) id 9993F3858D28; Tue, 24 Jan 2023 16:33:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9993F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674578038; bh=bA5kL8QX/zBN3gsIj0UN0PvxpQ+tVBePszP40WzEe/M=; h=From:To:Subject:Date:From; b=ExKpxzh+FBEXcFCklxNkAt5ctsIQHDaJ9zixaxLMAsjg9YRnKHV+Z3SvK9vR1D8If 34Qx3lO9zGPBLQPMoUmKqv+vc3jAXjq3wuQcoaLupBZK4G9FmCEQg/oVGlyGdFH5nD WhXg6nGdOkawm9+iW6jaPSolCSRcNxlg0tHEUOVA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: qu To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5326] C-SKY: Fix wrong sysroot suffix when disable multilib. X-Act-Checkin: gcc X-Git-Author: Xianmiao Qu X-Git-Refname: refs/heads/master X-Git-Oldrev: f31fa9ea35ebcf221a2abaacba5511225f5d036e X-Git-Newrev: 4d518ed1c0edbfff5208e09616f98ea412b55c52 Message-Id: <20230124163358.9993F3858D28@sourceware.org> Date: Tue, 24 Jan 2023 16:33:58 +0000 (GMT) List-Id: https://gcc.gnu.org/g:4d518ed1c0edbfff5208e09616f98ea412b55c52 commit r13-5326-g4d518ed1c0edbfff5208e09616f98ea412b55c52 Author: Xianmiao Qu Date: Wed Jan 25 00:14:46 2023 +0800 C-SKY: Fix wrong sysroot suffix when disable multilib. The SYSROOT_SUFFIX_SPEC works even when multilib is disabled. So when build no-multilib glibc toolchain and the options are not same as MULTILIB_DEFAULTS, the sysroot will specify wrong because the libc will not be installed as such. This bug causes glibc regression test error: https://sourceware.org/pipermail/libc-testresults/2023q1/010706.html The error is: /scratch/jmyers/glibc-bot/install/compilers/csky-linux-gnuabiv2/csky-glibc-linux-gnuabiv2/bin/ld: cannot find -lc: No such file or directory gcc/ * config.gcc(csky-*-linux*): Define CSKY_ENABLE_MULTILIB and only include 'csky/t-csky-linux' when enable multilib. * config/csky/csky-linux-elf.h(SYSROOT_SUFFIX_SPEC): Don't define it when disable multilib. Diff: --- gcc/config.gcc | 7 ++++++- gcc/config/csky/csky-linux-elf.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index d828223c16d..89f56047cfe 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1642,7 +1642,12 @@ csky-*-*) ;; csky-*-linux*) tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} csky/csky-linux-elf.h" - tmake_file="${tmake_file} csky/t-csky csky/t-csky-linux" + tmake_file="${tmake_file} csky/t-csky" + + if test "x${enable_multilib}" = xyes ; then + tm_defines="$tm_defines CSKY_ENABLE_MULTILIB" + tmake_file="${tmake_file} csky/t-csky-linux" + fi case ${target} in csky-*-linux-gnu*) diff --git a/gcc/config/csky/csky-linux-elf.h b/gcc/config/csky/csky-linux-elf.h index 3f67af64c15..117c2a12c74 100644 --- a/gcc/config/csky/csky-linux-elf.h +++ b/gcc/config/csky/csky-linux-elf.h @@ -65,6 +65,8 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-cskyv2%{mfloat-abi=hard:-hf}%{mbig-endian:-be}.so.1" +#ifdef CSKY_ENABLE_MULTILIB +#undef SYSROOT_SUFFIX_SPEC #define SYSROOT_SUFFIX_SPEC \ "%{mbig-endian:/big}" \ "%{mcpu=ck807*:/ck807}" \ @@ -72,6 +74,7 @@ "%{mcpu=ck800*:/ck800}" \ "%{mfloat-abi=softfp:/soft-fp}" \ "%{mfloat-abi=hard:/hard-fp}" +#endif #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \ %{b} \