Created attachment 872208 [details] build log In a stricter lto environment, app-text/texlive-core-2021-r7 will fail to compile with the following error message: ``` /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/libp2c/p2c.h:333:17: error: type of 'strpos2' does not match original declaration [-Werror=lto-type-mismatch] 333 | extern int strpos2 PP( (Char *, Char *, int) ); | ^ /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/cfuncs.c:91:7: note: return value type mismatch 91 | short strpos2 (char *s1, char *s2, short p) | ^ /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/cfuncs.c:91:7: note: type 'short int' should match type 'int' /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/cfuncs.c:91:7: note: 'strpos2' was previously declared here /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/cfuncs.c:91:7: note: code may be misoptimized unless '-fno-strict-aliasing' is used /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/strings.h:17:16: error: type of 'startsWith' does not match original declaration [-Werror=lto-type-mismatch] 17 | extern boolean startsWith(Char *s1, Char *s2); | ^ /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/cfuncs.c:72:9: note: return value type mismatch 72 | boolean startsWith(char *s1, char *s2) | ^ /var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-20210325-source/utils/m-tx/mtx-src/cfuncs.c:72:9: note: 'startsWith' was previously declared here lto1: some warnings being treated as errors lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status make[3]: *** [Makefile:674: prepmx] Error 1 make[3]: Leaving directory '/var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-core-2021_build/utils/m-tx' make[2]: *** [Makefile:919: recurse] Error 1 make[2]: Leaving directory '/var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-core-2021_build/utils' make[1]: *** [Makefile:489: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/app-text/texlive-core-2021-r7/work/texlive-core-2021_build/utils' make: *** [Makefile:583: all-recursive] Error 1 ``` Attaching logs. (stricter lto means with -flto -Werror=odr -Werror=strict-aliasing -Werror=lto-type-mismatch enabled)
Created attachment 872209 [details] emerge --info
I can confirm this.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f655979b2d85a4bda4d0b3e6bdce9148bb649cd commit 4f655979b2d85a4bda4d0b3e6bdce9148bb649cd Author: Sam James <sam@gentoo.org> AuthorDate: 2024-03-12 07:32:26 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-12 07:32:26 +0000 app-text/texlive-core: filter LTO, no-SA for 2021 Not doing 2023 as not tested it yet. 2021 at least has a type mismatch failure in some pascal to C thing (p2c) and there's also aliasing violations in utils/pmx. We should report these upstream as Karl is very nice & accommodating but no point in doing so with an old TL. Closes: https://bugs.gentoo.org/915223 Signed-off-by: Sam James <sam@gentoo.org> app-text/texlive-core/texlive-core-2021-r7.ebuild | 5 +++++ 1 file changed, 5 insertions(+)