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

Bug 832981

Summary: sys-power/suspend-1.0_p20200924 fails to compile: swsusp.h:61:9: error: unknown type name loff_t
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: CONFIRMED ---    
Severity: normal CC: parona
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
Missing #define _GNU_SOURCE

Description Agostino Sarubbo gentoo-dev 2022-02-09 11:34:08 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-power/suspend-1.0_p20200924 fails to compile.
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-02-09 11:34:11 UTC
Created attachment 764682 [details]
build.log

build log and emerge --info
Comment 2 Leonard Gomez 2022-08-30 00:14:23 UTC
Still broken on musl
Comment 3 noosfaira 2023-10-12 17:06:31 UTC
Created attachment 872607 [details, diff]
Missing #define _GNU_SOURCE

Fix for sys-power/suspend on musl hardened.

I wrote a long post but it got deleted.

Now briefly, three files missing a #define:

#define _GNU_SOURCE

The files are:

swsusp.h
suspend.c
load.c

My initial tests where with a GCC option like this:

CFLAGS="${COMMON_FLAGS}-D_GNU_SOURCE" emerge sys-power/suspend

The patch provided works with all USE flags turned on.
It's a gentoo diff that works as a drop in solution in:

/etc/portage/patches

Thanks.