Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 751037 - stat: illegal option -- c
Summary: stat: illegal option -- c
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Other (show other bugs)
Hardware: AMD64 OS X
: Low trivial (vote)
Assignee: Gentoo non-Linux Team
Keywords: PATCH
Depends on:
Blocks: 755644
  Show dependency tree
Reported: 2020-10-24 14:12 UTC by Alexander Bezrukov
Modified: 2020-11-20 01:29 UTC (History)
3 users (show)

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

A trivial fix for stat invocation in (stat.patch,741 bytes, patch)
2020-10-24 14:17 UTC, Alexander Bezrukov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bezrukov 2020-10-24 14:12:32 UTC
I am trying to install Gentoo prefix on MacOS X (Mojave and Catalina). relies on the GNU version of the stat utility. MacOS X and FreeBSD (and probably other *BSD) have the BSD version of this utility installed, which use another set of flags. Therefore is the error message.

The fix is trivial. I will be attaching a patch.

Reproducible: Always

Steps to Reproduce:
1. ./

Actual Results:  
stat: illegal option -- c

Expected Results:  
No error message and the intended check is actually performed

Obviously I cannot provide 'emerge --info' output. I also used the 'Other' component because the web interface for Gentoo Bugzilla asks to not file bugs under 'Mac OSX', reserving it to ppc Macs.
Comment 1 Alexander Bezrukov 2020-10-24 14:17:45 UTC
Created attachment 668306 [details, diff]
A trivial fix for stat invocation in

Tested on clean MacOS 10.14.6. Untested on *BSD (but consulted FreeBSD stat(1) man page [0].

Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-24 14:21:58 UTC
Have you actually managed to get a bootstrap working? (See the other bug).
Comment 3 Alexander Bezrukov 2020-10-24 14:35:58 UTC
(In reply to Sam James from comment #2)
> Have you actually managed to get a bootstrap working? (See the other bug).

Only stage 1, then I have got the messages:

* ready to bootstrap stage2_log
!!! unknown compiler

I haven't had a chance to really look into this yet. This error is preceeded by several other errors during the script execution, I started to clean them one by one, this bug is the beginning (not sure if I will be able to make real progress).

I did a dumb and trivial fix for the /usr/include problem, simply symlinked the SDK include dir to /usr/include (disabled SIP for this single operation). I am a very newbie in the MacOS, probably I don't understand yet the real problem.
Comment 4 Larry the Git Cow gentoo-dev 2020-10-25 08:15:18 UTC
The bug has been closed via the following commit(s):

commit 6b522acbb352eaae250d54b48456350ded50d7ce
Author:     Alexander Bezrukov <>
AuthorDate: 2020-10-25 08:14:22 +0000
Commit:     Fabian Groffen <>
CommitDate: 2020-10-25 08:14:22 +0000

    scripts/bootstrap-prefix: fix stat invocation for Darwin/*BSD
    Signed-off-by: Fabian Groffen <>

 scripts/ | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)