Skip to contentSkip to conversation

stubdom/vtpm: add extern to function declarations

PATCH In review Olaf Hering 5 participants 6 messages Jun 17, 2020 – Jun 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stubdom/vtpm: add extern to function declarations

Code compiled with gcc10 will not link properly due to multiple definition of the same function.

---
 stubdom/Makefile          |  1 +
 stubdom/vtpm_extern.patch | 48 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 stubdom/vtpm_extern.patch
stubdom/Makefile +1 -0
index 12aa211ac3..af8cde41b9 100644
@@ -231,6 +231,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-cmake-Wextra.patch
 	patch -d $@ -p1 < vtpm-implicit-fallthrough.patch
 	patch -d $@ -p1 < vtpm_TPM_ChangeAuthAsymFinish.patch
+	patch -d $@ -p1 < vtpm_extern.patch
 	mkdir $@/build
 	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
stubdom/vtpm_extern.patch new file +48 -0

48 lines not on this page · raw message

Reviewed-by
#3 lore raw

Samuel Thibault writes ("Re: [PATCH v1] stubdom/vtpm: add extern to function declarations"):

Quoted 10 lines

Jason Andryuk, le mer. 17 juin 2020 09:35:52 -0400, a ecrit:

Quoted 7 lines · Olaf Hering
Quoted 4 lines

Code compiled with gcc10 will not link properly due to multiple definition of the same function.

Thanks. I have confirmed that these symbols look to be defined (in tpm/tpm_emulator_extern.c). So the patch is correct.

I think this is 4.14 material. Paul ?

We should also consider it for backports. How far back do we need to go ?

Ian.

#4 lore raw
Quoted 18 lines

-----Original Message-----
From: Ian Jackson <[email protected]>
Sent: 18 June 2020 16:56
To: Paul Durrant <[email protected]>
Cc: Samuel Thibault <[email protected]>; Jason Andryuk <[email protected]>; Olaf Hering <[email protected]>; xen-devel <[email protected]>; Wei Liu <[email protected]>
Subject: Re: [XEN PATCH for-4.14 v1] stubdom/vtpm: add extern to function declarations

Samuel Thibault writes ("Re: [PATCH v1] stubdom/vtpm: add extern to function declarations"):

Quoted 9 lines

Jason Andryuk, le mer. 17 juin 2020 09:35:52 -0400, a ecrit:

Quoted 7 lines · Olaf Hering
Quoted 4 lines

Code compiled with gcc10 will not link properly due to multiple definition of the same function.

Quoted 8 lines
Quoted 1 line

Thanks. I have confirmed that these symbols look to be defined (in tpm/tpm_emulator_extern.c). So the patch is correct.

I think this is 4.14 material. Paul ?

Agreed.

Quoted 5 lines

We should also consider it for backports. How far back do we need to go ?

Ian.

#5 lore raw

Paul Durrant writes ("RE: [XEN PATCH for-4.14 v1] stubdom/vtpm: add extern to function declarations"):

Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: Ian Jackson <[email protected]>

...

Quoted 5 lines
Quoted 1 line

I think this is 4.14 material. Paul ?

Agreed.

Thanks, pushed.

Ian.