diff mbox series

[1/1] package/ibm-sw-tpm2: fix glibc build errors

Message ID 20200817192712.32481-1-vfazio@xes-inc.com
State Superseded
Headers show
Series [1/1] package/ibm-sw-tpm2: fix glibc build errors | expand

Commit Message

Vincent Fazio Aug. 17, 2020, 7:27 p.m. UTC
From: Vincent Fazio <vfazio@gmail.com>

In order to not have to define all architecture bitness variants in
src/LibSupport.h to conditionally define RADIX_BITS, a patch was created
to depend on LONG_BIT being defined via limits.h

For glibc, LONG_BIT is behind a _XOPEN_SOURCE define guard so patch the
makefile to define this macro as well as _DEFAULT_SOURCE.

Defining _XOPEN_SOURCE requires _DEFAULT_SOURCE to be explicitly defined
for builds to succeed as it is no longer impliclty defined when
_XOPEN_SOURCE is defined.

Fixes:
	http://autobuild.buildroot.net/results/bc145dd23c80a0660300766d0c114a00ed2e52b6/
	http://autobuild.buildroot.net/results/1d84e70c30d4d0719274aa4f3edc01772beb24a3/

Fixes: 19bd089004 ("package/ibm-sw-tpm2: fix patch to address musl builds")

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
---
 package/ibm-sw-tpm2/0002-Add-required-defines.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 package/ibm-sw-tpm2/0002-Add-required-defines.patch

Comments

Thomas Petazzoni Aug. 18, 2020, 1:29 p.m. UTC | #1
Hello Vincent,

Thanks for having looked into this issue!

On Mon, 17 Aug 2020 14:27:12 -0500
Vincent Fazio <vfazio@xes-inc.com> wrote:

> diff --git a/package/ibm-sw-tpm2/0002-Add-required-defines.patch b/package/ibm-sw-tpm2/0002-Add-required-defines.patch
> new file mode 100644
> index 0000000000..c9e2f19bd2
> --- /dev/null
> +++ b/package/ibm-sw-tpm2/0002-Add-required-defines.patch

All patches must have a proper Git commit message, with a description
and Signed-off-by line.

However, in this case, I think this shouldn't be a separate 0002 patch:
the patch 0001 that makes use of LONG_BIT should be adjusted.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/ibm-sw-tpm2/0002-Add-required-defines.patch b/package/ibm-sw-tpm2/0002-Add-required-defines.patch
new file mode 100644
index 0000000000..c9e2f19bd2
--- /dev/null
+++ b/package/ibm-sw-tpm2/0002-Add-required-defines.patch
@@ -0,0 +1,11 @@ 
+--- a/src/makefile
++++ b/src/makefile
+@@ -46,6 +46,8 @@ CCFLAGS = -Wall  			\
+ 	 -c -ggdb -O0 			\
+ 	-DTPM_POSIX			\
+ 	-D_POSIX_			\
++	-D_DEFAULT_SOURCE		\
++	-D_XOPEN_SOURCE			\
+ 	-DTPM_NUVOTON
+ 
+ # add this line for big endian platforms