gcc build flags on the Fedora 41 system:
rpm --eval “%{optflags}”
“-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer”
rpm --eval “%{build_ldflags}”
“-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ”
gcc build flags in the Fedora 41 mock environment:
<mock-chroot> sh-5.2# rpm --eval “%{optflags}”
“-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer”
<mock-chroot> sh-5.2# rpm --eval “%{build_ldflags}”
“-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ”
The gcc flags are the same in both environments. On the Fedora 41 system I have gcc installed with:
dnf group install "Development Tools"
dnf group install 'C Development Tools and Libraries'
Maybe the mock environment does not have all that installed. The rpm spec inside the source rpm has these requires, but it is the same source rpm I am using in both environments so that should not make a difference.
BuildRequires: gcc
BuildRequires: ncurses-devel
BuildRequires: libpq-devel
BuildRequires: bison flex procps-ng
BuildRequires: rpcgen libtirpc-devel
Here is the actual rpm that I am trying to rebuild:
dnf download --source aubit4gl
rpmbuild --rebuild aubit4gl-1.6.1.p4-2.fc41.src.rpm