[debian-mysql] Bug#1053738: Bug#1053738: mariadb: what's up with the binary sizes?

наб nabijaczleweli at nabijaczleweli.xyz
Wed Oct 11 03:02:39 BST 2023


On Mon, Oct 09, 2023 at 04:52:15PM -0700, Otto Kekäläinen wrote:
> Any ideas on how to reduce the binary size are welcome!
I started by looking at the buildd log to confirm my bias and succeeded:
the linker step for resolveip, for example, is passed a couple
libwhatever.a files, no -flto, no -Wl,--as-needed.

Doing, effectively, /^+/s/")/ -flto")/ to
  d/patches/0025-Change-the-default-optimization-from-O3-to-O2-in-mys.patch
(real blessing that's there, I'd've given up otherwise) got me
  -rwxr-xr-x 1 nabijaczleweli users 586K 10-11 03:24 perror
  -rwxr-xr-x 1 nabijaczleweli users 384K 10-11 03:24 replace
  -rwxr-xr-x 1 nabijaczleweli users 384K 10-11 03:24 resolveip
  -rwxr-xr-x 1 nabijaczleweli users 5.1M 10-11 03:25 ./builddir/client/mariadb
  -rwxr-xr-x 1 nabijaczleweli users 5.0M 10-11 03:26 ./builddir/storage/maria/aria_chk
  -rwxr-xr-x 1 nabijaczleweli users 441K 10-11 03:26 ./builddir/storage/maria/aria_dump_log
  -rwxr-xr-x 1 nabijaczleweli users 4.7M 10-11 03:26 ./builddir/storage/maria/aria_ftdump
  -rwxr-xr-x 1 nabijaczleweli users 4.8M 10-11 03:26 ./builddir/storage/maria/aria_pack
  -rwxr-xr-x 1 nabijaczleweli users 4.9M 10-11 03:26 ./builddir/storage/maria/aria_read_log
  -rwxr-xr-x 1 nabijaczleweli users 466K 10-11 03:26 ./builddir/storage/maria/aria_s3_copy
after a no-arg strip on bookworm GCC.

So it's still large, but appears to defeat
"everything is 4.5M + application code" at least.

Alas, the build fails with
  ../storage/csv/./sql/table.h:1651: warning: type of ‘use_all_columns’ does not match original declaration [-Wlto-type-mismatch]
  ../storage/myisam/./sql/table.h:1651:15: note: ‘use_all_columns’ was previously declared here
  ../storage/myisam/./sql/table.h:1651:15: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
  ./builddir/libmysqld/libmysqld_exports_file.cc:148:15: error: function ‘mariadb_field_attr’ redeclared as variable
  ./libmysqld/libmysql.c:743:1: note: previously declared here
  ./builddir/libmysqld/libmysqld_exports_file.cc:147:15: error: function ‘mysql_options4’ redeclared as variable
  ./sql-common/client.c:3918:1: note: previously declared here
  ./builddir/libmysqld/libmysqld_exports_file.cc:146:15: error: function ‘mysql_net_field_length’ redeclared as variable
  ./libmysqld/libmysql.c:4974:15: note: previously declared here
  ./builddir/libmysqld/libmysqld_exports_file.cc:145:15: error: function ‘mysql_net_read_packet’ redeclared as variable
  ./libmysqld/libmysql.c:4969:15: note: previously declared here
  and many others like it
so no stats for mariadbd.


-flto -Wl,--as-needed is the same,
and just -Wl,--as-needed has no effect.

So it'd appear mariadb is resistant to having smaller binaries.

Ah well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-mysql-maint/attachments/20231011/9eb94556/attachment.sig>


More information about the pkg-mysql-maint mailing list