{"action":"created","issue":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/3059","repository_url":"https://api.github.com/repos/mesonbuild/meson","labels_url":"https://api.github.com/repos/mesonbuild/meson/issues/3059/labels{/name}","comments_url":"https://api.github.com/repos/mesonbuild/meson/issues/3059/comments","events_url":"https://api.github.com/repos/mesonbuild/meson/issues/3059/events","html_url":"https://github.com/mesonbuild/meson/issues/3059","id":296624449,"number":3059,"title":"Libraries built with lto and meson/ninja are larger than with configure/make","user":{"login":"juanitotc","id":11058217,"avatar_url":"https://avatars1.githubusercontent.com/u/11058217?v=4","gravatar_id":"","url":"https://api.github.com/users/juanitotc","html_url":"https://github.com/juanitotc","followers_url":"https://api.github.com/users/juanitotc/followers","following_url":"https://api.github.com/users/juanitotc/following{/other_user}","gists_url":"https://api.github.com/users/juanitotc/gists{/gist_id}","starred_url":"https://api.github.com/users/juanitotc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanitotc/subscriptions","organizations_url":"https://api.github.com/users/juanitotc/orgs","repos_url":"https://api.github.com/users/juanitotc/repos","events_url":"https://api.github.com/users/juanitotc/events{/privacy}","received_events_url":"https://api.github.com/users/juanitotc/received_events","type":"User","site_admin":false},"labels":[{"id":251967616,"url":"https://api.github.com/repos/mesonbuild/meson/labels/compilers","name":"compilers","color":"c7def8","default":false},{"id":776921620,"url":"https://api.github.com/repos/mesonbuild/meson/labels/good%20first%20issue","name":"good first issue","color":"7057ff","default":true},{"id":448958539,"url":"https://api.github.com/repos/mesonbuild/meson/labels/help%20wanted","name":"help wanted","color":"75B427","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T06:09:08Z","updated_at":"2018-02-19T11:10:48Z","closed_at":null,"author_association":"NONE","body":"Using meson-0.43.0, ninja-1.8.2, gcc-7.2.0\r\n\r\nBuilding glib-2.54.3 with lto as per below results in the following library sizes for libgio-2.0.so.0.5400.3 (stripped)\r\n\r\n1,419,000 bytes with configure/make\r\n1,525,688 bytes with meson/ninja\r\n\r\ni.e. about 100kb or 10% larger with meson/ninja\r\n\r\nfrom \"ninja -v\", it appears that lto is being used at link time, but maybe this isn't the case?\r\n\r\n```\r\nCC=\"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 ..\r\n\r\nninja [fails at link ninja: build stopped: subcommand failed unless locale set to UTF8] [1m 17.80s]\r\nsudo ninja install\r\n```\r\n```\r\nCC=\"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\r\n\r\nfind . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \\;\r\n\r\nmake [1m 31.96s]\r\nsudo make install\r\n```"},"comment":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/comments/366658326","html_url":"https://github.com/mesonbuild/meson/issues/3059#issuecomment-366658326","issue_url":"https://api.github.com/repos/mesonbuild/meson/issues/3059","id":366658326,"user":{"login":"nirbheek","id":75801,"avatar_url":"https://avatars0.githubusercontent.com/u/75801?v=4","gravatar_id":"","url":"https://api.github.com/users/nirbheek","html_url":"https://github.com/nirbheek","followers_url":"https://api.github.com/users/nirbheek/followers","following_url":"https://api.github.com/users/nirbheek/following{/other_user}","gists_url":"https://api.github.com/users/nirbheek/gists{/gist_id}","starred_url":"https://api.github.com/users/nirbheek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirbheek/subscriptions","organizations_url":"https://api.github.com/users/nirbheek/orgs","repos_url":"https://api.github.com/users/nirbheek/repos","events_url":"https://api.github.com/users/nirbheek/events{/privacy}","received_events_url":"https://api.github.com/users/nirbheek/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T11:10:48Z","updated_at":"2018-02-19T11:10:48Z","author_association":"MEMBER","body":"Most are, but some aren't:\r\n\r\nmake:\r\n> gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\\\"GLib-GIO\\\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_DISABLE_CAST_CHECKS -DGIO_COMPILATION -DGIO_MODULE_DIR=\\\"/usr/local/lib/gio/modules\\\" -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format=2 -Werror=missing-include-dirs -fvisibility=hidden -flto -fuse-linker-plugin -mtune=generic -Os -pipe -MT libgio_2_0_la-gfile.lo -MD -MP -MF .deps/libgio_2_0_la-gfile.Tpo -c gfile.c  -fPIC -DPIC -o .libs/libgio_2_0_la-gfile.o\r\n\r\nninja:\r\n> cc  -Igio/gio-2.0@sha -Igio -I../gio -I. -I../ -Iglib -I../glib -Igobject -I../gobject -Igmodule -I../gmodule -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu89 -D_GNU_SOURCE -flto -fuse-linker-plugin -mtune=generic -Os -fPIC '-DG_LOG_DOMAIN=\"GLib-GIO\"' -DGIO_COMPILATION '-DGIO_MODULE_DIR=\"/usr/local/lib/gio/modules\"' -fvisibility=hidden -MMD -MQ 'gio/gio-2.0@sha/gfile.c.o' -MF 'gio/gio-2.0@sha/gfile.c.o.d' -o 'gio/gio-2.0@sha/gfile.c.o' -c ../gio/gfile.c\r\n\r\nI can see at least `-std=gnu89`, `-D_GNU_SOURCE` and `-DHAVE_CONFIG_H` are different. This might be relevant or it might not be. You should also compare the size before and after installation, and also check the link command. "}}
{"actor":{"display_login":"nirbheek"}}