From 5613c37e6698299aef72ea0fdc927bf7d1d9c312 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 29 Sep 2022 10:09:00 -0400 Subject: [PATCH] BootRules: Add -fvisibility=hidden to BootStaticLibrary as well. Does not seem to affect the size of the bios_ia32 loader, but takes the x86_64 EFI loader down from 678k -> 554k. --- build/jam/BootRules | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build/jam/BootRules b/build/jam/BootRules index b5c26562a4..edbabcfafa 100644 --- a/build/jam/BootRules +++ b/build/jam/BootRules @@ -182,13 +182,19 @@ rule BootMergeObject rule BootStaticLibrary { - # Usage BootStaticLibrary : : ; + # BootStaticLibrary : : ; # This is designed to take a set of sources and libraries and create - # a file called lib.a + # a static library. + local extraFlags = $(3) ; TARGET_PACKAGING_ARCH on $(1) = $(TARGET_KERNEL_ARCH) ; - SetupBoot $(2) : $(3) : false ; + if $(TARGET_CC_IS_LEGACY_GCC_$(TARGET_KERNEL_ARCH)) = 0 + && [ on $(1) return $(NO_HIDDEN_VISIBILITY) ] != 1 { + extraFlags += -fvisibility=hidden ; + } + + SetupBoot $(2) : $(extraFlags) : false ; Library $(1) : $(2) ; }