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 7b0aa1111f sim: Fix build errors on macOS
7b0aa1111f is described below

commit 7b0aa1111fc49f280b9a958a51a5b98f6c7850c1
Author: YAMAMOTO Takashi <[email protected]>
AuthorDate: Mon Dec 16 21:05:57 2024 +0900

    sim: Fix build errors on macOS
    
    macOS 15.2
    x86-64
    Xcode 16.1
    ```
    ld: warning: disabling chained fixups because of unaligned pointers
    ld: illegal text-relocation in '_main'+0x1F 
(/Users/yamamoto/git/nuttx/nuttx/arc
    h/sim/src/nuttx.rel) to '_g_argc'
    ```
---
 boards/sim/sim/sim/scripts/Make.defs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/boards/sim/sim/sim/scripts/Make.defs 
b/boards/sim/sim/sim/scripts/Make.defs
index 90d3827424..4260f093dd 100644
--- a/boards/sim/sim/sim/scripts/Make.defs
+++ b/boards/sim/sim/sim/scripts/Make.defs
@@ -149,8 +149,13 @@ ifeq ($(CONFIG_SIM_M32),y)
   ARCHCFLAGS += -m32
   ARCHCXXFLAGS += -m32
 else
-  ARCHCFLAGS += -fno-pic -mcmodel=medium
-  ARCHCXXFLAGS += -fno-pic -mcmodel=medium
+  ifeq ($(CONFIG_HOST_MACOS),y)
+    ARCHCFLAGS += -fno-pic
+    ARCHCXXFLAGS += -fno-pic
+  else
+    ARCHCFLAGS += -fno-pic -mcmodel=medium
+    ARCHCXXFLAGS += -fno-pic -mcmodel=medium
+  endif
 endif
 
 # LLVM style architecture flags

Reply via email to