Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 884771 - app-cdr/cdrtools-3.02_alpha09-r4 fails to compile (lto) setfp.c:47:10: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Summary: app-cdr/cdrtools-3.02_alpha09-r4 fails to compile (lto) setfp.c:47:10: error:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-12-07 20:29 UTC by Kostadin Shishmanov
Modified: 2023-12-16 09:31 UTC (History)
0 users

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


Attachments
emerge --info and buildlog (build.log,196.50 KB, text/x-log)
2022-12-07 20:29 UTC, Kostadin Shishmanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2022-12-07 20:29:26 UTC
Created attachment 840849 [details]
emerge --info and buildlog

app-cdr/cdrtools-3.02_alpha09-r4 fails to compile with CFLAGS=-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing


setfp.c: In function 'setfp':
setfp.c:47:10: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   47 |         *(long ***)(&((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp) =
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [../RULES/r-gmake.obj:51: OBJ/amd64-linux-cc/pic/setfp.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r4/work/cdrtools-3.02/libschily'
make[1]: *** [../RULES/rules.mks:23: all] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r4/work/cdrtools-3.02/libschily'
make: *** [RULES/rules1.dir:25: all] Error 2
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-07 20:39:05 UTC
Given this codebase is so old and upstream are gone, this is probably an append-flags -fno-strict-aliasing situation.
Comment 2 Larry the Git Cow gentoo-dev 2023-12-16 08:24:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d479020a18c69c066f3ec1e8862e30d3c84422ee

commit d479020a18c69c066f3ec1e8862e30d3c84422ee
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-12-16 08:22:45 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-16 08:23:55 +0000

    app-cdr/cdrtools: apply modern C workaround, correctness fixes
    
    * Apply modern C workaround (build with -std=gnu89 for now). No point in trying
      to patch this at least until we're up to date (see bug #672060) which has its
      own complications.
    
    * Filter LTO & pass -fno-strict-aliasing. The code isn't even close to being
      compatible with either.
    
    Bug: https://bugs.gentoo.org/672060
    Closes: https://bugs.gentoo.org/884771
    Closes: https://bugs.gentoo.org/898582
    Closes: https://bugs.gentoo.org/903876
    Signed-off-by: Sam James <sam@gentoo.org>

 app-cdr/cdrtools/cdrtools-3.02_alpha09-r5.ebuild | 309 +++++++++++++++++++++++
 1 file changed, 309 insertions(+)
Comment 3 Larry the Git Cow gentoo-dev 2023-12-16 09:31:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c79fce973fb6d30324caf13ed1ef7881fb9741c9

commit c79fce973fb6d30324caf13ed1ef7881fb9741c9
Author:     Kostadin Shishmanov <kocelfc@tutanota.com>
AuthorDate: 2023-12-16 09:24:27 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-16 09:30:54 +0000

    app-emulation/virt-manager: allow dev-libs/libisoburn > app-cdr/cdrtools
    
    This commit aims to provide an alternative to the unmaintained cdrtools
    which has all sorts of build failures [1] and [2] and needs patching.
    
    Upstream prefers xorrisofs provided by dev-libs/libisoburn over mkisofs
    which is provided by app-cdr/cdrtools.[3] I had a look at some other
    distros (openSUSE, Fedora and Debian) and they all use xorriso.
    
    The other program that is from cdrtools (isoinfo) has been removed. [4]
    
    [1] https://bugs.gentoo.org/903876
    [2] https://bugs.gentoo.org/884771
    [3] https://github.com/virt-manager/virt-manager/commit/3785abc6f0cb07c02ecc55760547a6f425513915
    [4] https://github.com/virt-manager/virt-manager/commit/08d1a6a2ddd18f88222f9fdffa3f60f42a40bc67
    
    Bug: https://bugs.gentoo.org/903876
    Bug: https://bugs.gentoo.org/884771
    Signed-off-by: Kostadin Shishmanov <kocelfc@tutanota.com>
    Closes: https://github.com/gentoo/gentoo/pull/34309
    Signed-off-by: Sam James <sam@gentoo.org>

 .../virt-manager/virt-manager-4.1.0-r1.ebuild      | 106 +++++++++++++++++++++
 .../virt-manager/virt-manager-9999.ebuild          |   2 +-
 2 files changed, 107 insertions(+), 1 deletion(-)