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

Bug 868732

Summary: games-fps/gzdoom-4.10.0 fails to compile (MUSL): Threads.h:80:9: error: unknown type name cpu_set_t
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: William Breathitt Gray <vilhelm.gray>
Status: CONFIRMED ---    
Severity: normal CC: erhard_f, games, gentoo.qxrin, proxy-maint
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/ZDoom/gzdoom/pull/1662
See Also: https://github.com/ZDoom/gzdoom/pull/1662
https://github.com/ZDoom/gzdoom/pull/1663
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: build.log
musl_fix-zipdir.patch
musl_fix-lzma.patch
musl_fix-i_net-types.patch

Description Agostino Sarubbo gentoo-dev 2022-09-06 11:49:44 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: games-fps/gzdoom-4.8.2-r1 fails to compile (MUSL).
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-09-06 11:49:46 UTC
Created attachment 803416 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-09-06 11:49:47 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


--   Package 'musl-fts', required by 'virtual:world', not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR) 
FAILED: libraries/lzma/CMakeFiles/lzma.dir/C/LzFindMt.c.o 
/var/tmp/portage/games-fps/gzdoom-4.8.2-r1/work/gzdoom-g4.8.2/libraries/lzma/C/Threads.h:80:9: error: unknown type name 'cpu_set_t'
Comment 3 ernsteiswuerfel archtester 2022-09-20 15:11:38 UTC
Seems this is already known upstream and a patch is attached (https://github.com/ZDoom/gzdoom/pull/1662). It did not get merged however as it force settings that are platform specific on all targets.

A 2nd patch is necessary to make it build on musl (https://github.com/ZDoom/gzdoom/pull/1663) but it was not merged for the same reason.

With the 2 patches applied however it builds fine on musl.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-07 07:21:54 UTC
(In reply to ernsteiswuerfel from comment #3)
> Seems this is already known upstream and a patch is attached
> (https://github.com/ZDoom/gzdoom/pull/1662). It did not get merged however
> as it force settings that are platform specific on all targets.
> 

They're wrong on the first one wrt -D_GNU_SOURCE, it should be fine to unconditionally pass.

> A 2nd patch is necessary to make it build on musl
> (https://github.com/ZDoom/gzdoom/pull/1663) but it was not merged for the
> same reason.

:(
Comment 5 Agostino Sarubbo gentoo-dev 2023-05-22 08:34:41 UTC
tinderbox_musl has reproduced this issue with version 4.10.0 - Updating summary.
Comment 6 ernsteiswuerfel archtester 2024-05-13 21:53:10 UTC
Created attachment 892904 [details, diff]
musl_fix-zipdir.patch

Updated patches to make 4.12.2 build on musl.
Comment 7 ernsteiswuerfel archtester 2024-05-13 21:53:40 UTC
Created attachment 892905 [details, diff]
musl_fix-lzma.patch
Comment 8 ernsteiswuerfel archtester 2024-05-13 21:54:10 UTC
Created attachment 892906 [details, diff]
musl_fix-i_net-types.patch
Comment 9 James Le Cuirot gentoo-dev 2024-05-13 22:10:59 UTC
Like upstream says, these patches are not cross-platform. I only tried the LZMA one, and that doesn't even work with glibc. I could redo them, but I'd appreciate some help.
Comment 10 ernsteiswuerfel archtester 2024-05-13 22:20:14 UTC
I do understand that.

But for the time being I am occupied with various other stuff. I only wanted to post the patches here in case other users facing the same musl build issues might find it.