From 4ccae4f8c6e9724c7b5a891aecfe37475549ee6a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 24 Oct 2021 21:38:32 +0300 Subject: removed -rdynamic linker flag: should speed up release/nightly builds and decrease the binary size significantly * -rdynamic was added to make sure that malloc replacement functions were exported and visible to shared libraries. It was more or less currently only used on Linux and Haiku as Win32 and Mac OS do not override malloc. * The option however exported all symbols which would prevent them to be removed at link-time. Other optimizations could also be affected, perhaps resulting in less inlining. * On Haiku, -rdynamic is not supported and cause build failures. * It has been tested (nm -D ./sciteco | grep ' T ') that malloc() and friends are exported even when linking with -O3. Even the __attribute__((used)) has been shown to be superfluous, but we keep it anyway just to be sure. --- src/Makefile.am | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 76c5843..ab6e35f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,12 +16,6 @@ AM_CFLAGS = -std=gnu11 -Wall -Wno-initializer-overrides -Wno-unused-value AM_CPPFLAGS += -I$(top_srcdir)/contrib/rb3ptr AM_LDFLAGS = -if REPLACE_MALLOC -# NOTE: This may be necessary to ensure that malloc() overriding -# works. It may prevent elimination of unused functions, though. -AM_LDFLAGS += -rdynamic -endif - if STATIC_EXECUTABLES # AM_LDFLAGS are libtool flags, NOT compiler/linker flags AM_LDFLAGS += -all-static -- cgit v1.2.3