Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
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
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Alpha Linux
: Normal normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on: 759001
Blocks:
  Show dependency tree
 
Reported: 2020-08-03 20:39 UTC by Christopher May-Townsend
Modified: 2020-12-24 22:43 UTC (History)
1 user (show)

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


Attachments
zstd error (zstd.out,1.35 KB, text/plain)
2020-08-03 20:39 UTC, Christopher May-Townsend
Details
emerge info (emerge_info.out,5.20 KB, text/plain)
2020-08-03 20:40 UTC, Christopher May-Townsend
Details
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
patch for programs/util.c: fix build without st_mtime (zstd-1.4.5-st_mtime.patch,511 bytes, patch)
2020-11-25 13:48 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
Comment 5 Yoshihiko Iwama 2020-11-25 13:48:31 UTC
Created attachment 674845 [details, diff]
patch for programs/util.c: fix build without st_mtime

I've noticed that this compiling failure issue has already been addressed upstream.

https://github.com/facebook/zstd/commit/26d01bdb26f1c7487ad4ba0151221dfe28cd878d#diff-bdd9ed58a64f99d68ed71c774eade698deeaefcf10da2c8bd2764269a916f53c

I attach a patch similar to upstream.
Comment 6 Matt Turner gentoo-dev 2020-12-08 01:57:29 UTC
In debugging a glib build failure, I realized that the cause is actually the cause of this build failure as well. See bug 759001.
Comment 7 Matt Turner gentoo-dev 2020-12-24 20:39:48 UTC
Now fixed in glibc-2.32-r6.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-12-24 22:43:54 UTC
(In reply to Matt Turner from comment #7)
> Now fixed in glibc-2.32-r6.

Nice perseverance Matt (and OP for reporting)!