Closed kloczek closed 3 years ago
you probably miss -g
in %optflags or do not pass it to the compiler
If it would true all my meson builds would be reporting the same issue.
$ rpm -E %meson
export CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none}";
export CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none}";
export FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none}";
export FCFLAGS="${FCFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none}";
export LDFLAGS="${LDFLAGS:--Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin}";
export AR="/usr/bin/gcc-ar" RANLIB="/usr/bin/gcc-ranlib" NM="/usr/bin/gcc-nm";
export CC="gcc" CXX="g++"
/usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu
As you see -g
is used.
As well I would point one more time on file
and ls -l
output at the end of the %install:
+ ls -l /home/tkloczko/rpmbuild/BUILDROOT/gnome-tour-3.38.0-2.fc34.x86_64/usr/bin/gnome-tour
-rwxr-xr-x. 1 tkloczko tkloczko 2379352 Sep 16 00:18 /home/tkloczko/rpmbuild/BUILDROOT/gnome-tour-3.38.0-2.fc34.x86_64/usr/bin/gnome-tour
+ file /home/tkloczko/rpmbuild/BUILDROOT/gnome-tour-3.38.0-2.fc34.x86_64/usr/bin/gnome-tour
/home/tkloczko/rpmbuild/BUILDROOT/gnome-tour-3.38.0-2.fc34.x86_64/usr/bin/gnome-tour: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=da2bb66637ef92012ace0c18de70d27a43275c04, for GNU/Linux 3.2.0, not stripped, too many notes (256)
As you see file
says about that binary not stripped, too many notes (256)
After rpm fails fecause none of the debug info files foud ls shows:
$ ls -l /home/tkloczko/rpmbuild/BUILDROOT/gnome-tour-3.38.0-2.fc34.x86_64/usr/bin/gnome-tour
-rwxr-xr-x. 1 tkloczko tkloczko 1776784 Sep 19 21:00 /home/tkloczko/rpmbuild/BUILDROOT/gnome-tour-3.38.0-2.fc34.x86_64/usr/bin/gnome-tour
So something stripped that binart reducing its size from 2379352 to 1776784 bytes.
I've spend a bit more time on that case and I think that you may be actually right https://gitlab.gnome.org/GNOME/gnome-tour/-/issues/24
OK, this is an packaging issue then. Closing here.
Building my own gnome-tour I found strange case. After
%meson_install
binary gnome-tour binary is not stripped but after `post installation of course it is stripped but there is no debug info file and by this buid fails.I found that even in Fedora spec file packager staped on that issue as well but only
%global debug_package %{nil}
has been added as work around. https://src.fedoraproject.org/rpms/gnome-tour/blob/master/f/gnome-tour.spec So far I found only one such case but it may be more.