sim/Make.defs: add -fvisibility=hidden to CFLAGS

This can hidden all nuttx's symbols,
and DO NOT export nuttx's symbols to share libraries.

e.g.
wrong:

NUTTX       PC       NUTTX
ffmpeg -> asound -> sysconf

right:

NUTTX       PC       PC
ffmpeg -> asound -> sysconf

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2020-09-02 10:35:37 +08:00 committed by Xiang Xiao
parent 42a1d45a8a
commit 21cff9fc4f
1 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,16 @@ ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
# Add -fvisibility=hidden
# Because we don't want export nuttx's symbols to share libraries
ARCHCPUFLAGS += -fvisibility=hidden
ARCHCPUFLAGSXX += -fvisibility=hidden
ifeq ($(CONFIG_HOST_MACOS),y)
LDLINKFLAGS += -keep_private_externs
endif
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects
# for common symbols.
ARCHCPUFLAGS += -fno-common