summaryrefslogtreecommitdiffstats
path: root/meta-tpm/recipes-tpm2/ibmswtpm2/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-tpm/recipes-tpm2/ibmswtpm2/files')
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch27
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch26
-rw-r--r--meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch50
3 files changed, 77 insertions, 26 deletions
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch b/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch
new file mode 100644
index 0000000..f2938e0
--- /dev/null
+++ b/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch
@@ -0,0 +1,27 @@
1Fix strict aliasing issue of gcc10
2
3fixes:
4
5TpmFail.c: In function 'TpmLogFailure':
6TpmFail.c:217:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
7 217 | s_failFunction = *(UINT32 *)&function; /* kgold */
8 | ^~~~~~~~~~~~~~~~~~~
9cc1: all warnings being treated as errors
10
11Upstream-Status: Submitted
12
13Signed-off-by: Jens Rehsack <sno@NetBSD.org>
14
15Index: src/TpmFail.c
16===================================================================
17--- src.orig/TpmFail.c 2020-09-10 15:43:57.085063875 +0200
18+++ src/TpmFail.c 2020-09-10 15:48:35.563302634 +0200
19@@ -214,7 +214,7 @@
20 // On a 64-bit machine, this may truncate the address of the string
21 // of the function name where the error occurred.
22 #if FAIL_TRACE
23- s_failFunction = *(UINT32 *)&function; /* kgold */
24+ memcpy(&s_failFunction, function, sizeof(uint32_t)); /* kgold */
25 s_failLine = line;
26 #else
27 s_failFunction = 0;
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch b/meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch
deleted file mode 100644
index 2919e2e..0000000
--- a/meta-tpm/recipes-tpm2/ibmswtpm2/files/remove_optimization.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1Allow recipe to overide optimization.
2
3fixes:
4
5397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
6| | ^~~~~~~
7| cc1: all warnings being treated as errors
8
9
10Upstream-Status: OE specific
11
12Signed-off-by: Armin Kuster <akuster808@gmail.com>
13
14Index: src/makefile
15===================================================================
16--- src.orig/makefile
17+++ src/makefile
18@@ -43,7 +43,7 @@ CC = /usr/bin/gcc
19 CCFLAGS = -Wall \
20 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
21 -Werror -Wsign-compare \
22- -c -ggdb -O0 \
23+ -c -ggdb -O \
24 -DTPM_POSIX \
25 -D_POSIX_ \
26 -DTPM_NUVOTON
diff --git a/meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch b/meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch
new file mode 100644
index 0000000..eebddb9
--- /dev/null
+++ b/meta-tpm/recipes-tpm2/ibmswtpm2/files/tune-makefile.patch
@@ -0,0 +1,50 @@
11) Allow recipe to overide optimization.
2
3fixes:
4
5397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
6| | ^~~~~~~
7| cc1: all warnings being treated as errors
8
92) Allow recipe to override OE related compile-/link-flags
10
11fixes:
12
13ERROR: QA Issue: File /usr/bin/tpm_server in package ibmswtpm2 doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
14
15Upstream-Status: OE specific
16
17Signed-off-by: Jens Rehsack <sno@NetBSD.org>
18
19Index: src/makefile
20===================================================================
21--- src.orig/makefile
22+++ src/makefile
23@@ -38,12 +38,10 @@
24 #################################################################################
25
26
27-CC = /usr/bin/gcc
28-
29 CCFLAGS = -Wall \
30 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
31 -Werror -Wsign-compare \
32- -c -ggdb -O0 \
33+ -c -ggdb -O \
34 -DTPM_POSIX \
35 -D_POSIX_ \
36 -DTPM_NUVOTON
37@@ -79,11 +77,11 @@
38 .PRECIOUS: %.o
39
40 tpm_server: $(OBJFILES)
41- $(CC) $(OBJFILES) $(LNFLAGS) -o tpm_server
42+ $(CCLD) $(OBJFILES) $(LDFLAGS) $(LNFLAGS) -o tpm_server
43
44 clean:
45 rm -f *.o tpm_server *~
46
47 %.o: %.c
48- $(CC) $(CCFLAGS) $< -o $@
49+ $(CC) $(CCFLAGS) $(CFLAGS) $< -o $@
50