tpm-emulator
tpm-emulator copied to clipboard
add extern to function declarations
Code compiled with gcc10 will not link properly due to multiple definition of the same function.
ld: /home/abuild/rpmbuild/BUILD/xen-4.8.20191211T160002.8db85532cb/non-dbg/stubdom/vtpm/vtpm.a(vtpm_cmd.o):(.bss+0x28): multiple definition of `tpm_malloc'; /home/abuild/rpmbuild/BUILD/xen-4.8.20191211T160002.8db85532cb/non-dbg/stubdom/vtpm/vtpm.a(vtpm.o):(.bss+0x728): first defined here
Signed-off-by: Olaf Hering [email protected] Reviewed-by: Jason Andryuk [email protected] Acked-by: Samuel Thibault [email protected] Reviewed-by: Ian Jackson [email protected] Release-acked-by: Paul Durrant [email protected]
Move over from xen repo.
Signed-off-by: Jason Andryuk [email protected]
I was briefly confused by this, as functions are extern by default in C, but these are function pointers, so the extern makes a difference and resolves the issue.
Thanks, I fall into this problem with gcc 11.4 and find that gcc 10 change its default behavior about global variable (defaulted to -fcommon for gcc < 10 and -fno-common for gcc >= 10). You PR is the right way to correct that though