From patchwork Wed Nov 23 07:09:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: caiyinyu X-Patchwork-Id: 61015 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24EEC3852C50 for ; Wed, 23 Nov 2022 07:09:24 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 20989384F6ED for ; Wed, 23 Nov 2022 07:09:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20989384F6ED Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.2.5.5]) by gateway (Coremail) with SMTP id _____8DxfesTx31jnC8AAA--.563S3; Wed, 23 Nov 2022 15:09:07 +0800 (CST) Received: from 5.5.5 (unknown [10.2.5.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxBlcSx31jlZkYAA--.46081S2; Wed, 23 Nov 2022 15:09:06 +0800 (CST) From: caiyinyu To: adhemerval.zanella@linaro.org Cc: libc-alpha@sourceware.org, i.swmail@xen0n.name, xry111@xry111.site, xuchenghua@loongson.cn Subject: [PATCH] LoongArch: Use medium cmodel build libc_nonshared.a. Date: Wed, 23 Nov 2022 15:09:05 +0800 Message-Id: <20221123070905.1618136-1-caiyinyu@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxBlcSx31jlZkYAA--.46081S2 X-CM-SenderInfo: 5fdl5xhq1xqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoWxtry3GFy8Ar4DAw47uryUJrb_yoWxAr48p3 4xur17Ga1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MARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: Chenghua Xu This patch is used to fix address out-of-bounds error when building firefox. --- sysdeps/loongarch/Makefile | 18 ++++++++++++++++++ sysdeps/loongarch/at_quick_exit.c | 1 + sysdeps/loongarch/atexit.c | 1 + sysdeps/loongarch/elf-init.c | 1 + sysdeps/loongarch/fstat.c | 1 + sysdeps/loongarch/fstat64.c | 1 + sysdeps/loongarch/fstatat.c | 1 + sysdeps/loongarch/fstatat64.c | 1 + sysdeps/loongarch/lstat.c | 1 + sysdeps/loongarch/lstat64.c | 1 + sysdeps/loongarch/mknod.c | 1 + sysdeps/loongarch/mknodat.c | 1 + sysdeps/loongarch/pthread_atfork.c | 1 + sysdeps/loongarch/stack_chk_fail_local.c | 1 + sysdeps/loongarch/stat.c | 1 + sysdeps/loongarch/stat64.c | 1 + sysdeps/loongarch/warning-nop.c | 1 + 17 files changed, 34 insertions(+) create mode 100644 sysdeps/loongarch/at_quick_exit.c create mode 100644 sysdeps/loongarch/atexit.c create mode 100644 sysdeps/loongarch/elf-init.c create mode 100644 sysdeps/loongarch/fstat.c create mode 100644 sysdeps/loongarch/fstat64.c create mode 100644 sysdeps/loongarch/fstatat.c create mode 100644 sysdeps/loongarch/fstatat64.c create mode 100644 sysdeps/loongarch/lstat.c create mode 100644 sysdeps/loongarch/lstat64.c create mode 100644 sysdeps/loongarch/mknod.c create mode 100644 sysdeps/loongarch/mknodat.c create mode 100644 sysdeps/loongarch/pthread_atfork.c create mode 100644 sysdeps/loongarch/stack_chk_fail_local.c create mode 100644 sysdeps/loongarch/stat.c create mode 100644 sysdeps/loongarch/stat64.c create mode 100644 sysdeps/loongarch/warning-nop.c diff --git a/sysdeps/loongarch/Makefile b/sysdeps/loongarch/Makefile index 746d4c2c8f..ccda57e2d4 100644 --- a/sysdeps/loongarch/Makefile +++ b/sysdeps/loongarch/Makefile @@ -5,3 +5,21 @@ endif # LoongArch's assembler also needs to know about PIC as it changes the # definition of some assembler macros. ASFLAGS-.os += $(pic-ccflag) + +CFLAGS-elf-init.oS += -mcmodel=medium +CFLAGS-atexit.oS += -mcmodel=medium +CFLAGS-at_quick_exit.oS += -mcmodel=medium +CFLAGS-stat.oS += -mcmodel=medium +CFLAGS-fstat.oS += -mcmodel=medium +CFLAGS-lstat.oS += -mcmodel=medium +CFLAGS-stat64.oS += -mcmodel=medium +CFLAGS-fstat64.oS += -mcmodel=medium +CFLAGS-lstat64.oS += -mcmodel=medium +CFLAGS-fstatat.oS += -mcmodel=medium +CFLAGS-fstatat64.oS += -mcmodel=medium +CFLAGS-mknod.oS += -mcmodel=medium +CFLAGS-mknodat.oS += -mcmodel=medium +CFLAGS-pthread_atfork.oS += -mcmodel=medium +CFLAGS-warning-nop.oS += -mcmodel=medium +CFLAGS-stack_chk_fail_local.oS += -mcmodel=medium + diff --git a/sysdeps/loongarch/at_quick_exit.c b/sysdeps/loongarch/at_quick_exit.c new file mode 100644 index 0000000000..8d4b44a7eb --- /dev/null +++ b/sysdeps/loongarch/at_quick_exit.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/atexit.c b/sysdeps/loongarch/atexit.c new file mode 100644 index 0000000000..fc055a4851 --- /dev/null +++ b/sysdeps/loongarch/atexit.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/elf-init.c b/sysdeps/loongarch/elf-init.c new file mode 100644 index 0000000000..5f261a9d16 --- /dev/null +++ b/sysdeps/loongarch/elf-init.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/fstat.c b/sysdeps/loongarch/fstat.c new file mode 100644 index 0000000000..c4504eebe7 --- /dev/null +++ b/sysdeps/loongarch/fstat.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/fstat64.c b/sysdeps/loongarch/fstat64.c new file mode 100644 index 0000000000..143ca2b051 --- /dev/null +++ b/sysdeps/loongarch/fstat64.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/fstatat.c b/sysdeps/loongarch/fstatat.c new file mode 100644 index 0000000000..0b0a334241 --- /dev/null +++ b/sysdeps/loongarch/fstatat.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/fstatat64.c b/sysdeps/loongarch/fstatat64.c new file mode 100644 index 0000000000..e82b927477 --- /dev/null +++ b/sysdeps/loongarch/fstatat64.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/lstat.c b/sysdeps/loongarch/lstat.c new file mode 100644 index 0000000000..f47a56aff8 --- /dev/null +++ b/sysdeps/loongarch/lstat.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/lstat64.c b/sysdeps/loongarch/lstat64.c new file mode 100644 index 0000000000..d681165600 --- /dev/null +++ b/sysdeps/loongarch/lstat64.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/mknod.c b/sysdeps/loongarch/mknod.c new file mode 100644 index 0000000000..1ed3681ffe --- /dev/null +++ b/sysdeps/loongarch/mknod.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/mknodat.c b/sysdeps/loongarch/mknodat.c new file mode 100644 index 0000000000..82bc6ee637 --- /dev/null +++ b/sysdeps/loongarch/mknodat.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/pthread_atfork.c b/sysdeps/loongarch/pthread_atfork.c new file mode 100644 index 0000000000..0f01d80512 --- /dev/null +++ b/sysdeps/loongarch/pthread_atfork.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/stack_chk_fail_local.c b/sysdeps/loongarch/stack_chk_fail_local.c new file mode 100644 index 0000000000..305871fbc0 --- /dev/null +++ b/sysdeps/loongarch/stack_chk_fail_local.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/stat.c b/sysdeps/loongarch/stat.c new file mode 100644 index 0000000000..36461b870e --- /dev/null +++ b/sysdeps/loongarch/stat.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/stat64.c b/sysdeps/loongarch/stat64.c new file mode 100644 index 0000000000..0897282e6a --- /dev/null +++ b/sysdeps/loongarch/stat64.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/loongarch/warning-nop.c b/sysdeps/loongarch/warning-nop.c new file mode 100644 index 0000000000..b76aae79f9 --- /dev/null +++ b/sysdeps/loongarch/warning-nop.c @@ -0,0 +1 @@ +#include