Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 901467 - app-arch/p7zip-17.05: Fails to compile with libcxx
Summary: app-arch/p7zip-17.05: Fails to compile with libcxx
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: systemwide-libcxx
  Show dependency tree
 
Reported: 2023-03-16 09:51 UTC by Manuel Nickschas
Modified: 2023-09-24 14:59 UTC (History)
3 users (show)

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


Attachments
build.log (build.log.gz,15.72 KB, application/gzip)
2023-03-16 09:52 UTC, Manuel Nickschas
Details
emerge --info (emerge.info.gz,7.17 KB, application/gzip)
2023-03-16 09:52 UTC, Manuel Nickschas
Details
p7zip-17.05-stdint.patch (p7zip-17.05-stdint.patch,470 bytes, patch)
2023-04-15 01:10 UTC, Mark Wright
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Nickschas 2023-03-16 09:51:59 UTC
Trying to compile app-arch/p7zip on a system with full Clang/libcxx toolchain leads to a compilation error:

----------------------------------------------------------
In file included from ../../../../CPP/Common/Md5Reg.cpp:8:
In file included from ../../../../CPP/Common/../../C/hashes/md5.h:40:
../../../../CPP/Common/../../C/hashes/hash.h:51:16: error: typedef redefinition with different types ('UInt64' (aka 'unsigned long long') vs '__uint64_t' (aka 'unsigned long'))
typedef UInt64 uint64_t;
               ^
/usr/include/bits/stdint-uintn.h:27:20: note: previous definition is here
typedef __uint64_t uint64_t;
                   ^
1 error generated.
----------------------------------------------------------

Switching the compiler to GCC is not sufficient to fix this; switching to libstdc++ is required to make the package build for me.

Reproducible: Always

Steps to Reproduce:
1. Use Clang/libcxx toolchain
2. Try to compile app-arch/p7zip

Actual Results:  
In file included from ../../../../CPP/Common/Md5Reg.cpp:8:
In file included from ../../../../CPP/Common/../../C/hashes/md5.h:40:
../../../../CPP/Common/../../C/hashes/hash.h:51:16: error: typedef redefinition with different types ('UInt64' (aka 'unsigned long long') vs '__uint64_t' (aka 'unsigned long'))
typedef UInt64 uint64_t;
               ^
/usr/include/bits/stdint-uintn.h:27:20: note: previous definition is here
typedef __uint64_t uint64_t;
                   ^
1 error generated.


Expected Results:  
Package should compile.
Comment 1 Manuel Nickschas 2023-03-16 09:52:29 UTC
Created attachment 857993 [details]
build.log
Comment 2 Manuel Nickschas 2023-03-16 09:52:46 UTC
Created attachment 857995 [details]
emerge --info
Comment 3 Mark Wright gentoo-dev 2023-04-15 01:10:10 UTC
Created attachment 860114 [details, diff]
p7zip-17.05-stdint.patch

It compiles successfully with clang 16.0.1 libcxx and with
gcc 12.2.1_p20230304 p13 with this patch (by me).

A workaround is to save the patch as the file (creating the directory):

/etc/portage/patches/app-arch/p7zip-17.05/p7zip-17.05-stdint.patch
Comment 4 ernsteiswuerfel archtester 2023-05-06 18:16:56 UTC
Your patch works fine for me too on musl/clang. Thanks!
Comment 5 Larry the Git Cow gentoo-dev 2023-09-24 14:59:30 UTC
The bug has been closed via the following commit(s):

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

commit 275bd4036e56c8f0e00081100814ae88a4d3361c
Author:     Matthew Thode <prometheanfire@gentoo.org>
AuthorDate: 2023-09-24 14:57:57 +0000
Commit:     Matthew Thode <prometheanfire@gentoo.org>
CommitDate: 2023-09-24 14:59:26 +0000

    app-arch/p7zip: fix build issue
    
    Closes: https://bugs.gentoo.org/901467
    
    Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>

 app-arch/p7zip/files/p7zip-17.05-unit64.patch | 21 +++++++++++++++++++++
 app-arch/p7zip/p7zip-17.05-r1.ebuild          |  4 ++++
 2 files changed, 25 insertions(+)