GNU bug report logs - #8555
[Bug Report] O_NOCACHE is a system define on AIX 5.1 and AIX 5.2

Previous Next

Package: coreutils;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8555 in the body.
You can then email your comments to 8555 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8555; Package coreutils. (Tue, 26 Apr 2011 06:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Gary V. Vaughan" <gary <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 26 Apr 2011 06:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Gary V. Vaughan" <gary <at> gnu.org>
To: bug-coreutils <at> gnu.org
Subject: [Bug Report] O_NOCACHE is a system define on AIX 5.1 and AIX 5.2
Date: Tue, 26 Apr 2011 13:23:37 +0700
[Message part 1 (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 2 (application/pgp-signature, inline)]

Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Tue, 26 Apr 2011 07:14:02 GMT) Full text and rfc822 format available.

Notification sent to "Gary V. Vaughan" <gary <at> gnu.org>:
bug acknowledged by developer. (Tue, 26 Apr 2011 07:14:02 GMT) Full text and rfc822 format available.

Message #10 received at 8555-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Gary V. Vaughan" <gary <at> gnu.org>
Cc: 8555-done <at> debbugs.gnu.org
Subject: Re: bug#8555: [Bug Report] O_NOCACHE is a system define on AIX 5.1
	and AIX 5.2
Date: Tue, 26 Apr 2011 09:13:48 +0200
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




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8555; Package coreutils. (Tue, 26 Apr 2011 08:59:01 GMT) Full text and rfc822 format available.

Message #13 received at 8555 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: 8555 <at> debbugs.gnu.org
Cc: jim <at> meyering.net
Subject: Re: bug#8555: [Bug Report] O_NOCACHE is a system define on AIX 5.1
	and AIX 5.2
Date: Tue, 26 Apr 2011 10:58:45 +0200
Jim Meyering <jim <at> meyering.net> writes:

> Shame on AIX.

Huh?  <fcntl.h> reserves the whole O_ namespace, so it's clearly shame
on coreutils.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 24 May 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.