GNU bug report logs -
#8555
[Bug Report] O_NOCACHE is a system define on AIX 5.1 and AIX 5.2
Previous Next
Reported by: "Gary V. Vaughan" <gary <at> gnu.org>
Date: Tue, 26 Apr 2011 06:24:02 UTC
Severity: normal
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 26 Apr 2011 09:13:48 +0200
with message-id <87k4ehcwnn.fsf <at> rho.meyering.net>
and subject line Re: bug#8555: [Bug Report] O_NOCACHE is a system define on AIX 5.1 and AIX 5.2
has caused the GNU bug report #8555,
regarding [Bug Report] O_NOCACHE is a system define on AIX 5.1 and AIX 5.2
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
8555: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8555
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hi,
On AIX 5.1 and AIX 5.2, building coreutils-8.11 is not possible out of the
box, because dd.c has an enum that tries to set a new constant O_NOCACHE. On
these machines, O_NOCACHE is a preprocessor define in /usr/include/fcntl.c,
so the symbol in the dd.c enum definition is replaced by a constant before
the compiler sees it, so can't be compiled as is.
I worked around it as follows:
gsed -i -e 's|O_NOCACHE|DD_NOCACHE|g' src/dd.c
I am not subscribed to this list, so please keep me in Cc for any
followups.
Cheers,
--
Gary V. Vaughan (gary AT gnu DOT org)
[Message part 4 (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
Gary V. Vaughan wrote:
> On AIX 5.1 and AIX 5.2, building coreutils-8.11 is not possible out of the
> box, because dd.c has an enum that tries to set a new constant O_NOCACHE. On
> these machines, O_NOCACHE is a preprocessor define in /usr/include/fcntl.c,
> so the symbol in the dd.c enum definition is replaced by a constant before
> the compiler sees it, so can't be compiled as is.
>
> I worked around it as follows:
>
> gsed -i -e 's|O_NOCACHE|DD_NOCACHE|g' src/dd.c
Hi Gary,
Thank you for the report. Shame on AIX.
I've fixed it slightly differently.
This way I don't have to change all of dd.c's uses of O_NOCACHE.
From 07c78f7eecf0b9ab75a6ae6aeff6e71bb34e421b Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> redhat.com>
Date: Tue, 26 Apr 2011 09:09:43 +0200
Subject: [PATCH] dd: work around compilation failure on AIX 5.1 and 5.2
* src/dd.c (O_NOCACHE): Undefine. This symbol is defined
via AIX's <fcntl.h>, yet used as an enum name in dd.c.
Reported by Gary V. Vaughan in http://debbugs.gnu.org/8555
---
src/dd.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/dd.c b/src/dd.c
index cb626fc..072410e 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -66,6 +66,10 @@
# define O_CIO 0
#endif
+/* On AIX 5.1 and AIX 5.2, O_NOCACHE is defined via <fcntl.h>
+ and would interfere with our use of that name, below. */
+#undef O_NOCACHE
+
#if ! HAVE_FDATASYNC
# define fdatasync(fd) (errno = ENOSYS, -1)
#endif
--
1.7.5.rc3.316.gd1ff9
This bug report was last modified 14 years and 90 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.