tpm2-software / tpm2-tss

OSS implementation of the TCG TPM2 Software Stack (TSS2)
https://tpm2-software.github.io
BSD 2-Clause "Simplified" License
749 stars 364 forks source link

Question: static link tpm2-tss #2898

Open ChuanDou2021 opened 1 month ago

ChuanDou2021 commented 1 month ago

The version of tpm2-tss I am using is 3.2. x, and the application uses static linking to link tpm2-tss. The statically linked libraries include:

But for the tss runtime, still look for the dynamic link library: libtss2-tcti-device.so, and the log is as follows

debug:tcti:src/tss2-tcti/tctildr.c:159:tctildr_conf_parse() name_conf: "device:/dev/tpmrm0" debug:tcti:src/tss2-tcti/tctildr.c:177:tctildr_conf_parse() TCTI name: "device" debug:tcti:src/tss2-tcti/tctildr.c:182:tctildr_conf_parse() TCTI conf: "/dev/tpmrm0" debug:tcti:src/tss2-tcti/tctildr-dl.c:299:tctildr_get_tcti() name: "device", conf: "/dev/tpmrm0" trace:tcti:src/tss2-tcti/tctildr-dl.c:136:tcti_from_file() Attempting to load TCTI file: device debug:tcti:src/tss2-tcti/tctildr-dl.c:92:handle_from_name() Could not load TCTI file: "device": device: cannot open shared object file: No such file or directory debug:tcti:src/tss2-tcti/tctildr-dl.c:107:handle_from_name() Could not load TCTI file "device": libtss2-tcti-device.so.0: cannot open shared object file: No such file or directory debug:tcti:src/tss2-tcti/tctildr-dl.c:120:handle_from_name() Failed to load TCTI for name "device": libtss2-tcti-device.so: cannot open shared object file: No such file or directory ERROR:tcti:src/tss2-tcti/tctildr.c:428:Tss2_TctiLdr_Initialize_Ex() Failed to instantiate TCTI

Is there a way to achieve pure static linking? thank you

joholl commented 1 month ago

Have you had a look at the configure option --enable-nodl? This might be what you are searching for.