Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 901467

Summary: app-arch/p7zip-17.05: Fails to compile with libcxx
Product: Gentoo Linux Reporter: Manuel Nickschas <sputnick>
Component: Current packagesAssignee: Matthew Thode ( prometheanfire ) <prometheanfire>
Status: RESOLVED FIXED    
Severity: normal CC: ionen, StormByte, stuartmeya
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/p7zip-project/p7zip/issues/222
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 836220    
Attachments: build.log
emerge --info
p7zip-17.05-stdint.patch

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(+)