NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/58278: src/tools/gzip build failed on Cygwin



>Number:         58278
>Category:       toolchain
>Synopsis:       src/tools/gzip build failed on Cygwin
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 24 09:40:00 +0000 2024
>Originator:     Izumi Tsutsui
>Release:        NetBSD 10.99.10 -current around 20240523
>Organization:
>Environment:
System: NetBSD mirage 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: maybe all
Machine: maybe all
>Description:
build.sh -U -m macppc fails on Cygwin in src/tools/gzip:

---
#   compile  gzip/gzip.lo
cc -O   -DNO_COMPRESS_SUPPORT -DNO_BZIP2_SUPPORT -DNO_LZ_SUPPORT -DNO_PACK_SUPPORT -DNO_XZ_SUPPORT -I/home/tsutsui/netbsd-src/obj.macppc/tooldir.CYGWIN_NT-10.0-19045-3.5.3-1.x86_64-x86_64/include/compat -I/home/tsutsui/netbsd-src/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -c -o gzip.lo.o    /home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c
In file included from /usr/include/sys/select.h:16,
                 from /usr/include/sys/types.h:50,
                 from /home/tsutsui/netbsd-src/tools/compat/compat_defs.h:100,
                 from /home/tsutsui/netbsd-src/obj.macppc/tooldir.CYGWIN_NT-10.0-19045-3.5.3-1.x86_64-x86_64/include/compat/nbtool_config.h:934,
                 from /home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:30:
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c: In function 'copymodes':
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1130:43: error: 'struct stat' has no member named 'st_atimespec'
 1130 |         TIMESPEC_TO_TIMEVAL(&times[0], &sb.st_atimespec);
      |                                           ^
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1130:43: error: 'struct stat' has no member named 'st_atimespec'
 1130 |         TIMESPEC_TO_TIMEVAL(&times[0], &sb.st_atimespec);
      |                                           ^
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1131:43: error: 'struct stat' has no member named 'st_mtimespec'
 1131 |         TIMESPEC_TO_TIMEVAL(&times[1], &sb.st_mtimespec);
      |                                           ^
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1131:43: error: 'struct stat' has no member named 'st_mtimespec'
 1131 |         TIMESPEC_TO_TIMEVAL(&times[1], &sb.st_mtimespec);
      |                                           ^
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1136:15: error: 'struct stat' has no member named 'st_flags'
 1136 |         if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
      |               ^
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1136:33: warning: implicit declaration of function 'fchflags'; did you mean 'lchflags'? [-Wimplicit-function-declaration]
 1136 |         if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
      |                                 ^~~~~~~~
      |                                 lchflags
/home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c:1136:48: error: 'struct stat' has no member named 'st_flags'
 1136 |         if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
      |                                                ^

*** Failed target:  gzip.lo
*** Failed command: cc -O -DNO_COMPRESS_SUPPORT -DNO_BZIP2_SUPPORT -DNO_LZ_SUPPORT -DNO_PACK_SUPPORT -DNO_XZ_SUPPORT -I/home/tsutsui/netbsd-src/obj.macppc/tooldir.CYGWIN_NT-10.0-19045-3.5.3-1.x86_64-x86_64/include/compat -I/home/tsutsui/netbsd-src/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -c -o gzip.lo.o /home/tsutsui/netbsd-src/tools/gzip/../../usr.bin/gzip/gzip.c
*** Error code 1

Stop.
nbmake: stopped in /home/tsutsui/netbsd-src/tools/gzip
---

>How-To-Repeat:
See above.

>Fix:
Disalbe whole non-POSIX time and flags in struct stat in tools case?

Or should we check st_atimespec and st_mtimespec in struct stat
(like st_atim etc.) and fchflags() (as lchflags()) in src/tools/compat?

diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c
index 4ad4d2dc6928..99032847c864 100644
--- a/usr.bin/gzip/gzip.c
+++ b/usr.bin/gzip/gzip.c
@@ -1126,7 +1126,7 @@ copymodes(int fd, const struct stat *sbp, const char *file)
 	if (fchmod(fd, sb.st_mode) < 0)
 		maybe_warn("couldn't fchmod: %s", file);
 
-#ifdef TIMESPEC_TO_TIMEVAL
+#if !HAVE_NBTOOL_CONFIG_H
 	TIMESPEC_TO_TIMEVAL(&times[0], &sb.st_atimespec);
 	TIMESPEC_TO_TIMEVAL(&times[1], &sb.st_mtimespec);
 	if (futimes(fd, times) < 0)

---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index