]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Use /lib instead of /lib64 as the library search path for MUSL.
authorYang Yujie <yangyujie@loongson.cn>
Wed, 6 Mar 2024 01:19:59 +0000 (09:19 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 7 Mar 2024 08:34:48 +0000 (16:34 +0800)
gcc/ChangeLog:

* config.gcc: Add a case for loongarch*-*-linux-musl*.
* config/loongarch/linux.h: Disable the multilib-compatible
treatment for *musl* targets.
* config/loongarch/musl.h: New file.

gcc/config.gcc
gcc/config/loongarch/linux.h
gcc/config/loongarch/musl.h [new file with mode: 0644]

index a1480b72c468090d4d5e23d6e3436b0b0e89a65d..624e0dae191abaad974f2078b2e1b5084505bbd6 100644 (file)
@@ -2538,6 +2538,9 @@ riscv*-*-freebsd*)
 
 loongarch*-*-linux*)
        tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file}"
+       case ${target} in
+         *-linux-musl*) tm_file="${tm_file} loongarch/musl.h"
+       esac
        tm_file="${tm_file} loongarch/gnu-user.h loongarch/linux.h loongarch/loongarch-driver.h"
        extra_options="${extra_options} linux-android.opt"
        tmake_file="${tmake_file} loongarch/t-multilib loongarch/t-linux"
index 17d9f87537b113c6fcaa9a325bb4d1349e1c5559..40d9ba6d405c97331519bcf81ae0344e8eae74fc 100644 (file)
@@ -21,7 +21,9 @@ along with GCC; see the file COPYING3.  If not see
  * This ensures that a compiler configured with --disable-multilib
  * can work in a multilib environment.  */
 
-#if defined(LA_DISABLE_MULTILIB) && defined(LA_DISABLE_MULTIARCH)
+#if !defined(LA_DEFAULT_TARGET_MUSL) \
+  && defined(LA_DISABLE_MULTILIB) \
+  && defined(LA_DISABLE_MULTIARCH)
 
   #if DEFAULT_ABI_BASE == ABI_BASE_LP64D
     #define ABI_LIBDIR "lib64"
diff --git a/gcc/config/loongarch/musl.h b/gcc/config/loongarch/musl.h
new file mode 100644 (file)
index 0000000..fa43bc8
--- /dev/null
@@ -0,0 +1,23 @@
+/* Definitions for MUSL C library support.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+
+#ifndef LA_DEFAULT_TARGET_MUSL
+#define LA_DEFAULT_TARGET_MUSL
+#endif