Skip to contentSkip to conversation

vtpm fix cmake dependency

PATCH In review Matthew Fioravante 2 participants 6 messages Dec 13, 2012 – Dec 18, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vtpm fix cmake dependency

Ian, this one is special just for you. I'm sending it as an attachment because my email client will mangle it. This patch will remove the cmake dependency from xen prior to autoconf stubdom

This patch applies ontop of [VTPM v7 3/8] vtpm/vtpmmgr and required libs to stubdom/Makefile

You can apply it to your tree by doing the following:

git rebase -i <VTPM v7 3/8 revision>

Select to EDIT the 3/8 revision

patch -p1 < 0004-Remove-vtpm-from-default-build-targets.patch

git commit --amend

git rebase --continue

You will hit conflicts with the autoconf patch, just edit stubdom/Makefile and accept all of the updates from the autoconf patch. Namely changing the TARGETS variable, build rule, and install rule

git add stubdom/Makefile
git commit
git rebase --continue

If you'd prefer not to go through these gyrations, I can send an updated full vtpm patchset with the fix merged in.

From 6feee4bb2be06b0853558e51d4384df2c4df1b68 Mon Sep 17 00:00:00 2001
From: Matthew Fioravante <[email protected]>
Date: Thu, 13 Dec 2012 10:10:54 -0500
Subject: [PATCH 4/9] Remove vtpm from default build targets

---
 stubdom/Makefile |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
stubdom/Makefile +3 -3
index fc70d88..357ee70 100644
@@ -86,12 +86,12 @@ TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
 
 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
-TARGETS=ioemu c caml grub xenstore vtpm vtpmmgr
+TARGETS=ioemu c caml grub xenstore 
 
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom vtpm-stubdom vtpmmgrdom
+build: genpath ioemu-stubdom c-stubdom pv-grub xenstore-stubdom 
 else
 build: genpath
 endif
@@ -483,7 +483,7 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme install-ioemu install-grub install-xenstore install-vtpm install-vtpmmgr
+install: genpath install-readme install-ioemu install-grub install-xenstore 
 else
 install: genpath
 endif
Signature · 1 line
1.7.10.4

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

#1 lore raw
Quoted 4 lines · Matthew Fioravante

Ian, this one is special just for you. I'm sending it as an attachment because my email client will mangle it.
This patch will remove the cmake dependency from xen prior to autoconf stubdom

Thanks, I merged this as described and also folded "Disable caml-stubdom by default" into the patch which added it enabled.

However this still fails for me when vtpm is not enabled:
make[1]: *** No rule to make target mini-os-x86_64-vtpm', needed by vtpm-stubdom'. Stop. make[1]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom'
make: *** [install-stubdom] Error 2

Something to with vtpmmgr not being conditional?

I've pushed my current branch to:
git://xenbits.xen.org/people/ianc/xen-unstable.git vtpm2

Please can you fixup and resubmit the whole thing?

It would be useful to take all my [ijc -- did foo] comments and either remove them or add something to the main changelog.

Ian.

#2 lore raw
Quoted 9 lines · Ian Campbell
Quoted 4 lines · Matthew Fioravante

Ian, this one is special just for you. I'm sending it as an attachment because my email client will mangle it.
This patch will remove the cmake dependency from xen prior to autoconf stubdom

Thanks, I merged this as described and also folded "Disable caml-stubdom by default" into the patch which added it enabled.

Quoted 6 lines

However this still fails for me when vtpm is not enabled:
make[1]: *** No rule to make target mini-os-x86_64-vtpm', needed by vtpm-stubdom'. Stop. make[1]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom'
make: *** [install-stubdom] Error 2

Something to with vtpmmgr not being conditional?

Looks like a simple thinko. I'll merge the following into "stubdom: Add autoconf", hopefully my testing won't find any other issues.

Please try and remember to test both with and without any new option you are adding in the future.

Ian.

commit 569b8782415325b27897434f4893945769c45296

Author: Ian Campbell <[email protected]>
Date:   Tue Dec 18 11:41:32 2012 +0000

install-vtpmmgr should depend on vtpmmgrdom not vtpm-stubdom

stubdom/Makefile +1 -1
index 709b71e..7519683 100644
@@ -476,7 +476,7 @@ install-vtpm: vtpm-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
 
-install-vtpmmgr: vtpm-stubdom
+install-vtpmmgr: vtpmmgrdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-vtpmmgr/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpmmgrdom.gz"
#3 lore raw
Quoted 15 lines · Ian Campbell
Quoted 14 lines · Ian Campbell
Quoted 4 lines · Matthew Fioravante

Ian, this one is special just for you. I'm sending it as an attachment because my email client will mangle it.
This patch will remove the cmake dependency from xen prior to autoconf stubdom

Thanks, I merged this as described and also folded "Disable caml-stubdom by default" into the patch which added it enabled.

However this still fails for me when vtpm is not enabled:
make[1]: *** No rule to make target mini-os-x86_64-vtpm', needed by vtpm-stubdom'. Stop. make[1]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom'
make: *** [install-stubdom] Error 2

Quoted 4 lines
Quoted 1 line

Something to with vtpmmgr not being conditional?

Looks like a simple thinko. I'll merge the following into "stubdom: Add autoconf", hopefully my testing won't find any other issues.

I was just about to push this out when I though "hrm, maybe I should check this with cmake installed". I'm afraid it is broken. Spew is below. Looks like it's not finding the gmp headers -- I can see them in stubdom/gmp-x86_64/gmp.h but I can't see anything which looks like it adds the necessary -I to CFLAGS or anywhere.

Branch is at:
git://xenbits.xen.org/people/ianc/xen-unstable.git vtpm3

Sorry if I've broken something somewhere along the way. Please can you test fully both with and without cmake and resubmit. For reference the script I run before committing is:
#!/bin/bash
set -ex

export PATH=/usr/lib/ccache:$PATH

(
make distclean -j12 -s
git clean -f -dx
./configure
make dist -j12 -s
find dist | sort > ../FILE_LIST
) 2>&1 | tee ../COMMITTER.LOG

This makes pretty sure it is doing a fresh build with no left over cruft installed.

Ian.

cc -mno-red-zone -O1 -fno-omit-frame-pointer -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -fno-stack-protector -fno-exceptions -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/posix -isystem /local/scratch/ianc/devel/committer.git/stubdom/../tools/xenstore -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/x86 -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/posix -isystem /local/scratch/ianc/devel/committer.git/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include -isystem /local/scratch/ianc/devel/committer.git/stubdom/lwip-x86_64/src/include -isystem /local/scratch/ianc/devel/committer.git/stubdom/lwip-x86_64/src/include/ipv4 -I/local/scratch/ianc/devel/committer.git/stubdom/include -I/local/scratch/ianc/devel/committer.git/stubdom/../xen/include -I../tpm_emulator-x86_64/build -I../tpm_emulator-x86_64/tpm -I../tpm_emulator-x86_64/crypto -I../tpm_emulator-x86_64 -c -o vtpm.o vtpm.c
In file included from ../tpm_emulator-x86_64/crypto/rsa.h:22,

                 from ../tpm_emulator-x86_64/tpm/tpm_structures.h:22,
                 from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:
../tpm_emulator-x86_64/crypto/bn.h:27:17: error: gmp.h: No such file or directory
In file included from ../tpm_emulator-x86_64/crypto/rsa.h:22,
                 from ../tpm_emulator-x86_64/tpm/tpm_structures.h:22,
                 from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:

../tpm_emulator-x86_64/crypto/bn.h:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘tpm_bn_t’ ../tpm_emulator-x86_64/crypto/bn.h:31: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:33: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:35: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:37: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:39: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:41: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:43: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:45: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:47: error: expected ‘)’ before ‘out’ ../tpm_emulator-x86_64/crypto/bn.h:49: error: expected declaration specifiers or ‘...’ before ‘tpm_bn_t’ ../tpm_emulator-x86_64/crypto/bn.h:51: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:53: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:55: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:57: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:59: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:61: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:63: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:65: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:67: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:69: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:71: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:73: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:75: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:77: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:79: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:81: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:83: error: expected ‘)’ before ‘res’
In file included from ../tpm_emulator-x86_64/tpm/tpm_structures.h:22,

                 from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:
../tpm_emulator-x86_64/crypto/rsa.h:25: error: expected specifier-qualifier-list before ‘tpm_bn_t’
../tpm_emulator-x86_64/crypto/rsa.h:35: error: expected specifier-qualifier-list before ‘tpm_bn_t’
In file included from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:

../tpm_emulator-x86_64/tpm/tpm_structures.h: In function ‘free_TPM_PERMANENT_DATA’:
../tpm_emulator-x86_64/tpm/tpm_structures.h:2244: error: ‘tpm_rsa_private_key_t’ has no member named ‘size’ make[2]: *** [vtpm.o] Error 1
make[2]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom/vtpm'
make[1]: *** [vtpm] Error 2
make[1]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom'
make: *** [install-stubdom] Error 2

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

#4 lore raw

What os are you using? I've noticed problems with gmp on Ubuntu.

-----Original Message-----
From: Ian Campbell [mailto:[email protected]]
Sent: Tuesday, December 18, 2012 9:13 AM
To: Fioravante, Matthew E.
Cc: [email protected]
Subject: Re: [Xen-devel] [PATCH special] vtpm fix cmake dependency

Quoted 15 lines · Ian Campbell
Quoted 14 lines · Ian Campbell
Quoted 4 lines · Matthew Fioravante

Ian, this one is special just for you. I'm sending it as an attachment because my email client will mangle it. This patch will remove the cmake dependency from xen prior to autoconf stubdom

Thanks, I merged this as described and also folded "Disable caml-stubdom by default" into the patch which added it enabled.

However this still fails for me when vtpm is not enabled:
make[1]: *** No rule to make target mini-os-x86_64-vtpm', needed by vtpm-stubdom'. Stop. make[1]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom'
make: *** [install-stubdom] Error 2

Quoted 4 lines
Quoted 1 line

Something to with vtpmmgr not being conditional?

Looks like a simple thinko. I'll merge the following into "stubdom:
Add autoconf", hopefully my testing won't find any other issues.

I was just about to push this out when I though "hrm, maybe I should check this with cmake installed". I'm afraid it is broken. Spew is below. Looks like it's not finding the gmp headers -- I can see them in stubdom/gmp-x86_64/gmp.h but I can't see anything which looks like it adds the necessary -I to CFLAGS or anywhere.

Branch is at:
git://xenbits.xen.org/people/ianc/xen-unstable.git vtpm3

Sorry if I've broken something somewhere along the way. Please can you test fully both with and without cmake and resubmit. For reference the script I run before committing is:
#!/bin/bash
set -ex

export PATH=/usr/lib/ccache:$PATH

(
make distclean -j12 -s
git clean -f -dx
./configure
make dist -j12 -s
find dist | sort > ../FILE_LIST
) 2>&1 | tee ../COMMITTER.LOG

This makes pretty sure it is doing a fresh build with no left over cruft installed.

Ian.

cc -mno-red-zone -O1 -fno-omit-frame-pointer -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -fno-stack-protector -fno-exceptions -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/posix -isystem /local/scratch/ianc/devel/committer.git/stubdom/../tools/xenstore -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/x86 -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/posix -isystem /local/scratch/ianc/devel/committer.git/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include -isystem /local/scratch/ianc/devel/committer.git/stubdom/lwip-x86_64/src/include -isystem /local/scratch/ianc/devel/committer.git/stubdom/lwip-x86_64/src/include/ipv4 -I/local/scratch/ianc/devel/committer.git/stubdom/include -I/local/scratch/ianc/devel/committer.git/stubdom/../xen/include -I../tpm_emulator-x86_64/build -I../tpm_emulator-x86_64/tpm -I../tpm_emulator-x86_64/crypto -I../tpm_emulator-x86_64 -c -o vtpm.o vtpm.c
In file included from ../tpm_emulator-x86_64/crypto/rsa.h:22,

                 from ../tpm_emulator-x86_64/tpm/tpm_structures.h:22,
                 from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:
../tpm_emulator-x86_64/crypto/bn.h:27:17: error: gmp.h: No such file or directory In file included from ../tpm_emulator-x86_64/crypto/rsa.h:22,
                 from ../tpm_emulator-x86_64/tpm/tpm_structures.h:22,
                 from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:

../tpm_emulator-x86_64/crypto/bn.h:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘tpm_bn_t’ ../tpm_emulator-x86_64/crypto/bn.h:31: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:33: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:35: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:37: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:39: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:41: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:43: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:45: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:47: error: expected ‘)’ before ‘out’ ../tpm_emulator-x86_64/crypto/bn.h:49: error: expected declaration specifiers or ‘...’ before ‘tpm_bn_t’ ../tpm_emulator-x86_64/crypto/bn.h:51: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:53: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:55: error: expected ‘)’ before ‘a’ ../tpm_emulator-x86_64/crypto/bn.h:57: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:59: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:61: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:63: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:65: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:67: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:69: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:71: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:73: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:75: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:77: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:79: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:81: error: expected ‘)’ before ‘res’ ../tpm_emulator-x86_64/crypto/bn.h:83: error: expected ‘)’ before ‘res’
In file included from ../tpm_emulator-x86_64/tpm/tpm_structures.h:22,

                 from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:
../tpm_emulator-x86_64/crypto/rsa.h:25: error: expected specifier-qualifier-list before ‘tpm_bn_t’
../tpm_emulator-x86_64/crypto/rsa.h:35: error: expected specifier-qualifier-list before ‘tpm_bn_t’
In file included from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21,
                 from vtpm.c:31:

../tpm_emulator-x86_64/tpm/tpm_structures.h: In function ‘free_TPM_PERMANENT_DATA’:
../tpm_emulator-x86_64/tpm/tpm_structures.h:2244: error: ‘tpm_rsa_private_key_t’ has no member named ‘size’ make[2]: *** [vtpm.o] Error 1
make[2]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom/vtpm'
make[1]: *** [vtpm] Error 2
make[1]: Leaving directory `/local/scratch/ianc/devel/committer.git/stubdom'
make: *** [install-stubdom] Error 2

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

#5 lore raw

Top posting!

Quoted 1 line · Matthew E.

What os are you using? I've noticed problems with gmp on Ubuntu.

Debian.

But the stub domain should be using its own built copy of gmp, the host's installed version should be irrelevant.

If something is building against /usr/include/gmp.h then that is wrong.

Ian.