Skip to content

Commit ab7a1e5

Browse files
committed
tpm2_control/Makefile: fixed linking order of libaries
Fixes following linker mode when build on debian bookwork: cc -std=gnu99 -I.. -I../include -I../tpm2d -Icommon -pedantic -O2 -Wall -Wextra -Wformat -Wformat-security -fstack-protector-all -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -fpic -pie -Wcast-align -ggdb -DDEBUG_BUILD -Werror -DDEFAULT_BASE_PATH=\"/var/lib/cml\" -DLOGFILE_PATH=\"/var/log\" attestation.pb-c.c tpm2d.pb-c.c tpm2d_control.c -lc -lprotobuf-c -lprotobuf-c-text -Lcommon -lcommon_full -o tpm2_control /usr/bin/ld: common/libcommon_full.a(protobuf-text.o): in function `protobuf_message_new_from_textfile': [..]/common/protobuf-text.c:75: undefined reference to `protobuf_c_text_from_file' /usr/bin/ld: common/libcommon_full.a(protobuf-text.o): in function `protobuf_message_new_from_string': /home/weiss/cml/common/protobuf-text.c:104: undefined reference to `protobuf_c_text_from_string' /usr/bin/ld: [..]/common/protobuf-text.c:121: undefined reference to `protobuf_c_text_free_ProtobufCTextError_data' /usr/bin/ld: [..]/common/protobuf-text.c:116: undefined reference to `protobuf_c_text_free_ProtobufCTextError_data' /usr/bin/ld: [..]/common/protobuf-text.c:109: undefined reference to `protobuf_c_text_free_ProtobufCTextError_data' /usr/bin/ld: common/libcommon_full.a(protobuf-text.o): in function `protobuf_string_from_message': [..]/common/protobuf-text.c:174: undefined reference to `protobuf_c_text_to_string' collect2: error: ld returned 1 exit status make: *** [Makefile:76: tpm2_control] Error 1 Fixes: e329078 ("tpm2_control/Makefile: link libcommon_full") Signed-off-by: Michael Weiß <[email protected]>
1 parent 36c5ec7 commit ab7a1e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tpm2_control/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ libcommon:
7373
$(SRC_FILES): protobuf
7474

7575
tpm2_control: libcommon $(SRC_FILES)
76-
$(CC) $(LOCAL_CFLAGS) $(SRC_FILES) -lc -lprotobuf-c -lprotobuf-c-text -Lcommon -lcommon_full -o tpm2_control
76+
$(CC) $(LOCAL_CFLAGS) $(SRC_FILES) -lc -Lcommon -lcommon_full -lprotobuf-c -lprotobuf-c-text -o tpm2_control
7777

7878
.PHONY: clean
7979
clean:

0 commit comments

Comments
 (0)