This patch disables linking libgcc.a library with --whole-archive in order to make resulting loader-stripped.elf 2.5 MB smaller. The libgcc.a contains number of functions and huge tables of numbers that are part of Decimal Float Library (https://gcc.gnu.org/onlinedocs/gccint/Decimal-float-library-routines.html#Decimal-float-library-routines), which are not used by OSv kernel.
Any potential side-effects caused by this patch have been tested against almost 20 different apps including java, python, golang, rust, MySQL and redis and no issues have been found. Size of kernel (ROFS version) before this patch: 9.2M loader-stripped.elf 6.2M lzloader.elf (33% reduction) Size of kernel (ROFS version) after this patch: 6.7M loader-stripped.elf 3.9M lzloader.elf (42% reduction) These are related patches: c9e61d4a45d88d8c8e79cd52fbcd38b91b291d5e be565320c082c00069614c850d29b42831b3dea6 Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 44a86c01..2270206b 100644 --- a/Makefile +++ b/Makefile @@ -1869,9 +1869,9 @@ $(out)/loader.elf: $(stage1_targets) arch/$(arch)/loader.ld $(out)/bootfs.o -Bdynamic --export-dynamic --eh-frame-hdr --enable-new-dtags \ $(^:%.ld=-T %.ld) \ --whole-archive \ - $(libstdc++.a) $(libgcc.a) $(libgcc_eh.a) \ + $(libstdc++.a) $(libgcc_eh.a) \ $(boost-libs) \ - --no-whole-archive, \ + --no-whole-archive $(libgcc.a), \ LINK loader.elf) @# Build libosv.so matching this loader.elf. This is not a separate @# rule because that caused bug #545. -- 2.17.1 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.