Bug#838198: 9base: FTBFS on hurd-i386: fatal error:can't create y.tab.h, <nil>:1
Package: 9base
Severity: important
Version: 1:6-7
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
X-Debbugs-CC: debian-hurd@lists.debian.org
The package fails to build on hurd-i386 because of incorrect values
supplied to fopen() and missing (__GNU__)-defines.
Failing build log:
https://buildd.debian.org/status/package.php?p=9base&suite=sid
The supplied patch fixes this.
TODO: Write a Hurd-specific disksize()-function in lib9/_p9dir.c
Cheers,
Ola Ekström
diff -rupN 9base-6-original/lib9/date.c 9base-6-new/lib9/date.c
--- 9base-6-original/lib9/date.c 2010-06-04 10:46:05.000000000 +0000
+++ 9base-6-new/lib9/date.c 2016-09-17 06:11:07.000000000 +0000
@@ -8,7 +8,7 @@
#define _HAVETMZONE 1
#define _HAVETMTZOFF 1
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GNU__)
# undef _HAVETMZONE
# undef _HAVETMTZOFF
diff -rupN 9base-6-original/lib9/dirfwstat.c 9base-6-new/lib9/dirfwstat.c
--- 9base-6-original/lib9/dirfwstat.c 2010-06-04 10:46:05.000000000 +0000
+++ 9base-6-new/lib9/dirfwstat.c 2016-09-17 06:11:54.000000000 +0000
@@ -4,7 +4,7 @@
#include <sys/time.h>
#include <sys/stat.h>
-#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__linux__)
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__linux__) || defined(__GNU__)
/* do nothing -- futimes exists and is fine */
#elif defined(__SunOS5_9__)
diff -rupN 9base-6-original/lib9/dirread.c 9base-6-new/lib9/dirread.c
--- 9base-6-original/lib9/dirread.c 2010-06-04 10:46:05.000000000 +0000
+++ 9base-6-new/lib9/dirread.c 2016-09-17 06:07:55.000000000 +0000
@@ -6,7 +6,7 @@
extern int _p9dir(struct stat*, struct stat*, char*, Dir*, char**, char*);
-#if defined(__linux__) || defined(__FreeBSD_kernel__)
+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
static int
mygetdents(int fd, struct dirent *buf, int n)
{
diff -rupN 9base-6-original/lib9/libc.h 9base-6-new/lib9/libc.h
--- 9base-6-original/lib9/libc.h 2010-06-04 10:46:05.000000000 +0000
+++ 9base-6-new/lib9/libc.h 2016-09-17 21:04:11.000000000 +0000
@@ -594,10 +594,17 @@ extern void freenetconninfo(NetConnInfo
#define MCACHE 0x0010 /* cache some data */
#define MMASK 0x0017 /* all bits on */
-#define OREAD 0 /* open for read */
-#define OWRITE 1 /* write */
-#define ORDWR 2 /* read and write */
-#define OEXEC 3 /* execute, == read but check execute permission */
+#if defined(__GNU__)
+ #define OREAD O_RDONLY /* open for read */
+ #define OWRITE O_WRONLY /* write */
+ #define ORDWR O_RDWR /* read and write */
+ #define OEXEC O_EXEC /* execute, == read but check execute permission */
+#else
+ #define OREAD 0 /* open for read */
+ #define OWRITE 1 /* write */
+ #define ORDWR 2 /* read and write */
+ #define OEXEC 3 /* execute, == read but check execute permission */
+#endif
#define OTRUNC 16 /* or'ed in (except for exec), truncate file first */
#define OCEXEC 32 /* or'ed in, close on exec */
#define ORCLOSE 64 /* or'ed in, remove on close */
diff -rupN 9base-6-original/lib9/u.h 9base-6-new/lib9/u.h
--- 9base-6-original/lib9/u.h 2010-06-04 10:46:05.000000000 +0000
+++ 9base-6-new/lib9/u.h 2016-09-17 06:09:40.000000000 +0000
@@ -58,7 +58,7 @@ extern "C" {
typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GNU__)
# include <sys/types.h>
# if defined(__Linux26__)
# include <pthread.h>
Reply to: