From c4f853aa00f1650b678cbd22ad1e2a9cf01c1303 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 26 Aug 2020 15:41:00 -0500 Subject: [PATCH] UKERNEL: Build linktest with COMMON_CFLAGS Currently, 'linktest' in libuafs is built with a weird custom rule that specifies several various CFLAGS and LDFLAGS, etc. One side-effect of this is that linktest is built without specifying -O, even if optimization is otherwise enabled. Normally nobody would care about the optimization of linktest, since it's never supposed to be run, but this can cause an error when building with -D_FORTIFY_SOURCE=1 on some systems (such as RHEL7): In file included from /usr/include/sys/types.h:25:0, from /.../src/config/afsconfig.h:1485, from /.../src/libuafs/linktest.c:15: /usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] # warning _FORTIFY_SOURCE requires compiling with optimization (-O) ^ cc1: all warnings being treated as errors make[3]: *** [linktest] Error 1 For now, to fix this just include $(COMMON_CFLAGS) in the flags we give for linktest, so $(OPTMZ) also gets pulled in, and building linktest gets a little closer to a normal compilation step. Change-Id: I3362dcfe8407825ab88854ae59da4188ed16be9d Reviewed-on: https://gerrit.openafs.org/14324 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk --- src/libuafs/Makefile.common.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libuafs/Makefile.common.in b/src/libuafs/Makefile.common.in index 09234cf11e..513808d569 100644 --- a/src/libuafs/Makefile.common.in +++ b/src/libuafs/Makefile.common.in @@ -212,7 +212,7 @@ ${TOP_LIBDIR}/perl/AFS/ukernel.pm: setup_perllib PERLUAFS/ukernel.pm LIBUAFS_BUILD_PERL: ${TOP_LIBDIR}/perl/ukernel.so ${TOP_LIBDIR}/perl/AFS/ukernel.pm linktest: libuafs.a - $(CC) $(CFLAGS) $(TEST_CFLAGS) $(TEST_LDFLAGS) \ + $(CC) $(COMMON_CFLAGS) $(TEST_CFLAGS) $(TEST_LDFLAGS) \ $(LDFLAGS_roken) $(LDFLAGS_hcrypto) -o linktest \ ${srcdir}/linktest.c $(MODULE_INCLUDE) -DUKERNEL \ libuafs.a ${TOP_LIBDIR}/libcmd.a \