Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#75035 - [tpm2-tools] failed to build from source because of lto
Attached to Project:
Community Packages
Opened by Letu Ren (FantasqueX) - Saturday, 11 June 2022, 14:33 GMT
Last edited by Jonas Witschel (diabonas) - Saturday, 11 June 2022, 16:56 GMT
Opened by Letu Ren (FantasqueX) - Saturday, 11 June 2022, 14:33 GMT
Last edited by Jonas Witschel (diabonas) - Saturday, 11 June 2022, 16:56 GMT
|
DetailsDescription:
When building tpm2-tools using extra-x86_64-build, I got an error in check(). ``` make test/unit/test_string_bytes test/unit/test_files test/unit/test_tpm2_header test/unit/test_tpm2_attr_util test/unit/test_tpm2_alg_util test/unit/test_pcr test/unit/test_tpm2_auth_util test/unit/test_tpm2_errata test/unit/test_tpm2_session test/unit/test_tpm2_policy test/unit/test_tpm2_util test/unit/test_options test/unit/test_cc_util test/unit/test_tpm2_eventlog test/unit/test_tpm2_eventlog_yaml make[1]: Entering directory '/build/tpm2-tools/src/tpm2-tools-5.2' CC test/unit/test_string_bytes-test_string_bytes.o CCLD test/unit/test_string_bytes CC test/unit/test_files-test_files.o CCLD test/unit/test_files CC test/unit/test_tpm2_header-test_tpm2_header.o CCLD test/unit/test_tpm2_header CC test/unit/test_tpm2_attr_util-test_tpm2_attr_util.o CCLD test/unit/test_tpm2_attr_util lib/tpm2_attr_util.c: In function 'nt': lib/tpm2_attr_util.c:224:18: warning: 'value' may be used uninitialized [-Wmaybe-uninitialized] 224 | *nv |= value << 4; | ^ lib/tpm2_attr_util.c:205:14: note: 'value' was declared here 205 | uint16_t value; | ^ CC test/unit/test_tpm2_alg_util-test_tpm2_alg_util.o CCLD test/unit/test_tpm2_alg_util CC test/unit/test_pcr-test_pcr.o CCLD test/unit/test_pcr CC test/unit/test_tpm2_auth_util-test_tpm2_auth_util.o CCLD test/unit/test_tpm2_auth_util CC test/unit/test_tpm2_errata-test_tpm2_errata.o CCLD test/unit/test_tpm2_errata CC test/unit/test_tpm2_session-test_tpm2_session.o CCLD test/unit/test_tpm2_session /usr/bin/ld: /tmp/ccH5rxV9.ltrans0.ltrans.o: in function `test_session_setup': <artificial>:(.text.test_session_setup+0x20): warning: the use of `tmpnam' is dangerous, better use `mkstemp' CC test/unit/test_tpm2_policy-test_tpm2_policy.o CCLD test/unit/test_tpm2_policy CC test/unit/test_tpm2_util-test_tpm2_util.o CCLD test/unit/test_tpm2_util CC test/unit/test_options-test_options.o CCLD test/unit/test_options lib/tpm2_options.c: In function 'tpm2_handle_options.constprop': lib/tpm2_options.c:155:13: warning: '__builtin___strncat_chk' specified bound depends on the length of the source argument [-Wstringop-overflow=] 155 | strncat(man_tool_name, manpage, | ^ In function 'execute_man', inlined from 'tpm2_handle_options.constprop' at lib/tpm2_options.c:521:28: lib/tpm2_options.c:156:17: note: length computed here 156 | strlen(manpage) < (MAX_TOOL_NAME_LEN - strlen("tpm2_")) ? | ^ /usr/bin/ld: /tmp/ccI7gReg.ltrans0.ltrans.o: in function `tpm2_handle_options.constprop.0': <artificial>:(.text.tpm2_handle_options.constprop.0+0x7f6): undefined reference to `__wrap_tpm2_util_getenv' /usr/bin/ld: <artificial>:(.text.tpm2_handle_options.constprop.0+0x81f): undefined reference to `__wrap_tpm2_util_getenv' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:2038: test/unit/test_options] Error 1 make[1]: Leaving directory '/build/tpm2-tools/src/tpm2-tools-5.2' make: *** [Makefile:5733: check-am] Error 2 ``` This problem may be caused by lto option. Additional info: * package version(s) * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: |
This task depends upon
Comment by hexchain (hexchain) -
Saturday, 11 June 2022, 15:46 GMT
Please try this patch. It disables LTO to make the tests build, and further fixes the 3 test failures.
Comment by Jonas Witschel (diabonas) -
Saturday, 11 June 2022, 16:56 GMT
Both disabling LTO and the test suite failures have already been fixed quite some time ago in SVN: https://github.com/archlinux/svntogit-community/commit/d62197d8caf8a87e4a91172bc3142829d4d4124d, https://github.com/archlinux/svntogit-community/commit/1e44a40392eebfa13f74074371ee592e2584eb24, https://github.com/archlinux/svntogit-community/commit/94a2359e7aed43e642b238372b92510e132731c6. When reporting build failures, please check the SVN trunk as well, it might contain fixes that have not made it into a package release yet.
tpm2-tools.patch
(1.9 KiB)