From 988e6b8c82c5e317758f16034199eb13fdc9c2b3 Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Tue, 24 Sep 2024 07:58:53 -0700 Subject: [PATCH] [tests] Add `-Wno-implicit-function-declaration` for LTP build Currently used version of LTP has a bug that results in the following build error, e.g. when using Clang v18 on Ubuntu 24.04: clone301.c:136:8: error: call to undeclared function 'pidfd_send_signal' This is because Clang promoted "implicit function declaration" check from a warning to an error starting from Clang v16. This commit adds `-Wno-implicit-function-declaration` flag to CFLAGS during LTP build. Newer LTP releases fixed this bug, so in the future, when Gramine uses newer LTP, this commit should be reverted. Signed-off-by: Dmitrii Kuvaiskii --- libos/test/ltp/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libos/test/ltp/Makefile b/libos/test/ltp/Makefile index 8a6a73287a..9379a84a72 100644 --- a/libos/test/ltp/Makefile +++ b/libos/test/ltp/Makefile @@ -6,6 +6,11 @@ BUILDDIR = $(ROOTDIR)/build INSTALLDIR = $(ROOTDIR)/install TESTCASEDIR = $(INSTALLDIR)/testcases/bin +# Without the below flag, LTP's clone301 test fails on Clang 18 (e.g. on Ubuntu 24.04) with +# "error: implicit declaration of function pidfd_send_signal". +# TODO: Remove this flag when LTP is updated to the latest release (where this is fixed). +EXTRA_CFLAGS = -Wno-implicit-function-declaration + clean-extra += clean-build .PHONY: all @@ -24,7 +29,7 @@ $(BUILDDIR)/BUILD_SUCCESS: $(SRCDIR)/configure mkdir -p $(BUILDDIR) # Kernel module tests are not meaningful for our LibOS and building them causes troubles on # incompatible host kernels. - cd $(BUILDDIR) && $(SRCDIR)/configure --without-modules --prefix $(INSTALLDIR) + cd $(BUILDDIR) && $(SRCDIR)/configure CFLAGS=$(EXTRA_CFLAGS) --without-modules --prefix $(INSTALLDIR) $(MAKE) -C $(BUILDDIR) -f $(SRCDIR)/Makefile top_srcdir=$(SRCDIR) top_builddir=$(BUILDDIR) all touch $@