PeterHuewe / tpm-emulator

The famous tpm-emulator by Mario Strasser, previously hosted on BerliOs. It supports TPM1.2 only!
GNU General Public License v2.0
177 stars 75 forks source link

Make fails on Debian [sid] #17

Closed levitte closed 6 years ago

levitte commented 8 years ago
: ; LANG=C sh build.sh 
-- The C compiler identification is GNU 6.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/levitte/gitwrk/github.com/PeterHuewe/tpm-emulator/build
Scanning dependencies of target tpm
[  1%] Building C object tpm/CMakeFiles/tpm.dir/tpm_audit.o
[  3%] Building C object tpm/CMakeFiles/tpm.dir/tpm_authorization.o
[  5%] Building C object tpm/CMakeFiles/tpm.dir/tpm_capability.o
[  7%] Building C object tpm/CMakeFiles/tpm.dir/tpm_cmd_handler.o
[  8%] Building C object tpm/CMakeFiles/tpm.dir/tpm_context.o
[ 10%] Building C object tpm/CMakeFiles/tpm.dir/tpm_counter.o
[ 12%] Building C object tpm/CMakeFiles/tpm.dir/tpm_credentials.o
[ 14%] Building C object tpm/CMakeFiles/tpm.dir/tpm_crypto.o
[ 15%] Building C object tpm/CMakeFiles/tpm.dir/tpm_daa.o
[ 17%] Building C object tpm/CMakeFiles/tpm.dir/tpm_data.o
[ 19%] Building C object tpm/CMakeFiles/tpm.dir/tpm_delegation.o
[ 21%] Building C object tpm/CMakeFiles/tpm.dir/tpm_deprecated.o
[ 22%] Building C object tpm/CMakeFiles/tpm.dir/tpm_emulator_extern.o
[ 24%] Building C object tpm/CMakeFiles/tpm.dir/tpm_error.o
[ 26%] Building C object tpm/CMakeFiles/tpm.dir/tpm_eviction.o
[ 28%] Building C object tpm/CMakeFiles/tpm.dir/tpm_handles.o
[ 29%] Building C object tpm/CMakeFiles/tpm.dir/tpm_identity.o
[ 31%] Building C object tpm/CMakeFiles/tpm.dir/tpm_integrity.o
[ 33%] Building C object tpm/CMakeFiles/tpm.dir/tpm_maintenance.o
[ 35%] Building C object tpm/CMakeFiles/tpm.dir/tpm_management.o
[ 36%] Building C object tpm/CMakeFiles/tpm.dir/tpm_marshalling.o
[ 38%] Building C object tpm/CMakeFiles/tpm.dir/tpm_migration.o
[ 40%] Building C object tpm/CMakeFiles/tpm.dir/tpm_nv_storage.o
[ 42%] Building C object tpm/CMakeFiles/tpm.dir/tpm_owner.o
[ 43%] Building C object tpm/CMakeFiles/tpm.dir/tpm_startup.o
[ 45%] Building C object tpm/CMakeFiles/tpm.dir/tpm_storage.o
[ 47%] Building C object tpm/CMakeFiles/tpm.dir/tpm_testing.o
[ 49%] Building C object tpm/CMakeFiles/tpm.dir/tpm_ticks.o
[ 50%] Building C object tpm/CMakeFiles/tpm.dir/tpm_transport.o
[ 52%] Linking C static library libtpm.a
[ 52%] Built target tpm
Scanning dependencies of target mtm
[ 54%] Building C object mtm/CMakeFiles/mtm.dir/mtm_capability.o
[ 56%] Building C object mtm/CMakeFiles/mtm.dir/mtm_cmd_handler.o
[ 57%] Building C object mtm/CMakeFiles/mtm.dir/mtm_counter.o
[ 59%] Building C object mtm/CMakeFiles/mtm.dir/mtm_data.o
[ 61%] Building C object mtm/CMakeFiles/mtm.dir/mtm_eviction.o
[ 63%] Building C object mtm/CMakeFiles/mtm.dir/mtm_handles.o
[ 64%] Building C object mtm/CMakeFiles/mtm.dir/mtm_integrity.o
[ 66%] Building C object mtm/CMakeFiles/mtm.dir/mtm_marshalling.o
[ 68%] Building C object mtm/CMakeFiles/mtm.dir/mtm_verification.o
[ 70%] Building C object mtm/CMakeFiles/mtm.dir/__/tpm/tpm_cmd_handler.o
[ 71%] Building C object mtm/CMakeFiles/mtm.dir/__/tpm/tpm_data.o
[ 73%] Linking C static library libmtm.a
[ 73%] Built target mtm
Scanning dependencies of target tpm_crypto
[ 75%] Building C object crypto/CMakeFiles/tpm_crypto.dir/hmac.o
[ 77%] Building C object crypto/CMakeFiles/tpm_crypto.dir/rc4.o
[ 78%] Building C object crypto/CMakeFiles/tpm_crypto.dir/rsa.o
[ 80%] Building C object crypto/CMakeFiles/tpm_crypto.dir/sha1.o
[ 82%] Building C object crypto/CMakeFiles/tpm_crypto.dir/bn_gmp.o
[ 84%] Linking C static library libtpm_crypto.a
[ 84%] Built target tpm_crypto
Scanning dependencies of target tddl_static
[ 85%] Building C object tddl/CMakeFiles/tddl_static.dir/tddl.o
[ 87%] Linking C static library libtddl.a
[ 87%] Built target tddl_static
Scanning dependencies of target tddl
[ 89%] Building C object tddl/CMakeFiles/tddl.dir/tddl.o
[ 91%] Linking C shared library libtddl.so
[ 91%] Built target tddl
Scanning dependencies of target test_tddl
[ 92%] Building C object tddl/CMakeFiles/test_tddl.dir/test_tddl.o
[ 94%] Linking C executable test_tddl
[ 94%] Built target test_tddl
Scanning dependencies of target tpmd_dev
[ 96%] Generating linux/tpmd_dev.ko
/home/levitte/gitwrk/github.com/PeterHuewe/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.c:1:0: error: code model kernel does not support PIC mode
 /* Software-based Trusted Platform Module (TPM) Emulator

/usr/src/linux-headers-4.8.0-1-common/scripts/Makefile.build:300: recipe for target '/home/levitte/gitwrk/github.com/PeterHuewe/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.o' failed
make[7]: *** [/home/levitte/gitwrk/github.com/PeterHuewe/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.o] Error 1
/usr/src/linux-headers-4.8.0-1-common/Makefile:1488: recipe for target '_module_/home/levitte/gitwrk/github.com/PeterHuewe/tpm-emulator/build/tpmd_dev/linux' failed
make[6]: *** [_module_/home/levitte/gitwrk/github.com/PeterHuewe/tpm-emulator/build/tpmd_dev/linux] Error 2
Makefile:150: recipe for target 'sub-make' failed
make[5]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[4]: *** [all] Error 2
Makefile:22: recipe for target 'all' failed
make[3]: *** [all] Error 2
tpmd_dev/CMakeFiles/tpmd_dev.dir/build.make:62: recipe for target 'tpmd_dev/linux/tpmd_dev.ko' failed
make[2]: *** [tpmd_dev/linux/tpmd_dev.ko] Error 2
CMakeFiles/Makefile2:383: recipe for target 'tpmd_dev/CMakeFiles/tpmd_dev.dir/all' failed
make[1]: *** [tpmd_dev/CMakeFiles/tpmd_dev.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
PeterHuewe commented 8 years ago

Hi, can you try to change the LDFLAGS to -no-pie Don't produce a position independent executable. ? https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Seems that newer versions of GCC set this per default to true. Peter

PeterHuewe commented 7 years ago

See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841420 ...

PeterHuewe commented 7 years ago

@levitte Can you please try this patch? fix-debian-sid.txt

PeterHuewe commented 7 years ago

@levitte Any updates?

PeterHuewe commented 6 years ago

@levitte I will close this as there was no update/response for 2 years. Feel free to open a new issue if needed.