diff options
author | athenian200 <athenian200@outlook.com> | 2023-11-04 01:43:49 -0500 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2023-11-04 01:47:00 -0500 |
commit | 99af7cc0283e7d7a38aa3a03a415e28b54bcc635 (patch) | |
tree | c4e9137fdb76ebff343808fb28c0ab473a2f5eaa | |
parent | 76b360b5d17bb28c42eed9a9e91d1ddab0c70246 (diff) | |
download | uxp-99af7cc0283e7d7a38aa3a03a415e28b54bcc635.tar.gz |
Issue #1824 - Support SunOS Linker mapfiles.RB_20231106
Generating OS-appropriate mapfiles from a provided SYMBOL_FILE is
apparently required to work with newer ffvpx. Nothing else in our
codebase actually seemed to require it. Also seems to reduce the amount
of console spam I see relating to symbol visibility during the build
process, and I think it even makes libxul.so link a bit faster.
-rw-r--r-- | config/rules.mk | 4 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/action/generate_symbols_file.py | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/config/rules.mk b/config/rules.mk index b2fafc5762..b774063699 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -411,6 +411,10 @@ EXTRA_DSO_LDOPTS += -Wl,--version-script,$(SYMBOLS_FILE) else ifeq ($(OS_TARGET),Darwin) EXTRA_DSO_LDOPTS += -Wl,-exported_symbols_list,$(SYMBOLS_FILE) +else +ifeq ($(OS_TARGET),SunOS) +EXTRA_DSO_LDOPTS += -Wl,-M,$(SYMBOLS_FILE) +endif endif endif endif diff --git a/python/mozbuild/mozbuild/action/generate_symbols_file.py b/python/mozbuild/mozbuild/action/generate_symbols_file.py index ff6136bb14..3eebf324cc 100644 --- a/python/mozbuild/mozbuild/action/generate_symbols_file.py +++ b/python/mozbuild/mozbuild/action/generate_symbols_file.py @@ -83,6 +83,20 @@ def generate_symbols_file(output, *args): # }; output.write('{\nglobal:\n %s;\nlocal:\n *;\n};' % ';\n '.join(symbols)) + elif buildconfig.substs['OS_TARGET'] == 'SunOS': + # A linker version script is generated for Sun LD that looks like the + # following: + # $mapfile_version 2 + # SYMBOL_VERSION SUNW_1.1 { + # global: + # symbol1; + # symbol2; + # ... + # local: + # *; + # }; + output.write('$mapfile_version 2\nSYMBOL_VERSION SUNW_1.1 {\nglobal:\n %s;\nlocal:\n *;\n};' + % ';\n '.join(symbols)) elif buildconfig.substs['OS_TARGET'] == 'Darwin': # A list of symbols is generated for Apple ld that simply lists all # symbols, with an underscore prefix. |