From: Xianmiao Qu <cooper.qu@linux.alibaba.com>
To: gcc-patches@gcc.gnu.org
Cc: Xianmiao Qu <cooper.qu@linux.alibaba.com>
Subject: [COMMITTED] C-SKY: Fix wrong sysroot suffix when disable multilib.
Date: Wed, 25 Jan 2023 00:36:07 +0800 [thread overview]
Message-ID: <20230124163607.47793-1-cooper.qu@linux.alibaba.com> (raw)
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.
---
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} \
--
2.32.1 (Apple Git-133)
reply other threads:[~2023-01-24 16:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230124163607.47793-1-cooper.qu@linux.alibaba.com \
--to=cooper.qu@linux.alibaba.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).