mesonbuild/meson

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

Aperta

#3059 aperta il 13 feb 2018

 (17 commenti) (0 reazioni) (0 assegnatari)Python (1465 fork)batch import
compilersgood first issuehelp wanted

Metriche repository

Star
 (4978 stelle)
Metriche merge PR
 (Merge medio 139g 13h) (51 PR mergiate in 30 g)

Descrizione

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

Guida contributor