dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Configure check for stat64 does not work on Apple silicon
@ 2021-05-16  8:47 Saagar Jha
  2021-05-26  5:49 ` shell: Call CHECK_DECL on stat64 Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Saagar Jha @ 2021-05-16  8:47 UTC (permalink / raw)
  To: dash

Hi,

I’m working on getting dash building on macOS for Apple silicon. On this platform, stat64 is not available:

  CC       cd.o
cd.c:99:16: error: variable has incomplete type 'struct stat64'
        struct stat64 statb;
                      ^
cd.c:99:9: note: forward declaration of 'struct stat64'
        struct stat64 statb;
               ^
cd.c:135:7: error: implicit declaration of function 'stat64' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                if (stat64(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) {
                    ^
cd.c:135:7: note: did you mean 'stat'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/sys/stat.h:386:9: note: 'stat' declared here
int     stat(const char *, struct stat *) __DARWIN_INODE64(stat);
        ^
2 errors generated.

(If you happen to have access to an Intel Mac, you can reproduce this by running configure as CC="xcrun clang -arch arm64" ./configure --build=arm64-apple-darwin --host=x86_64-apple-darwin.)

Even though stat64 is not in the public headers, AC_CHECK_FUNC will “find” it because the symbol exists at link time for the test, even though it is not meant to be used. What do you think would be the best way to fix this check on this platform? Would it be preferred to check if the headers contain a declaration of the function?

Thanks,
Saagar Jha


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-27  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-16  8:47 Configure check for stat64 does not work on Apple silicon Saagar Jha
2021-05-26  5:49 ` shell: Call CHECK_DECL on stat64 Herbert Xu
2021-05-27  8:43   ` Saagar Jha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).