Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915223 - app-text/texlive-core-2021-r7 fails to compile (lto): p2c.h:333:17: error: type of 'strpos2' does not match original declaration [-Werror=lto-type-mismatch]
Summary: app-text/texlive-core-2021-r7 fails to compile (lto): p2c.h:333:17: error: ty...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-10-06 00:01 UTC by ppw0
Modified: 2024-03-29 14:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (app-text:texlive-core-2021-r7:20231005-232046.log.gz,31.90 KB, application/gzip)
2023-10-06 00:01 UTC, ppw0
Details
emerge --info (emerge_info.log,7.40 KB, text/x-log)
2023-10-06 00:02 UTC, ppw0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ppw0 2023-10-06 00:01:56 UTC
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)
Comment 1 ppw0 2023-10-06 00:02:31 UTC
Created attachment 872209 [details]
emerge --info
Comment 2 Erik Quaeghebeur 2024-02-13 08:16:02 UTC
I can confirm this.
Comment 3 Larry the Git Cow gentoo-dev 2024-03-12 07:33:41 UTC
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(+)