Skip to contentSkip to conversation

Building Xen 4.8 with GCC 7

PATCH Marek Marczykowski-Górecki 2 participants 2 messages Jun 27, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

I'm having troubles with building Xen with GCC 7 (Fedora 26). Some of the problems are fixed by "Compilation fixes for GCC 7" patch series sent a moment ago, but then I've stumbled on link failure of vtpmmgr stubdomain, related to some functions of tpm_emulator. I've already tried with -fkeep-inline-functions, but it only reduced number of errors. Below is both -fkeep-inline-functions patch and full error message.

Any idea?

stubdom/vtpmmgr/Makefile.new renamed from stubdom/vtpmmgr/Makefile +1 -1
@@ -17,7 +17,7 @@ OBJS += vtpm_disk.o disk_tpm.o disk_io.o
 OBJS += mgmt_authority.o
 
 CFLAGS+=-Werror -Iutil -Icrypto -Itcs
-CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label
+CFLAGS+=-Wno-declaration-after-statement -Wno-unused-label -fkeep-inline-functions
 
 build: $(TARGET)
 $(TARGET): $(OBJS)

ld -nostdlib -L/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/cross-root-x86_64/x86_64-xen-elf/lib -m elf_x86_64 -T arch/x86/minios-x86_64.lds /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o -o /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `vtpmmgr_GroupRegister':
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/vtpmmgr/vtpm_cmd_handler.c:555: undefined reference to `tpmrsa_free'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `vtpmmgr_GroupRegister':
vtpm_cmd_handler.c:(.text+0x3b6e): undefined reference to `tpmrsa_free'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `vtpmmgr_handle_cmd':
gdtoa-hexnan.c:(.text+0x4e68): undefined reference to `tpmrsa_free'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_TakeOwnership':
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/vtpmmgr/tpm.c:407: undefined reference to `unpack3_TPM_KEY'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_TakeOwnership':
gdtoa-hexnan.c:(.text+0x8726): undefined reference to `unpack3_TPM_KEY'
gdtoa-hexnan.c:(.text+0x8787): undefined reference to `unpack3_TPM_AUTH_SESSION'
gdtoa-hexnan.c:(.text+0x8827): undefined reference to `free_TPM_KEY'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_Seal':
gdtoa-hexnan.c:(.text+0x9435): undefined reference to `unpack3_TPM_STORED_DATA12'
gdtoa-hexnan.c:(.text+0x9496): undefined reference to `unpack3_TPM_AUTH_SESSION'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_Unseal':
gdtoa-hexnan.c:(.text+0x99d4): undefined reference to `unpack_ALLOC'
gdtoa-hexnan.c:(.text+0x9a28): undefined reference to `unpack3_TPM_AUTH_SESSION'
gdtoa-hexnan.c:(.text+0x9a62): undefined reference to `unpack3_TPM_AUTH_SESSION'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_LoadKey':
gdtoa-hexnan.c:(.text+0xa0c8): undefined reference to `unpack3_TPM_AUTH_SESSION'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_ReadPubek':
gdtoa-hexnan.c:(.text+0xa592): undefined reference to `unpack3_TPM_RSA_KEY_PARMS'
gdtoa-hexnan.c:(.text+0xa5b7): undefined reference to `unpack3_TPM_SYMMETRIC_KEY_PARMS'
gdtoa-hexnan.c:(.text+0xa616): undefined reference to `unpack3_PTR'
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_GetCapability':
gdtoa

     0K ..-hexnan.c:(.text+0xaafc): undefined reference to `unpack_ALLOC'

/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_CreateEndorsementKeyPair':
gdtoa-hexnan.c:(.text+0xae1b): undefined reference to unpack3_TPM_RSA_KEY_PARMS' gdtoa-hexnan.c:(.text+0xae3f): undefined reference to unpack3_TPM_SYMMETRIC_KEY_PARMS' gdtoa-hexnan.c:(.text+0xae9c): undefined reference to unpack3_PTR' /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function TPM_MakeIdentity':
gdtoa-hexnan.c:(.text+0xb646): undefined reference to unpack3_TPM_KEY' gdtoa-hexnan.c:(.text+0xb6c8): undefined reference to unpack_ALLOC'
gdtoa-hexnan.c:(.text+0xb72b): undefined reference to unpack3_TPM_AUTH_SESSION' gdtoa-hexnan.c:(.text+0xb768): undefined reference to unpack3_TPM_AUTH_SESSION' /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function `TPM_ActivateIdentity':
gdtoa-hexnan.c:(.text+0xbbcc): undefined reference to unpack3_TPM_SYMMETRIC_KEY' gdtoa-hexnan.c:(.text+0xbc3a): undefined reference to unpack3_TPM_AUTH_SESSION' gdtoa-hexnan.c:(.text+0xbc73): undefined reference to unpack3_TPM_AUTH_SESSION' /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function TPM_Quote':
gdtoa-hexnan.c:(.text+0xc015): undefined reference to unpack3_TPM_PCR_COMPOSITE' gdtoa-hexnan.c:(.text+0xc081): undefined reference to unpack_ALLOC'
gdtoa-hexnan.c:(.text+0xc0da): undefined reference to unpack3_TPM_AUTH_SESSION' /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function unpack_TPMU_PUBLIC_ID':
/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/vtpmmgr/tpm2_marshal.h:577: undefined reference to unpack_TPMS_ECC_POINT' /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os.o: In function TPM2_CreatePrimary':
gdtoa-hexnan.c:(.text+0xdadc): undefined reference to `unpack_TPMS_ECC_POINT'
make[2]: *** [Makefile:173: /home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/mini-os-x86_64-vtpmmgr/mini-os] Error 1 make[2]: Leaving directory '/home/user/rpmbuild/BUILD/xen-4.8.1/extras/mini-os'
make[1]: *** [Makefile:576: vtpmmgr-stubdom] Error 2
make[1]: Leaving directory '/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom'
make: *** [Makefile:105: install-stubdom] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.uyhPyK (%build)

Signature · 5 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#1 lore raw
Quoted 2 lines · Marek Marczykowski-Górecki

/home/user/rpmbuild/BUILD/xen-4.8.1/stubdom/vtpmmgr/vtpm_cmd_handler.c:555:
undefined reference to `tpmrsa_free'

Hi,
I think this was fixed for me with:
Olaf Hering's [Xen-devel] [PATCH] vtpmmgr: make inline functions static
https://lists.xenproject.org/archives/html/xen-devel/2017-06/msg02896.html
Where the static keyword is added to the inline functions in vtpmmgr

--
John Thomson

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel