forked from github/verilator
Fix macOS weak symbols with -U linker flag (#3823)
This commit is contained in:
parent
cb413aa264
commit
3340f7b0b4
@ -55,6 +55,7 @@ Jamie Iles
|
||||
Jan Van Winkel
|
||||
Jean Berniolles
|
||||
Jeremy Bennett
|
||||
Jevin Sweval
|
||||
Jiacheng Qian
|
||||
Jiuyang Liu
|
||||
John Coiner
|
||||
|
@ -46,6 +46,10 @@ ifneq ($(words $(CURDIR)),1)
|
||||
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
# OS detection
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
######################################################################
|
||||
# C Preprocessor flags
|
||||
|
||||
@ -78,6 +82,12 @@ CPPFLAGS += $(OPT)
|
||||
CPPFLAGS += $(M32)
|
||||
LDFLAGS += $(M32)
|
||||
|
||||
# On macOS, specify all weak symbols as dynamic_lookup.
|
||||
# Otherwise, you get undefined symbol errors.
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
LDFLAGS += -Wl,-U,__Z15vl_time_stamp64v,-U,__Z13sc_time_stampv
|
||||
endif
|
||||
|
||||
# Allow upper level user makefiles to specify flags they want.
|
||||
# These aren't ever set by Verilator, so users are free to override them.
|
||||
CPPFLAGS += $(USER_CPPFLAGS)
|
||||
|
@ -54,6 +54,7 @@
|
||||
# define VL_ATTR_PURE __attribute__((pure))
|
||||
# define VL_ATTR_UNUSED __attribute__((unused))
|
||||
# if !defined(_WIN32) && !defined(__MINGW32__)
|
||||
// All VL_ATTR_WEAK symbols must be marked with the macOS -U linker flag in verilated.mk.in
|
||||
# define VL_ATTR_WEAK __attribute__((weak))
|
||||
# endif
|
||||
# if defined(__clang__)
|
||||
|
Loading…
Reference in New Issue
Block a user