Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933559 - sys-apps/systemd-utils-254.13 fails to cross-compile with: src/shared/libcrypt-util.c:115:30: error: invalid application of ‘sizeof’ to incomplete type ‘struct crypt_data’
Summary: sys-apps/systemd-utils-254.13 fails to cross-compile with: src/shared/libcryp...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Cross compilation support
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-05 05:29 UTC by tt_1
Modified: 2024-06-08 13:30 UTC (History)
2 users (show)

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


Attachments
build log from aarch64-cross (build.log.xz,17.30 KB, application/x-xz)
2024-06-05 05:29 UTC, tt_1
Details
output from emerge --info (cross-aarch64) (emerge.info,5.02 KB, text/plain)
2024-06-05 05:29 UTC, tt_1
Details
Decompressed build log (build.log,629.54 KB, text/plain)
2024-06-05 14:27 UTC, Mike Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2024-06-05 05:29:26 UTC
Created attachment 895093 [details]
build log from aarch64-cross

there is a compile error in libcrypt-util.c

610956-In file included from ../systemd-stable-254.13/src/shared/libcrypt-util.c:21:
611034-../systemd-stable-254.13/src/shared/libcrypt-util.c: In function ‘systemd_crypt_ra’:
611123:../systemd-stable-254.13/src/shared/libcrypt-util.c:115:30: error: invalid application of ‘sizeof’ to incomplete type ‘struct crypt_data’
611269-  115 |                 *data = new0(struct crypt_data, 1);
611329-      |                              ^~~~~~
--
611468-   26 | #define new0(t, n) ((t*) calloc((n) ?: 1, sizeof(t)))
611530-      |                                                  ^
611589:../systemd-stable-254.13/src/shared/libcrypt-util.c:121:39: error: invalid application of ‘sizeof’ to incomplete type ‘struct crypt_data’
611735-  121 |                 *size = (int) (sizeof(struct crypt_data));
611802-      |                                       ^~~~~~

the full build log is attached
Comment 1 tt_1 2024-06-05 05:29:56 UTC
Created attachment 895094 [details]
output from emerge --info (cross-aarch64)
Comment 2 tt_1 2024-06-05 05:30:59 UTC
actually, there are two errors in the same file: 

611855:../systemd-stable-254.13/src/shared/libcrypt-util.c:124:19: error: implicit declaration of function ‘crypt_r’; did you mean ‘crypt’? [-Werror=implicit-function-declaration]
612036-  124 |         char *t = crypt_r(phrase, setting, *data);
612095-      |                   ^~~~~~~
612129-      |                   crypt
612161-../systemd-stable-254.13/src/shared/libcrypt-util.c:124:19: warning: nested extern declaration of ‘crypt_r’ [-Wnested-externs]
612292:../systemd-stable-254.13/src/shared/libcrypt-util.c:124:19: error: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
Comment 3 Mike Gilbert gentoo-dev 2024-06-05 14:27:01 UTC
Created attachment 895182 [details]
Decompressed build log
Comment 4 Mike Gilbert gentoo-dev 2024-06-05 14:27:24 UTC
Comment on attachment 895093 [details]
build log from aarch64-cross

Please do not compress files when the do not exceed 1000 KB.
Comment 5 Mike Gilbert gentoo-dev 2024-06-05 14:31:10 UTC
The log has this:

Has header "crypt.h" : NO 

This is likely the cause of the failure.
Comment 6 tt_1 2024-06-05 14:33:40 UTC
Indeed, I was thinking if I may have to rebootstrap the whole cross-toolchain, as that crypt header was removed when glibc-2.38 was upgraded to glibc-2.39?
Comment 7 Mike Gilbert gentoo-dev 2024-06-05 14:43:05 UTC
(In reply to tt_1 from comment #6)
> Indeed, I was thinking if I may have to rebootstrap the whole
> cross-toolchain, as that crypt header was removed when glibc-2.38 was
> upgraded to glibc-2.39?

I don't think a full bootstrap is necessary.

You likely just need to (re)install libxcrypt with USE=system in ROOT. The system USE flag should be enabled by default, but double-check it.

Two ways of doing that:

aarch64-unknown-linux-gnu-emerge --oneshot sys-libs/libxcrypt

or

emerge --oneshot cross-aarch64-unknown-linux-gnu/libxcrypt

The latter approach will require that you set up an appropriate symlink in your crossdev ebuild repo.

Personally I would go with the first option since it is cleaner from a vdb standpoint.
Comment 8 Mike Gilbert gentoo-dev 2024-06-05 14:44:59 UTC
Re-assigning to cross since this seems to be an issue with glibc upgrades when cross-compiling.