mesonbuild/meson

Libraries built with lto and meson/ninja are larger than with configure/make

Ouverte

#3 059 ouverte le 13 févr. 2018

 (17 commentaires) (0 réaction) (0 personne assignée)Python (1 465 forks)batch import
compilersgood first issuehelp wanted

Métriques du dépôt

Stars
 (4 978 étoiles)
Métriques de merge PR
 (Merge moyen 139j 13h) (51 PRs mergées en 30 j)

Description

Using meson-0.43.0, ninja-1.8.2, gcc-7.2.0

Building glib-2.54.3 with lto as per below results in the following library sizes for libgio-2.0.so.0.5400.3 (stripped)

1,419,000 bytes with configure/make 1,525,688 bytes with meson/ninja

i.e. about 100kb or 10% larger with meson/ninja

from "ninja -v", it appears that lto is being used at link time, but maybe this isn't the case?

CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti" meson --prefix=/usr/local --buildtype=plain -Dwith-pcre=system -Dwith-docs=no -Denable-libmount=no ..

ninja [fails at link ninja: build stopped: subcommand failed unless locale set to UTF8] [1m 17.80s]
sudo ninja install
CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --disable-static --with-pcre=system --disable-libmount

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [1m 31.96s]
sudo make install

Guide contributeur