tpm2-software / tpm2-abrmd

TPM2 Access Broker & Resource Management Daemon implementing the TCG spec.
https://github.com/tpm2-software/tpm2-abrmd
BSD 2-Clause "Simplified" License
115 stars 97 forks source link

Cannot build abrmd after commit 84273bd #158

Closed RashmicaG closed 7 years ago

RashmicaG commented 7 years ago

After commit 84273bd (Tpm2Command: Wrap all auth area accessors in range checks) I cannot build abrmd - prior to this it builds fine. I get the following errors:

src/tpm2-command.c: In function 'tpm2_command_get_auth_attrs': src/tpm2-command.c:612:16: error: cast to union type from type not present in union return (TPMA_SESSION)(UINT32)0; ^ src/tpm2-command.c:618:16: error: cast to union type from type not present in union return (TPMA_SESSION)(UINT32)0; ^ src/tpm2-command.c:104:6: error: cast to union type from type not present in union ((TPMA_SESSION)(UINT32)cmd->buffer [AUTH_SESSION_ATTRS_OFFSET (cmd, index)]) ^ src/tpm2-command.c:620:12: note: in expansion of macro 'AUTH_GET_SESSION_ATTRS' return AUTH_GET_SESSION_ATTRS (command, auth_offset); ^ src/tpm2-command.c:621:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors make[1]: *** [src/tpm2-command.lo] Error 1

Any ideas as to what could be causing this?

flihp commented 7 years ago

What version of the tpm2-tss so you have installed?

flihp commented 7 years ago

Oh, looks like you're building from the master branch of tpm2-tss. We've been chatting about this same thing over on the tools project: https://github.com/01org/tpm2-tools/issues/406. The short version is that the tabrmd is currently tracking the 1.x branch of the tpm2-tss libraries. I should make a check for this in the configure script.

RashmicaG commented 7 years ago

Yes I was! Thanks for that. I cannot build the 1.x branch on both Ubuntu 14 and 16, and get this error:

"make: *** No rule to make target tcti/tcti_socket.c', needed bytcti/tcti_libtcti_socket_la-tcti_socket.lo'. Stop." Edit: this error is not from abrmd and so I probably shouldn't have mentioned it here. Sorry!

flihp commented 7 years ago

This should just be a matter of cleaning your build. Try make distclean followed by running the bootstrap, then configure scripts.

liuqun commented 7 years ago

@RashmicaG There is another patch available to fix the earlier compiling errors you've met, see https://github.com/01org/tpm2-tools/commit/ca9af876dd6b5b447948e7ebb0f5d86923a1f069