about summary refs log tree commit diff
path: root/sysdeps/loongarch/Makefile
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/Makefile
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/Makefile')
-rw-r--r--sysdeps/loongarch/Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/loongarch/Makefile b/sysdeps/loongarch/Makefile
index 746d4c2c8f..1778fd1c88 100644
--- a/sysdeps/loongarch/Makefile
+++ b/sysdeps/loongarch/Makefile
@@ -5,3 +5,9 @@ endif
 # LoongArch's assembler also needs to know about PIC as it changes the
 # definition of some assembler macros.
 ASFLAGS-.os += $(pic-ccflag)
+
+# All the objects in lib*_nonshared.a need to be compiled with medium code
+# model or large applications may fail to link.
+ifeq (yes,$(have-cmodel-medium))
+CFLAGS-.oS += -mcmodel=medium
+endif