|
538 | 538 | ['clang==0 and OS!="win"', { |
539 | 539 | 'cflags': [ '-Wno-restrict', ], |
540 | 540 | }], |
541 | | - # TODO(joyeecheung): investigate if it breaks addons. |
542 | | - # ['OS=="mac"', { |
543 | | - # 'xcode_settings': { |
544 | | - # 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden |
545 | | - # 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' # -fvisibility-inlines-hidden |
546 | | - # }, |
547 | | - # }], |
548 | | - # ['OS!="win" or clang==1', { |
549 | | - # 'cflags': [ |
550 | | - # '-fvisibility=hidden', |
551 | | - # '-fvisibility-inlines-hidden' |
552 | | - # ], |
553 | | - # }], |
| 541 | + # Build with -fvisibility=hidden and -fvisibility-inlines-hidden to avoid |
| 542 | + # including unnecessary internal symbols, which may lead to run-time fixups. |
| 543 | + # This is not done on AIX where symbols are exported by tools/create_expfile.sh |
| 544 | + # see https://github.com/nodejs/node/pull/56290#issuecomment-2582703109 |
| 545 | + ['node_shared=="false" and OS=="mac"', { |
| 546 | + 'xcode_settings': { |
| 547 | + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden |
| 548 | + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' # -fvisibility-inlines-hidden |
| 549 | + }, |
| 550 | + }, 'node_shared=="false" and (OS!="aix" and OS!="os400") and (OS!="win" or clang==1)', { |
| 551 | + 'cflags': [ |
| 552 | + '-fvisibility=hidden', |
| 553 | + '-fvisibility-inlines-hidden' |
| 554 | + ], |
| 555 | + }], # MSVC hides the non-public symbols by default so no need to configure it. |
554 | 556 | # Pointer authentication for ARM64. |
555 | 557 | ['target_arch=="arm64"', { |
556 | 558 | 'target_conditions': [ |
|
0 commit comments