Menu

#44 undefined reference errors with --enable-nofile and --enable-noprint options

2.0
closed
None
2021-06-09
2021-06-04
Thomas
No

In 1.6.0 release, i get the following undefined reference errors:
- with option --enable-nofile

/bin/ld: timepacket-timepacket.o: in function `main':
timepacket.c:(.text.startup+0x1c4): undefined reference to `TSS_Array_Scan'
collect2: error: ld returned 1 exit status
Makefile:2654: recipe for target 'timepacket' failed
  • with option --enable-noprint
/bin/ld: activatecredential-activatecredential.o: in function `main':
activatecredential.c:(.text.startup+0x584): undefined reference to `TSS_ResponseCode_toString'
(and for TSS_TPMI_YES_NO_Print, TSS_TPMT_SIG_SCHEME_Print, TSS_TPMT_RSA_DECRYPT_Print ...)

Discussion

  • Ken Goldman

    Ken Goldman - 2021-06-04

    The first is because timepacket reads the packet from a file. Thus --no-file causes a failure.
    The second is because the utilities all print results.

    Do you have any suggestions?

    We (autotools was contributed) could modify autotools to build only the TSS with certain options. Or I could add a warning to the documentation that the compile time restrictions build a TSS, but the utilities won't work.

     

    Last edit: Ken Goldman 2021-06-04
  • Thomas

    Thomas - 2021-06-07

    I wrote a patch to disable the build of timepacket if nofile option is selected, and to disable utils (for tpm1.2 and tpm2.0) if noprint option is selected.

     
    • Ken Goldman

      Ken Goldman - 2021-06-08

      Thanks. Staged for the next release.

       
  • Ken Goldman

    Ken Goldman - 2021-06-08
    • status: open --> closed
     
  • Thomas

    Thomas - 2021-06-09

    I found an issue with the patch i sent you.
    It was not possible to build an application and to link it with libibmtss and libibmtssutils.
    It was due to some missing #ifndef TPM_TSS_NO_PRINT to disable the build and the declaration of print functions in the library.
    Please find attached a new version of the patch

     

    Last edit: Thomas 2021-06-09
    • Ken Goldman

      Ken Goldman - 2021-06-09

      I don't understand the issue. Can you send a test case?

      In general, should unused functions in a header file break anything?

       

Log in to post a comment.