Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via or IRC
Bug 735818 - app-arch/zstd-1.4.5 fails to compile on alpha
Summary: app-arch/zstd-1.4.5 fails to compile on alpha
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Alpha Linux
: Normal normal (vote)
Assignee: Patrick Lauer
Depends on:
Reported: 2020-08-03 20:39 UTC by Christopher May-Townsend
Modified: 2020-08-25 15:35 UTC (History)
1 user (show)

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

zstd error (zstd.out,1.35 KB, text/plain)
2020-08-03 20:39 UTC, Christopher May-Townsend
emerge info (emerge_info.out,5.20 KB, text/plain)
2020-08-03 20:40 UTC, Christopher May-Townsend
patch for alpha architecture (zstd-1.4.5-util_c-alpha.patch,699 bytes, patch)
2020-08-25 15:35 UTC, Yoshihiko Iwama
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher May-Townsend 2020-08-03 20:39:37 UTC
Created attachment 652804 [details]
zstd error

attached is the output snippet of the error
Comment 1 Christopher May-Townsend 2020-08-03 20:40:55 UTC
Created attachment 652806 [details]
emerge info
Comment 2 Yoshihiko Iwama 2020-08-24 09:54:39 UTC
I have the same issue on my UP1100.

At line 152 in programs/util.c of zstd-1.4.5, it is determined whether macro PLATFORM_POSIX_VERSION is 200809L or more and whether struct stat has member st_mtim by whether macro st_mtime is defined.
If __USE_XOPEN2K8 is defined and built with gcc version 3.3 or higher, Alpha architecture does not define macro st_mtime by adding both members st_mtim and st_mtime to struct stat by using union.(/usr/include/bits/stat.h)
In programs/platform.h, macro PLATFORM_POSIX_VERSION is defined equal to _POSIX_VERSION. Since __USE_XOPEN2K8 is defined in /usr/include/features.h, _POSIX_VERSION is 200809L in /usr/include/unistd.h. On Linux/alpha with __USE_XOPEN2K8 defined (in /usr/include/features.h), I think it can be said that struct stat will include member st_mtim even if macro st_mtime is not defined.

A simple solution is to treat Linux/alpha specially, but if there is a good way to easily determine if a structure contains a member, I'd prefer it.
Comment 3 Yoshihiko Iwama 2020-08-25 15:33:45 UTC
I was able to build with a attached patch that allows Linux/alpha if  PLATFORM_POSIX_VERSION is 200809L or higher.
Comment 4 Yoshihiko Iwama 2020-08-25 15:35:42 UTC
Created attachment 656624 [details, diff]
patch for alpha architecture