Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903876 - app-cdr/cdrtools-3.02_alpha09-r4 fails to compile (Clang 16/GCC 14)
Summary: app-cdr/cdrtools-3.02_alpha09-r4 fails to compile (Clang 16/GCC 14)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords: PATCH, PullRequest
: 870712 913634 (view as bug list)
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2023-04-05 16:51 UTC by Alec Ari
Modified: 2023-12-16 09:31 UTC (History)
6 users (show)

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


Attachments
cdr-tools build.log (cdrtools_build.log,3.50 KB, text/x-log)
2023-04-05 16:51 UTC, Alec Ari
Details
emerge --info (emerge_info.txt,7.35 KB, text/plain)
2023-04-05 16:57 UTC, Alec Ari
Details
Autoconf fixes (0001-Fixed-autoconf-for-CLang.patch,34.86 KB, patch)
2023-06-16 11:02 UTC, David Carlos Manuelda
Details | Diff
0001-Fixed-autoconf-for-CLang.patch (0001-Fixed-autoconf-for-CLang.patch,34.86 KB, patch)
2023-06-16 11:02 UTC, David Carlos Manuelda
Details | Diff
0002-Fix-missing-include-for-mlockall.patch (0002-Fix-missing-include-for-mlockall.patch,627 bytes, patch)
2023-06-16 11:03 UTC, David Carlos Manuelda
Details | Diff
0001-Fixed-autoconf-for-Clang16 (0001-Fixed-autoconf-for-Clang16.patch,41.73 KB, patch)
2023-06-16 14:05 UTC, David Carlos Manuelda
Details | Diff
0002-Added-a-missing-include (0002-Added-a-missing-include.patch,618 bytes, patch)
2023-06-16 14:06 UTC, David Carlos Manuelda
Details | Diff
build.log using gcc 14 (build.log,3.55 KB, text/plain)
2023-12-11 17:21 UTC, Christopher Fore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Ari 2023-04-05 16:51:42 UTC
Created attachment 859555 [details]
cdr-tools build.log

checking for cc... clang
checking for gcc... (cached) clang
checking whether the C compiler (clang -O2 -march=x86-64-v2 -fPIC -fstack-protector-strong -fstack-clash-protection -fomit-frame-pointer -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fexec-charset=UTF-8 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
RULES/rules.cnf:71: incs/amd64-linux-cc/rules.cnf: No such file or directory
make: *** [RULES/rules.cnf:59: incs/amd64-linux-cc/rules.cnf] Error 1
Comment 1 Alec Ari 2023-04-05 16:57:16 UTC
Created attachment 859560 [details]
emerge --info
Comment 2 David Carlos Manuelda 2023-06-14 18:42:44 UTC
The problem is that there are _a lot_ of main() instead of int main() -implicit int- and also a lot of exit(X) without including <stdlib.h> in the test in configure scripts.
Comment 3 Alec Ari 2023-06-15 01:17:31 UTC
(In reply to David Carlos Manuelda from comment #2)
> The problem is that there are _a lot_ of main() instead of int main()
> -implicit int- and also a lot of exit(X) without including <stdlib.h> in the
> test in configure scripts.

Thank you!
Comment 4 David Carlos Manuelda 2023-06-16 11:01:30 UTC
I've made 2 patches that makes cdrtools compile with Clang16, yet it still gives a lot of warnings which makes it will fail again in the future, like:

warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]

Will attach them here
Comment 5 David Carlos Manuelda 2023-06-16 11:02:09 UTC
Created attachment 863961 [details, diff]
Autoconf fixes

Fixes configure scripts
Comment 6 David Carlos Manuelda 2023-06-16 11:02:56 UTC
Created attachment 863962 [details, diff]
0001-Fixed-autoconf-for-CLang.patch

Fixes autoconf scripts
Comment 7 David Carlos Manuelda 2023-06-16 11:03:23 UTC
Created attachment 863963 [details, diff]
0002-Fix-missing-include-for-mlockall.patch

Fixes a missing include
Comment 8 David Carlos Manuelda 2023-06-16 11:05:59 UTC
It seems that some more work is needed because mkisofs complains:

mkisofs -o output.iso input_directory
Setting input-charset to 'UTF-8' from locale.
Unknown charset 'UTF-8'.
Known charsets are:
mkisofs: Installation problem: '$INS_BASE/lib/siconv/' missing.
Comment 9 David Carlos Manuelda 2023-06-16 14:05:46 UTC
Created attachment 863966 [details, diff]
0001-Fixed-autoconf-for-Clang16

Fixes autoconf scripts
Comment 10 David Carlos Manuelda 2023-06-16 14:06:17 UTC
Created attachment 863967 [details, diff]
0002-Added-a-missing-include

Added a missing include
Comment 11 David Carlos Manuelda 2023-06-16 14:07:03 UTC
Good news! With the updated patches (attached) it compiles and (at least mkisofs) runs with clang only!

Please do more test on the other cdrtool binaries
Comment 12 Alec Ari 2023-06-17 12:22:51 UTC
I'm surprised that worked considering this hasn't been merged yet in Clang:

https://reviews.llvm.org/D93031

Does the -fexec-charset CFLAG just get ignored, without erroring out?
Comment 13 Toralf Förster gentoo-dev 2023-07-04 09:08:07 UTC

*** This bug has been marked as a duplicate of bug 870712 ***
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-09 04:26:45 UTC
*** Bug 870712 has been marked as a duplicate of this bug. ***
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-09 04:27:34 UTC
(In reply to Alec Ari from comment #12)
> I'm surprised that worked considering this hasn't been merged yet in Clang:
> 
> https://reviews.llvm.org/D93031
> 
> Does the -fexec-charset CFLAG just get ignored, without erroring out?

commit b8198f022231eabc82e445c8237add7571260303
Author: Sylvestre Ledru <sylvestre@debian.org>
Date:   Mon Aug 11 18:09:03 2014 +0000

    GCC compatibility: Ignore -fexec-charset=UTF-8 argument. It is the default in Clang. Reject other values.

    Summary:
    Just like with -finput-charset=UTF-8 in review http://reviews.llvm.org/D4347, I think we should just ignore it when UTF-8 is provided.


    Reviewers: rnk, rafael

    Reviewed By: rafael

    Subscribers: rafael, cfe-commits

    Differential Revision: http://reviews.llvm.org/D4841

    llvm-svn: 215368
Comment 16 Toralf Förster gentoo-dev 2023-10-18 16:28:49 UTC
*** Bug 913634 has been marked as a duplicate of this bug. ***
Comment 17 Christopher Fore 2023-12-11 17:21:21 UTC
Created attachment 878671 [details]
build.log using gcc 14

Building on GCC 14 runs into this as well, applying the patches attached fixes it.
Comment 18 Larry the Git Cow gentoo-dev 2023-12-16 08:24:51 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 19 Larry the Git Cow gentoo-dev 2023-12-16 09:31:55 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(-)