Bug#591386: since: FTBFS on hurd-i386
Source: since
Version:
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
Hi,
Currently since fails to build from source on GNU/Hurd due to failed
tests. The problem is that dev_t is an unsigned integer, i.e. 4 bytes,
on Hurd but since expects dev_t to be 8 bytes. Therefore define the
internal device d_dev to be of type "unsigned long long integer" to enable proper
functionality.
According to Emilio Pozuelo Monfort <pochu@debian.org> this is a bug in Hurd, not
since, see below (Message #10):
> Looking at why the string format is incorrect, I've found that make_fmt_field()
> (the function that creates the format string) is called for that argument with a
> dev_t argument, while the st_dev member of struct stat is not of type dev_t, but
> of __fsid_t. This seems to be a POSIX violation (because sizeof(__fsid_t) !=
> sizeof(dev_t), so it would be a bug in Hurd and not in since.
This seems to be correct:
According to http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html
The stat structure shall contain at least the following members:
dev_t st_dev Device ID of device containing file.
...
However /usr/include/i386-gnu/bits/stat.h shows:
struct stat
{
...
__fsid_t st_fsid; /* File system ID. */
#define st_dev st_fsid
...
}
and /usr/include/i386-gnu/bits/types.h:
__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
...
#if __WORDSIZE == 32
# define __UQUAD_TYPE __u_quad_t
#define __U32_TYPE unsigned int
#if __WORDSIZE == 64
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
#else
__extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
#endif
with /usr/include/i386-gnu/bits/typesizes.h:
#define __FSID_T_TYPE __UQUAD_TYPE
#define __DEV_T_TYPE __U32_TYPE
So this should probably be reported as a Hurd bug. Perhaps there are
direct consequences of doing that change without careful regression
testing.
Anyway, attached is an updated dev_t.patch to make since working again
on GNU/Hurd.
Thanks!
Date: Mon, 7 Apr 2014 21:00:39 +0200
From: Aleksandar Zlicic <Aleksandar.Zlicic@imgtec.com>
Subject: For mips/mipsel ABIO32, define int d_dev as unsigned long int
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742940
The cause of this problem is that st_dev member of structure stat,
defined in /usr/include/mipsel-linux-gnu/bits/stat.h,
is expected to be of type dev_t.
But for mips/mipsel ABIO32 it is defined as 'unsigned long int'.
And dev_t type is defined as 'unsigned long long int'.
Same behavior is observed on hurd-i386:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591386
Attached patch fixes package on mips/mipsel.
Index: since-1.1/since.c
===================================================================
--- since-1.1.orig/since.c
+++ since-1.1/since.c
@@ -52,7 +52,13 @@ struct fmt_map{
struct data_file{
int d_fd;
char *d_name;
+#if defined (__mips__ ) && (_MIPS_SIM == _ABIO32)
+ unsigned long int d_dev;
+#elif defined(__GNU__)
+ unsigned long long int d_dev;
+#else
dev_t d_dev;
+#endif
ino_t d_ino;
off_t d_had;
off_t d_now;
Reply to: