tpm2-software / tpm2-tools

The source repository for the Trusted Platform Module (TPM2.0) tools
https://tpm2-software.github.io
705 stars 377 forks source link

Undefined reference to `Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal' #749

Closed yunusemreayhan closed 6 years ago

yunusemreayhan commented 6 years ago

Error while cross compilation

>>> tpmtsstools 3.0.2 Building
cd /home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2;perl -0777 -i.original -pe 's/\@CODE_COVERAGE_RULES\@//igs' Makefile;cd -;
/home/change/maxim-ic/lde-3.0/user/buildroot
cd /home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2;perl -0777 -i.original -pe 's/uth = { .t.size = 0/uth = { .t = {.size = 0}/igs' ./lib/tpm_hash.c;cd -; cd /home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2;perl -0777 -i.original -pe 's/type tmp \= \{0\}\;/type tmp;memset(&tmp,0x00,sizeof(tmp));/igs' ./lib/tpmt-types.c;cd -;
/home/change/maxim-ic/lde-3.0/user/buildroot
/home/change/maxim-ic/lde-3.0/user/buildroot
/usr/bin/make -j1 -C /home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2 
  CC     lib/tpm_hash.o
  CC     lib/tpmt-types.o
  AR     lib/libcommon.a
  CCLD   tools/tpm2_activatecredential
libtool: link: warning: library `/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib/libtcti-socket.la' was moved.
libtool: link: warning: library `/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib/libsapi.la' was moved.
libtool: link: warning: library `/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib/libtcti-socket.la' was moved.
libtool: link: warning: library `/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib/libsapi.la' was moved.
/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
lib/libcommon.a(tpmu-types.o): In function `Tss2_MU_TPMU_CAPABILITIES_Unmarshal':
tpmu-types.c:(.text+0x21f4): undefined reference to `Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal'
lib/libcommon.a(tpmu-types.o): In function `Tss2_MU_TPMU_CAPABILITIES_Marshal':
tpmu-types.c:(.text+0x242c): undefined reference to `Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal'
collect2: ld returned 1 exit status
make[3]: *** [tools/tpm2_activatecredential] Error 1
make[2]: *** [/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2/.stamp_built] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/change/maxim-ic/lde-3.0/TREE/user/buildroot'
make: *** [rootfs-build] Error 2
make: Leaving directory `/home/change/maxim-ic/lde-3.0'
ldecmd build usip-0.2.3: *** ERROR 2, command failed: make -C /home/change/maxim-ic/lde-3.0 rootfs
/home/change/bin/ldecmd v1.0.2: *** ERROR 2, command failed: build rootfs
/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2

compiler version :

arm-unknown-linux-uclibcgnueabi-gcc (Buildroot 2010.11-2-00001-g88c7ff941) 4.3.5
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure command

./bootstrap; ./configure ac_cv_lbl_unaligned_fail=yes ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_memcmp_working=yes ac_cv_have_decl_malloc=yes gl_cv_func_malloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes ac_cv_func_calloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ac_cv_c_bigendian=no PATH="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/bin:/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/bin:/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/sbin/:/home/change/maxim-ic/lde-3.0/.lde/bin:/home/change/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/:/home/change/bin/:/home/change/CodeSourcery/Sourcery_G++_Lite/bin" AR="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-ar" AS="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-as" LD="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-ld --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" NM="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-nm" CC="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" GCC="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" CPP="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-cpp --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" CXX="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-g++ --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" FC="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-gfortran --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" RANLIB="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-ranlib" STRIP="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-strip" OBJCOPY="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-objcopy" OBJDUMP="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc" CXX_FOR_BUILD="/usr/bin/g++" FC_FOR_BUILD="/usr/bin/ld" LD_FOR_BUILD="/usr/bin/ld" CFLAGS_FOR_BUILD="-O2 -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/include -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/include" CXXFLAGS_FOR_BUILD="-I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/include -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/include" LDFLAGS_FOR_BUILD="-L/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/lib -L/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/lib -Wl,-rpath,/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-as" DEFAULT_LINKER="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-ld --sysroot=/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" CFLAGS="-pipe -Os  -mtune=arm926ej-s -march=armv5te -mabi=aapcs-linux -msoft-float -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/include -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/include" CXXFLAGS="-pipe -Os  -mtune=arm926ej-s -march=armv5te -mabi=aapcs-linux -msoft-float -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/include -I/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/include" LDFLAGS="-L/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/lib -L/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib" FCFLAGS="" PKG_CONFIG_SYSROOT_DIR="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" PKG_CONFIG="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/bin/pkg-config" PKG_CONFIG_PATH="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging/usr/lib/pkgconfig:" PERLLIB="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/host/usr/lib/perl" STAGING_DIR="/home/change/maxim-ic/lde-3.0/TREE/user/buildroot/staging" --prefix=/usr --build=i686-pc-linux-gnu --target=arm-linux --host=arm-linux --with-tcti-socket=yes --with-tcti-tabrmd=no --with-tcti-device=no; 

make command

/usr/bin/make -j1 -C /home/change/maxim-ic/lde-3.0/TREE/user/buildroot/build/tpmtsstools-3.0.2

host computer :

$ uname -a
Linux ubuntu 3.2.0-126-generic-pae #169-Ubuntu SMP Fri Mar 31 14:43:09 UTC 2017 i686 i686 i386 GNU/Linux

Please fix. Thanks.

yunusemreayhan commented 6 years ago

in version 3.0.2, at the and of file tpml-types.c, those commented lines was causing this error :

//TPML_MARSHAL(TPML_INTEL_PTT_PROPERTY, Tss2_MU_UINT32_Marshal, property, VAL)
//TPML_UNMARSHAL(TPML_INTEL_PTT_PROPERTY, Tss2_MU_UINT32_Unmarshal, property)

@williamcroberts please fix, in next version, thx