sim: Add -fno-common to ARCHCPUFLAGS

It seems that "ld -r" on macOS doesn't include objects from
libraries for common symbols. Because of that, sim build
ends up with undefined references to globals like g_binfmts
and g_mmheap.
This commit is contained in:
YAMAMOTO Takashi 2020-02-03 15:25:43 +09:00 committed by Xiang Xiao
parent 85617c05fc
commit 2984fb9602
3 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx -isystem $(TOPDIR)/include/uClibc++
ARCHSCRIPT =
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects
# for common symbols.
ARCHCPUFLAGS += -fno-common
ARCHCPUFLAGSXX += -fno-common
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32

View File

@ -57,6 +57,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects
# for common symbols.
ARCHCPUFLAGS += -fno-common
ARCHCPUFLAGSXX += -fno-common
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32

View File

@ -63,6 +63,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects
# for common symbols.
ARCHCPUFLAGS += -fno-common
ARCHCPUFLAGSXX += -fno-common
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32