You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/09 09:39:50 UTC

(nuttx) branch master updated: arch/x86_64: Resolve weak symbol compilation relocation errors

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new b4c4cbc28b arch/x86_64: Resolve weak symbol compilation relocation errors
b4c4cbc28b is described below

commit b4c4cbc28b3ecffb9fc43c8b171c7a8c456041a3
Author: liwenxiang1 <li...@xiaomi.com>
AuthorDate: Wed Oct 9 16:41:14 2024 +0800

    arch/x86_64: Resolve weak symbol compilation relocation errors
    
    Signed-off-by: liwenxiang1 <li...@xiaomi.com>
---
 arch/x86_64/src/cmake/Toolchain.cmake | 2 +-
 arch/x86_64/src/common/Toolchain.defs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/src/cmake/Toolchain.cmake b/arch/x86_64/src/cmake/Toolchain.cmake
index 7d65dd5957..6b38198c80 100644
--- a/arch/x86_64/src/cmake/Toolchain.cmake
+++ b/arch/x86_64/src/cmake/Toolchain.cmake
@@ -89,7 +89,7 @@ add_link_options(-Wl,--entry=__pmode_entry)
 add_link_options(-z max-page-size=0x1000)
 add_link_options(-no-pie -nostdlib)
 add_link_options(-Wl,--no-relax)
-add_compile_options(-fPIC)
+add_compile_options(-fno-pic -mcmodel=large)
 add_compile_options(-mno-red-zone)
 
 if(CONFIG_DEBUG_LINK_MAP)
diff --git a/arch/x86_64/src/common/Toolchain.defs b/arch/x86_64/src/common/Toolchain.defs
index 009dba7933..5a4450aa58 100644
--- a/arch/x86_64/src/common/Toolchain.defs
+++ b/arch/x86_64/src/common/Toolchain.defs
@@ -32,7 +32,7 @@ ifeq ($(CONFIG_FRAME_POINTER),y)
   ARCHOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
 endif
 
-ARCHCPUFLAGS = -fPIC -fno-stack-protector -mno-red-zone -mrdrnd
+ARCHCPUFLAGS = -fno-pic -mcmodel=large -fno-stack-protector -mno-red-zone -mrdrnd
 ARCHPICFLAGS = -fPIC
 ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef