about summary refs log tree commit diff
path: root/sysdeps/loongarch/configure.ac
diff options
context:
space:
mode:
authorChenghua Xu <xuchenghua@loongson.cn>2022-09-07 10:33:00 +0800
committercaiyinyu <caiyinyu@loongson.cn>2022-12-07 10:42:51 +0800
commit9f482b73f41a9a1bbfb173aad0733d1c824c788a (patch)
treea0726fb0997d086ee791af8db694321f2c683089 /sysdeps/loongarch/configure.ac
parent8d6083717c1df492d1276b302180df0dcdddb4cf (diff)
downloadglibc-9f482b73f41a9a1bbfb173aad0733d1c824c788a.tar.gz
glibc-9f482b73f41a9a1bbfb173aad0733d1c824c788a.tar.xz
glibc-9f482b73f41a9a1bbfb173aad0733d1c824c788a.zip
LoongArch: Use medium cmodel build libc_nonshared.a.
This patch is used to fix address out-of-bounds error when building
Chrome.
Diffstat (limited to 'sysdeps/loongarch/configure.ac')
-rw-r--r--sysdeps/loongarch/configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/loongarch/configure.ac b/sysdeps/loongarch/configure.ac
index 06dd408ad9..9df387f086 100644
--- a/sysdeps/loongarch/configure.ac
+++ b/sysdeps/loongarch/configure.ac
@@ -51,3 +51,13 @@ EOF
 if test "$libc_cv_static_pie_on_loongarch" = yes; then
   AC_DEFINE(SUPPORT_STATIC_PIE)
 fi
+
+  # Check if gcc supports option -mcmodel=medium.
+AC_CACHE_CHECK(whether $CC supports option -mcmodel=medium,
+	       libc_cv_loongarch_cmodel_medium, [
+  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS -mcmodel=medium /dev/null 1>&AS_MESSAGE_LOG_FD); then
+    libc_cv_loongarch_cmodel_medium=yes
+  else
+    libc_cv_loongarch_cmodel_medium=no
+  fi])
+LIBC_CONFIG_VAR([have-cmodel-medium], [$libc_cv_loongarch_cmodel_medium])