xiaoxiang781216 commented on code in PR #19567:
URL: https://github.com/apache/nuttx/pull/19567#discussion_r3663513785


##########
arch/x86/src/common/Toolchain.defs:
##########
@@ -48,7 +48,21 @@ endif
 # Cygwin toolchains don't generate ELF binaries.
 
 ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
-CROSSDEV = i486-nuttx-elf-
+CROSSDEV ?= i486-nuttx-elf-
+endif
+
+# macOS has no native i386 toolchain at all -- the host compiler is Apple
+# clang, which on Apple Silicon cannot target i386 in any form -- so a cross
+# toolchain is not optional here.  Homebrew's i686-elf-gcc is one; it accepts
+# the -march=i486 above.  arch/x86_64 defaults CROSSDEV the same way.
+#
+# A 64-bit x86 toolchain with -m32 is NOT a substitute unless it was built
+# with multilib:  Homebrew's x86_64-elf-gcc compiles 32-bit objects happily
+# and then has no 32-bit libgcc to link them against, which surfaces at the
+# final link as undefined references to __udivdi3 and friends.
+
+ifeq ($(CONFIG_HOST_MACOS),y)

Review Comment:
   else if



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to