Skip to contentSkip to conversation

package/ibm-sw-tpm2: fix glibc build errors

PATCH Superseded Vincent Fazio 2 participants 2 messages Aug 17, 2020 – Aug 18, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

From: Vincent Fazio <[email protected]>

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")
---
 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
package/ibm-sw-tpm2/0002-Add-required-defines.patch new file +11 -0
new file mode 100644
index 0000000000..c9e2f19bd2
@@ -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
Signature · 1 line
2.28.0
#1 lore raw

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

Hello Vincent,

Thanks for having looked into this issue!

package/ibm-sw-tpm2/0002-Add-required-defines.patch

Quoted 5 lines · On Mon, 17 Aug 2020 14:27:12 -0500 Vincent Fazio <[email protected]> wrote:
package/ibm-sw-tpm2/0002-Add-required-defines.patch new file +0 -0
new file mode 100644
index 0000000000..c9e2f19bd2

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com