#54 Add `-fpermissive` to CFLAGS to workaround compilation errors on Fedora 40
Merged 2 months ago by jforbes. Opened 3 months ago by rebtoor.
rebtoor/kernel-tests fix-gcc-flags  into  master

@@ -111,8 +111,8 @@ 

  	$O/lib_sched.o

  

  lmbench: $(UTILS)

- 	@env LDFLAGS="-ltirpc" CFLAGS="-O -I/usr/include/tirpc" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all

- 	-@env LDFLAGS="-ltirpc" CFLAGS="-O -I/usr/include/tirpc" MAKE="$(MAKE)" MAKEFLAGS="-k $(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt

+ 	@env LDFLAGS="-ltirpc" CFLAGS="-fpermissive -O -I/usr/include/tirpc" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all

+ 	-@env LDFLAGS="-ltirpc" CFLAGS="-fpermissive -O -I/usr/include/tirpc" MAKE="$(MAKE)" MAKEFLAGS="-k $(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt

  

  results: lmbench

  	@env OS="${OS}" ../scripts/config-run

Trying to launch the performance test suite as described here [1], the compilation of the lmbench3 script is failing on Fedora 40 due to stricter validation rules enabled by default in gcc. Setting -fpermissive [2] in the CFLAGS variable, it will downgrade the compilation errors to warning messages.

Failing message:

gcc -O -I/usr/include/tirpc -DSYS5 -Dvalloc=malloc -DS_IFIFO=S_IFFIFO  -ltirpc -c lib_timing.c -o ../bin/x86_64-linux-gnu/lib_timing.o
lib_timing.c: In function ‘touch’:
lib_timing.c:1626:17: error: type defaults to ‘int’ in declaration of ‘psize’ [-Wimplicit-int]
 1626 |         static  psize;
      |                 ^~~~~
gmake[2]: *** [Makefile:240: ../bin/x86_64-linux-gnu/lib_timing.o] Error 1

[1] https://fedoraproject.org/wiki/QA:Testcase_kernel_regression#How_to_test
[2] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-fpermissive

Pull-Request has been merged by jforbes

2 months ago
Metadata