[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH VTPM v8 0/8] Vtpm patch set

On 01/10/2013 05:01 PM, Matthew Fioravante wrote:
On 01/10/2013 10:30 AM, Ian Campbell wrote:
On Thu, 2013-01-03 at 15:37 +0000, Matthew Fioravante wrote:
The following are the final set of patches for vtpm in xen.
They are derived from the previous v7 and Ian's xen
vtpm respository with the various minor bug fixes we
have discussed and fixed along the way. The bug fixes
are baked into their respective patches.

Unfortunately I'm afraid this fails to build for me when cmake is
installed. I get:

ld -nostdlib 
  -m elf_x86_64 -T arch/x86/minios-x86_64.lds \
/local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os.o  \
ld: warning: section `.bss' type changed to PROGBITS
In function `mkdirs':
tpm_emulator_extern.c:(.text+0xbd95): undefined reference to `__errno_location'
tpm_emulator_extern.c:(.text+0xbdad): undefined reference to `__errno_location'
In function `_tpm_extern_init':
tpm_emulator_extern.c:(.text+0xbe7f): undefined reference to `open'
tpm_emulator_extern.c:(.text+0xbe9b): undefined reference to `__errno_location'
In function `_tpm_write_to_storage':
tpm_emulator_extern.c:(.text+0xc1e9): undefined reference to `open'
In function `_tpm_read_from_storage':
tpm_emulator_extern.c:(.text+0xc27b): undefined reference to `open'
tpm_emulator_extern.c:(.text+0xc2a2): undefined reference to `lseek'
tpm_emulator_extern.c:(.text+0xc2ba): undefined reference to `lseek'
make[2]: *** 
Error 1
make[2]: Leaving directory 
I'm going to claim user error on this one.

In the stubdom/Makefile we define TPM_NO_EXTERN using cmake to build the
tpm emulator. In tpm_emulator-x86_64/tpm/tpm_emulator_extern.c all of
the functions defined there use open() and mkdir() etc.. However when
TPM_NO_EXTERN is defined this
file contains only a set of null initialized function pointers (which
vtpm assigns to its own functions).

Using the standard make targets there should be no possible way to get
the tpm emulator to build without TPM_NO_EXTERN. When cmake is not
present make vtpm-stubdom will fail because vtpm-stubdom is not present
in the TARGETS variable. I certainly was not able to reproduce it in
xen-unstable or in staging using a variety or permutations of make
targets and cmake present/not-present.

Were you playing with building the tpm emulator manually?

Anyway I'm confident that if you do a distclean and rebuild the error
should go away. Unless there is something broken about the clean targets
leaving things around that should be deleted.

Can you try one more time with cmake installed?
There is however a bug if you try to do make cross-tpmemu with cmake not installed. It creates tpm_emulator-$(ARCH) but doesn't run cmake, screwing up the make rules that expect this directory to exist. I'm creating a fix now to do a check and abort early. Still, this bug doesn't cause the linker error you've given, it only causes tpm emulator to fail to build.
lseek and open are defined in extras/mini-os/lib/sys.c but:
$ nm stubdom/mini-os-x86_64-vtpm/lib/sys.o | egrep T.\(open\|lseek\)
0000000000002456 T lseek64
0000000000002a4e T open64

Perhaps some sort of -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE mismatch
between the libc and the app libraries?

Not sure about the __errno_location one other than:

$ grep -B2 __errno_location stubdom/caml/main-caml.c
/* Ugly binary compatibility with Linux */
FILE *_stderr asm("stderr");
int *__errno_location;

Everything else seems to build ok. so without cmake installed it works

Matthew Fioravante (8):
    add vtpm-stubdom code
    add stubdom/vtpmmgr code
    vtpm/vtpmmgr and required libs to stubdom/Makefile
    Add vtpm documentation
    README: Add cmake dependency
    stubdom: Add autoconf
    Add a top level configure script
    Add conditional build of subsystems to configure.ac

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.