https://bugs.winehq.org/show_bug.cgi?id=52374
Bug ID: 52374 Summary: compiling on Cygwin fails: error: ‘S_IRUSR’ undeclared (in libs/mpg123) Product: Wine Version: 7.0-rc5 Hardware: x86-64 OS: Windows Status: UNCONFIRMED Severity: normal Priority: P2 Component: l3codeca.acm Assignee: wine-bugs@winehq.org Reporter: saulius2@gmail.com
(This is continuation from the bug 52370)
After faking some dlls from there, make then fails in libs/mpg123.
Other defines are missing too: S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH.
--- snip --- $ make gcc -c -o libs/mpg123/src/compat/compat.o libs/mpg123/src/compat/compat.c -Ilibs/mpg123 -Iinclude -Iinclude/msvcrt \ -Ilibs/mpg123/src -Ilibs/mpg123/src/compat -Ilibs/mpg123/src/libmpg123 -DOPT_GENERIC_DITHER \ -DREAL_IS_FLOAT -DNO_CATCHSIGNAL -DMPG123_NO_LARGENAME -D_UCRT -fasynchronous-unwind-tables \ -D_WIN32 -fno-builtin -fshort-wchar -D__WINE_PE_BUILD -pipe -fcf-protection=none \ -fno-stack-protector -fno-strict-aliasing -Wno-packed-not-aligned -gdwarf-4 \ -fno-omit-frame-pointer -g -O2 libs/mpg123/src/compat/compat.c: In function ‘INT123_compat_open’: libs/mpg123/src/compat/compat.c:96:37: error: ‘S_IRUSR’ undeclared (first use in this function) 96 | ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ^~~~~~~ libs/mpg123/src/compat/compat.c:96:37: note: each undeclared identifier is reported only once for each function it appears in libs/mpg123/src/compat/compat.c:96:45: error: ‘S_IWUSR’ undeclared (first use in this function) 96 | ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ^~~~~~~ libs/mpg123/src/compat/compat.c:96:53: error: ‘S_IRGRP’ undeclared (first use in this function) 96 | ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ^~~~~~~ libs/mpg123/src/compat/compat.c:96:61: error: ‘S_IWGRP’ undeclared (first use in this function) 96 | ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ^~~~~~~ libs/mpg123/src/compat/compat.c:96:69: error: ‘S_IROTH’ undeclared (first use in this function) 96 | ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ^~~~~~~ libs/mpg123/src/compat/compat.c:96:77: error: ‘S_IWOTH’ undeclared (first use in this function) 96 | ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); | ^~~~~~~ make: *** [Makefile:160889: libs/mpg123/src/compat/compat.o] Error 1 --- snip ---
This then leads to dlls/l3codeca.acm/l3codeca.acm build failure.
https://bugs.winehq.org/show_bug.cgi?id=52374
Saulius K. saulius2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|compiling on Cygwin fails: |build on Cygwin fails: |error: ‘S_IRUSR’ undeclared |error: ‘S_IRUSR’ undeclared |(in libs/mpg123) |(in libs/mpg123) Priority|P2 |P4 Severity|normal |blocker
--- Comment #1 from Saulius K. saulius2@gmail.com --- To me it seems that compiler doesn't pick up the following header file from libs/mpg123/src/compat/compat.c:
--- snip --- #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif --- snip ---
If I trace included header files:
--- snip --- $ gcc -c -H libs/mpg123/src/compat/compat.c -Ilibs/mpg123 -Iinclude -Iinclude/msvcrt -Ilibs/mpg123/src -Ilibs/mpg123/src/compat -Ilibs/mpg123/src/libmpg123 -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT -DNO_CATCHSIGNAL -DMPG123_NO_LARGENAME -D_UCRT -fasynchronous-unwind-tables -D_WIN32 -fno-builtin -fshort-wchar -D__WINE_PE_BUILD -pipe -fcf-protection=none -fno-stack-protector -fno-strict-aliasing -Wno-packed-not-aligned -gdwarf-4 -fno-omit-frame-pointer -g -O2 |& grep -e stat.h . include/msvcrt/sys/stat.h --- snip ---
... only include/msvcrt/sys/stat.h seems to be included. But the the header from Cygwin isn't tried. It's present on system along with the defines, though:
--- snip --- $ grep S_IRUSR /usr/include/sys/stat.h #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) #define S_IRUSR 0000400 /* read permission, owner */ #define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */ --- snip ---
https://bugs.winehq.org/show_bug.cgi?id=52374
--- Comment #2 from Saulius K. saulius2@gmail.com --- After updating Wine to the stable release of 7.0, the bug remains.
https://bugs.winehq.org/show_bug.cgi?id=52374
--- Comment #3 from Saulius K. saulius2@gmail.com --- Wine 7.3 build still fails on Cygwin.
I took a look at the related code block:
--- snip --- #if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */ /* Try plain old _open(), if it fails, do nothing */ ret = _open(filename, flags|_O_BINARY, _S_IREAD | _S_IWRITE); #else ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); #endif --- snip ---
... and now I'm not sure whether the 1st or the 2nd part should be activated when building 3rd party libs.