0

I am trying to use the Command Transmission Interface from the Trusted Software Stack for the TPM 2.0 and I cannot seem to get this library loaded. Any use gives an "undefined reference" error.

Had the same problem when using the ESAPI from TSS as well and fixed it with the following flag in my Makefile: TPMFLAGS =-L=/usr/local/lib/ -ltss2-esys.

Following is my Makefile in its current implementation:

CC = gcc 
CFLAGS = -std=c99 -Wall -I$(IDIR)
TPMFLAGS =-L=/usr/local/lib/ -ltss2-esys -ltss2-tcti-device

IDIR = ./includes/
SRCDIR = ./src/
BINDIR = ./bin/

SOURCES = $(SRCDIR)*.c

all: $(BINDIR)antiEvilMaid

$(BINDIR)antiEvilMaid: $(BINDIR)main.o $(BINDIR)errors.o
    $(CC) $(BINDIR)main.o $(BINDIR)errors.o $(TPMFLAGS) -o $@

$(BINDIR)main.o: $(SRCDIR)main.c $(IDIR)main.h
    $(CC)$(CFLAGS) -c $(SRCDIR)main.c -o $@

$(BINDIR)errors.o: $(SRCDIR)errors.c $(IDIR)main.h
    $(CC)$(CFLAGS) -c $(SRCDIR)errors.c -o $@

run:
    $(BINDIR)antiEvilMaid init

clean:
    rm $(BINDIR)*.o $(BINDIR)antiEvilMaid

memtest:
    valgrind --leak-check=full $(BINDIR)antiEvilMaid init
  • What’s the undefined symbol? – Bill Morgan Aug 28 '21 at 22:54
  • ```testcheck.c:(.text+0x15): undefined reference to `Tss2_TctiLdr_Initialize'``` – Huzaifa Hashim Aug 28 '21 at 23:46
  • Sorry I just noticed you posted it in the title. But thanks for replying. I'm not familiar with this library, but a little googling turned up this mailing list that you could search or post your question to. This person was able to use Esys_Initialize https://lists.01.org/hyperkitty/list/tpm2@lists.01.org/message/ZMORNYVDE2SKQVQI4E7RDXRZCOCR5XQF/ – Bill Morgan Aug 29 '21 at 00:00

0 Answers0