build: set hash-style to gnu via gcc default

Builds use a mix of styles for the hash table in the ELF header. Only
one style of table is necessary, and the GNU one is more performant
for lookups. Eliminating the SysV style hash table trims ~450kb. This
is done via setting the default linker in gcc instead of LDFLAGS as
some packages ignore LDFLAGS.

Note that if MIPS is ever added as a supported architecture, it
does not support hash-style=gnu at this time.

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
Ian Leonard 2018-06-02 06:32:33 +00:00
parent dfdae5e027
commit c7952a9539
2 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
GCC_OPTIM="-Os"
# Linker hash-style is set to gnu via gcc default
LD_OPTIM="-Wl,--as-needed"
if [ "${BUILD_WITH_DEBUG}" = "yes" ]; then

View File

@ -41,6 +41,7 @@ GCC_COMMON_CONFIGURE_OPTS="--target=$TARGET_NAME \
--enable-lto \
--enable-gold \
--enable-ld=default \
--with-linker-hash-style=gnu \
--disable-multilib \
--disable-nls \
--enable-checking=release \