Current multiarch directory name is always *-linux-gnu* on linux,
this patch configures different names for uclibc and musl targets.
(tested by the debian rebootstrap scripts for various *-linux-musl
and *-linux-uclibc targets see debian bug #861588)

gcc/
2017-06-07  Szabolcs Nagy  <szabolcs.n...@arm.com>

        * config.gcc (*-linux-musl*): Add t-musl tmake_file.
        (*-linux-uclibc*): Add t-uclibc tmake_file.
        * config/t-musl: New.
        * config/t-uclibc: New.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index a311cd95f49..fb7b7cd6d4c 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3096,6 +3096,16 @@ powerpc*-*-* | rs6000-*-*)
 	tm_file="${tm_file} ${cpu_type}/option-defaults.h"
 esac
 
+# non-glibc systems
+case ${target} in
+*-linux-musl*)
+	tmake_file="${tmake_file} t-musl"
+	;;
+*-linux-uclibc*)
+	tmake_file="${tmake_file} t-uclibc"
+	;;
+esac
+
 # Build mkoffload tool
 case ${target} in
 *-intelmic-* | *-intelmicemul-*)
diff --git a/gcc/config/t-musl b/gcc/config/t-musl
new file mode 100644
index 00000000000..e203fce7619
--- /dev/null
+++ b/gcc/config/t-musl
@@ -0,0 +1,2 @@
+MULTIARCH_DIRNAME := $(subst -linux-gnu,-linux-musl,$(MULTIARCH_DIRNAME))
+MULTILIB_OSDIRNAMES := $(subst -linux-gnu,-linux-musl,$(MULTILIB_OSDIRNAMES))
diff --git a/gcc/config/t-uclibc b/gcc/config/t-uclibc
new file mode 100644
index 00000000000..c9b3a7bdfe2
--- /dev/null
+++ b/gcc/config/t-uclibc
@@ -0,0 +1,2 @@
+MULTIARCH_DIRNAME := $(subst -linux-gnu,-linux-uclibc,$(MULTIARCH_DIRNAME))
+MULTILIB_OSDIRNAMES := $(subst -linux-gnu,-linux-uclibc,$(MULTILIB_OSDIRNAMES))

Reply via email to