Hi Marcus, thanks for the fast reply. On 27.09.22 at 09:18 Marcus Meissner wrote:
Maybe someone can enlighten me on how to properly revert FORTIFY_SOURCE=3? :-)
try
export RPM_OPT_FLASG="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
That did not work, even when I fixed the typo ("FLASG"). :-)
export CLAGS="%optflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
at begin of %build section?
That does not work either (when using "CFLAGS" instead of "CLAGS"). It also does not work when moving the %optflags to the end. The resulting gcc call has both arguments (FORTIFY_SOURCE=2 and FORTIFY_SOURCE=3) and it seems the FORTIFY_SOURCE=3 wins...
gcc -DHAVE_CONFIG_H -I. -I.. -Wall -ggdb -D_GNU_SOURCE -DSBINDIR=\"\" -pthread -I/usr/include/fuse -D_FILE_OFFSET_BITS=64 -DLIBDIR=\"/usr/lib64\" -DRUNTIME_PATH=\"/run\" -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
But your recommendations lead me to something that does the trick:
%build # disable FORTIFY_SOURCE=3 and switch back to FORTIFY_SOURCE=2 CFLAGS_NEW="%optflags" CFLAGS="${CFLAGS_NEW/FORTIFY_SOURCE=3/FORTIFY_SOURCE=2}" echo "CFLAGS is set to $CFLAGS" export CFLAGS
Not nice, but working. :-) Kind Regards, Johannes P.S.: I just found out that the error with lxc and lxcfs was not related to FORTIFY_SOURCE=3, as it still fails to build using FORTIFY_SOURCE=2. But I am one step further to getting them fixed... -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537