summaryrefslogtreecommitdiff
path: root/0307-Set-fallback-value-for-print-multi-os-directory.patch
diff options
context:
space:
mode:
Diffstat (limited to '0307-Set-fallback-value-for-print-multi-os-directory.patch')
-rw-r--r--0307-Set-fallback-value-for-print-multi-os-directory.patch105
1 files changed, 105 insertions, 0 deletions
diff --git a/0307-Set-fallback-value-for-print-multi-os-directory.patch b/0307-Set-fallback-value-for-print-multi-os-directory.patch
new file mode 100644
index 0000000..2032f6b
--- /dev/null
+++ b/0307-Set-fallback-value-for-print-multi-os-directory.patch
@@ -0,0 +1,105 @@
+From 0d157b14f361f8319f4694c54c6e01ac8f59d278 Mon Sep 17 00:00:00 2001
+From: YunQiang Su <yunqiang@isrc.iscas.ac.cn>
+Date: Tue, 8 Oct 2024 17:56:23 +0800
+Subject: [PATCH 1/2] Set fallback value for -print-multi-os-directory
+
+Clang doesn't support -print-multi-os-directory option.
+So let's set the fallback value (../lib64) if it is empty.
+
+This is only needed for the projects built by hostcc:
+ gcc, libcc1, libiberty
+
+The projects for targets only, will always built by gcc itself.
+---
+ gcc/configure | 3 +++
+ libcc1/configure | 6 ++++++
+ libcc1/configure.ac | 3 +++
+ libiberty/Makefile.in | 5 ++++-
+ libtool.m4 | 3 +++
+ 5 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 7e64599b0..ef0449edd 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -18598,6 +18598,9 @@ if test "$GCC" = yes; then
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
++ if [ -z "$lt_multi_os_dir" ];then
++ lt_multi_os_dir=../lib64
++ fi
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+diff --git a/libcc1/configure b/libcc1/configure
+index 01cfb2806..3c437d690 100755
+--- a/libcc1/configure
++++ b/libcc1/configure
+@@ -9701,6 +9701,9 @@ if test "$GCC" = yes; then
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
++ if [ -z "$lt_multi_os_dir" ];then
++ lt_multi_os_dir=../lib64
++ fi
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+@@ -14865,6 +14868,9 @@ libsuffix=
+ if test "$GXX" = yes; then
+ libsuffix=`$CXX -print-multi-os-directory`
+ fi
++if [ -z "$libsuffix" ];then
++ libsuffix=../lib64
++fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket libraries" >&5
+diff --git a/libcc1/configure.ac b/libcc1/configure.ac
+index 36f5a7e09..acd7c4c04 100644
+--- a/libcc1/configure.ac
++++ b/libcc1/configure.ac
+@@ -72,6 +72,9 @@ libsuffix=
+ if test "$GXX" = yes; then
+ libsuffix=`$CXX -print-multi-os-directory`
+ fi
++if [ -z "$libsuffix" ];then
++ libsuffix=../lib64
++fi
+ AC_SUBST(libsuffix)
+
+ dnl Test for -lsocket and -lnsl. Copied from libgo/configure.ac.
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index 1b17c2e3a..2bfa00de5 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -385,7 +385,10 @@ install-strip: install
+ # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
+ # default multilib, so we have to take CFLAGS into account as well,
+ # since it will be passed the multilib flags.
+-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory 2>/dev/null`
++ifeq ($(MULTIOSDIR),)
++ MULTIOSDIR = ../lib64
++endif
+ install_to_libdir: all
+ if test -n "${target_header_dir}"; then \
+ ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+diff --git a/libtool.m4 b/libtool.m4
+index 17f8e5f30..86fc1e705 100644
+--- a/libtool.m4
++++ b/libtool.m4
+@@ -2059,6 +2059,9 @@ if test "$GCC" = yes; then
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
++ if [ -z "$lt_multi_os_dir" ];then
++ lt_multi_os_dir=../lib64
++ fi
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+--
+2.47.0
+