Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832981 - sys-power/suspend-1.0_p20200924 fails to compile: swsusp.h:61:9: error: unknown type name loff_t
Summary: sys-power/suspend-1.0_p20200924 fails to compile: swsusp.h:61:9: error: unkno...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2022-02-09 11:34 UTC by Agostino Sarubbo
Modified: 2024-11-23 18:29 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,67.50 KB, text/plain)
2022-02-09 11:34 UTC, Agostino Sarubbo
Details
Missing #define _GNU_SOURCE (suspend-1.0_p20200924-lofft.patch,670 bytes, patch)
2023-10-12 17:06 UTC, noosfaira
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 4 Nico Baggus 2024-10-31 22:42:40 UTC
This is caused by com autoreconf mixup .... somewhere.

in the make file ONLY
-llibgcrypt    is seed...

Where the following is returned:
$ libgcrypt-config --libs
-lgcrypt -lgpg-error


Not sure where that fails though.

For some reasoin -lgpg-error is AWOL.
Comment 5 Larry the Git Cow gentoo-dev 2024-11-23 18:29:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42e5f21bc0357e5a11ec584cc3f0a3d2324d62cb

commit 42e5f21bc0357e5a11ec584cc3f0a3d2324d62cb
Author:     Christopher Byrne <salah.coronya@gmail.com>
AuthorDate: 2024-11-19 01:31:24 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-11-23 18:29:26 +0000

    sys-power/suspend: Fix compile on musl and newer libgcrypt
    
    Closes: https://bugs.gentoo.org/939507
    Closes: https://bugs.gentoo.org/936933
    Closes: https://bugs.gentoo.org/832981
    
    Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/39367
    Signed-off-by: Sam James <sam@gentoo.org>

 ...d-1.0_p20200924-Use-pkgconf-for-libgcrypt.patch | 18 ++++++++++++++++
 ...suspend-1.0_p20200924-fix-loff_t-for-musl.patch | 24 ++++++++++++++++++++++
 sys-power/suspend/suspend-1.0_p20200924.ebuild     |  8 ++++++--
 3 files changed, 48 insertions(+), 2 deletions(-)