Closed sharkcz closed 3 years ago
Thanks for reporting.
Does the following patch fix this?
From 91185d2c91fe853f9b3373002f87e938c1af701f Mon Sep 17 00:00:00 2001
From: Ingo Franzki <ifranzki@linux.ibm.com>
Date: Tue, 23 Feb 2021 08:52:26 +0100
Subject: [PATCH] zkey: Fix build error when when the compiler flags are
overridden
When the compiler flags are overridden, the build of zkey may fail with:
kms.c:44:2: error: #error KMS_PLUGIN_LOCATION must be defined
44 | #error KMS_PLUGIN_LOCATION must be defined
| ^~~~~
The Makefile uses CFLAGS variable for defining the KMS_PLUGIN_LOCATION,
but it should rather use ALL_CFLAGS.
Closes: https://github.com/ibm-s390-linux/s390-tools/issues/108
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
---
zkey/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zkey/Makefile b/zkey/Makefile
index b28754824..5c878e1cb 100644
--- a/zkey/Makefile
+++ b/zkey/Makefile
@@ -36,7 +36,7 @@ endif
libs = $(rootdir)/libutil/libutil.a
-CFLAGS += -DKMS_PLUGIN_LOCATION=\"$(ZKEYKMSPLUGINDIR)\"
+ALL_CFLAGS += -DKMS_PLUGIN_LOCATION=\"$(ZKEYKMSPLUGINDIR)\"
detect-libcryptsetup.dep:
echo "#include <libcryptsetup.h>" > detect-libcryptsetup.dep
--
yes, it does and I think CPPFLAGS
from https://github.com/ibm-s390-linux/s390-tools/blob/master/zkey/Makefile#L21 should be changed to ALL_CPPFLAGS
too
Yes right. Actually it should be ALL_CFLAGS
, not ALL_CPPFLAGS
, since we don't have C++ there anyway.
Updated patch:
From 50b1607a63fd6850f28ac3962b2291336655a463 Mon Sep 17 00:00:00 2001
From: Ingo Franzki <ifranzki@linux.ibm.com>
Date: Tue, 23 Feb 2021 08:52:26 +0100
Subject: [PATCH] zkey: Fix build error when when the compiler flags are
overridden
When the compiler flags are overridden, the build of zkey may fail with:
kms.c:44:2: error: #error KMS_PLUGIN_LOCATION must be defined
44 | #error KMS_PLUGIN_LOCATION must be defined
| ^~~~~
The Makefile uses CFLAGS variable for defining the KMS_PLUGIN_LOCATION,
but it should rather use ALL_CFLAGS.
Also use ALL_CFLAGS for defining HAVE_LUKS2_SUPPORT.
Closes: https://github.com/ibm-s390-linux/s390-tools/issues/108
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
---
zkey/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/zkey/Makefile b/zkey/Makefile
index b28754824..dd051690d 100644
--- a/zkey/Makefile
+++ b/zkey/Makefile
@@ -20,7 +20,7 @@ ifneq (${HAVE_CRYPTSETUP2},0)
ifneq (${HAVE_OPENSSL},0)
BUILD_TARGETS += zkey-cryptsetup
INSTALL_TARGETS += install-zkey-cryptsetup
- CPPFLAGS += -DHAVE_LUKS2_SUPPORT
+ ALL_CFLAGS += -DHAVE_LUKS2_SUPPORT
else
BUILD_TARGETS += zkey-cryptsetup-skip-openssl
INSTALL_TARGETS += zkey-cryptsetup-skip-openssl
@@ -36,7 +36,7 @@ endif
libs = $(rootdir)/libutil/libutil.a
-CFLAGS += -DKMS_PLUGIN_LOCATION=\"$(ZKEYKMSPLUGINDIR)\"
+ALL_CFLAGS += -DKMS_PLUGIN_LOCATION=\"$(ZKEYKMSPLUGINDIR)\"
detect-libcryptsetup.dep:
echo "#include <libcryptsetup.h>" > detect-libcryptsetup.dep
--
CPPFLAGS
as preprocessor flags, which is correct here, for C++ compiler there would be CXXFLAGS
Ah, right, will use ALL_CPPFLAGS then.
thanks :-)
I get this error when building version 2.16.0 in Fedora
I think the root cause is that zkey uses
CFLAGS
variable for defining theKMS_PLUGIN_LOCATION
in https://github.com/ibm-s390-linux/s390-tools/blob/master/zkey/Makefile#L37 while it should useALL_CFLAGS
or similar.