GNU bug report logs - #9380
Compilation problems with coreutils-8.9

Previous Next

Package: coreutils;

Reported by: Rob McMahon <Rob.McMahon <at> warwick.ac.uk>

Date: Fri, 26 Aug 2011 16:12:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

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 9380 in the body.
You can then email your comments to 9380 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#9380; Package coreutils. (Fri, 26 Aug 2011 16:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rob McMahon <Rob.McMahon <at> warwick.ac.uk>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 26 Aug 2011 16:12:02 GMT) Full text and rfc822 format available.

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

From: Rob McMahon <Rob.McMahon <at> warwick.ac.uk>
To: bug-coreutils <at> gnu.org
Subject: Compilation problems with coreutils-8.9
Date: Fri, 26 Aug 2011 15:58:25 +0100
[Message part 1 (text/plain, inline)]
I suspect you're going to say "upgrade to a more modern compiler" for 
most of these patches, but I had cause to install a later coreutils on 
an old box where this is not a viable option, running

cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18

There are many uses of later C compilers to accept declarations 
intermingled with statements, which are not supported by this compiler.  
The attached diffs fix all these problems.  Many of them are just 
swapping a couple of lines, which is probably worth it in the interests 
of compatibility.

Rob

-- 
E-Mail:	Rob.McMahon <at> warwick.ac.uk		PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England

[diffs (text/plain, attachment)]

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Fri, 26 Aug 2011 16:21:03 GMT) Full text and rfc822 format available.

Notification sent to Rob McMahon <Rob.McMahon <at> warwick.ac.uk>:
bug acknowledged by developer. (Fri, 26 Aug 2011 16:21:03 GMT) Full text and rfc822 format available.

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

From: Eric Blake <eblake <at> redhat.com>
To: Rob McMahon <Rob.McMahon <at> warwick.ac.uk>
Cc: 9380-done <at> debbugs.gnu.org
Subject: Re: bug#9380: Compilation problems with coreutils-8.9
Date: Fri, 26 Aug 2011 10:17:13 -0600
tag 9380 notabug
thanks

On 08/26/2011 08:58 AM, Rob McMahon wrote:
> I suspect you're going to say "upgrade to a more modern compiler" for
> most of these patches, but I had cause to install a later coreutils on
> an old box where this is not a viable option,

Thanks for the efforts; and hopefully by posting to the list, you have 
made life for someone else in the same situation.  However, you are 
correct that we will not take these patches into the upstream 
repository.  According to README, coreutils intentionally requires 
minimal C99 features from your compiler, one of which is supporting 
declaration-after-statement, and we are unwilling to take on the 
maintenance burden of uglifying the code just to support super-old C89 
compilers.

You may also want to try building the latest release (coreutils is 
currently at 8.12), although you will have to make the same manual C89 
patches on your own, as it will not be supported upstream.

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9380; Package coreutils. (Fri, 26 Aug 2011 16:33:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Rob McMahon <Rob.McMahon <at> warwick.ac.uk>
Cc: 9380 <at> debbugs.gnu.org
Subject: Re: bug#9380: Compilation problems with coreutils-8.9
Date: Fri, 26 Aug 2011 09:29:21 -0700
Can't you compile with the -xc99 option?  The Sun documentation says it's
supported, even with that old compiler:

http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e

'configure' should have deduced the -xc99 option for you; it tries
'-xc99=all' early on.  Does that not work for you?  The documentation
says '-xc99=%all' is required, but as I recall, the '%' was optional
even way back when.

Perhaps you can send in a copy of your 'configure' command, and the
resulting 'config.log' file?




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9380; Package coreutils. (Tue, 30 Aug 2011 11:50:03 GMT) Full text and rfc822 format available.

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

From: Rob McMahon <Rob.McMahon <at> warwick.ac.uk>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 9380 <at> debbugs.gnu.org
Subject: Re: bug#9380: Compilation problems with coreutils-8.9
Date: Tue, 30 Aug 2011 12:46:06 +0100
[Message part 1 (text/plain, inline)]
On 26/08/2011 17:29, Paul Eggert wrote:
> Can't you compile with the -xc99 option?  The Sun documentation says it's
> supported, even with that old compiler:
>
> http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e
>
> 'configure' should have deduced the -xc99 option for you; it tries
> '-xc99=all' early on.  Does that not work for you?  The documentation
> says '-xc99=%all' is required, but as I recall, the '%' was optional
> even way back when.
>
That doesn't seem to be quite enough unfortunately:

> cc -V
cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18
> dirs
~/src/gnu/dist/coreutils-8.9/lib
> make -n heap.o
echo "  CC      " heap.o;source='heap.c' object='heap.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \
cc  -I.   -D_REENTRANT   -O -xc99=%all -c -o heap.o heap.c
> make heap.o
  CC       heap.o
"heap.c", line 99: syntax error before or at: void
"heap.c", line 103: undefined symbol: top
"heap.c", line 103: warning: improper pointer/integer combination: op "="
cc: acomp failed for heap.c
make: *** [heap.o] Error 2
Exit 2
> sed -n '96,103p' heap.c
  if (heap->count == 0)
    return NULL;

  void *top = heap->array[1];
  heap->array[1] = heap->array[heap->count--];
  heapify_down (heap->array, heap->count, 1, heap->compare);

  return top;
>

If you look at the list of supported C99 features, it's:

 * *C99 Keywords*
 * *__func__* *Support*
 * *Variable Length Arrays*
 * *inline* *Specifier For Static Functions*
 * *Commenting Code With //*


No mixing of declarations with statements.  Ah well, this should be the 
last time I have to do this.

Rob

-- 
E-Mail:	Rob.McMahon <at> warwick.ac.uk		PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England

[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9380; Package coreutils. (Tue, 30 Aug 2011 14:47:01 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Rob McMahon <Rob.McMahon <at> warwick.ac.uk>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 9380 <at> debbugs.gnu.org
Subject: Re: bug#9380: Compilation problems with coreutils-8.9
Date: Tue, 30 Aug 2011 15:42:58 +0100
On 08/30/2011 12:46 PM, Rob McMahon wrote:
> On 26/08/2011 17:29, Paul Eggert wrote:
>> Can't you compile with the -xc99 option?  The Sun documentation says it's
>> supported, even with that old compiler:
>>
>> http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e
>>
>> 'configure' should have deduced the -xc99 option for you; it tries
>> '-xc99=all' early on.  Does that not work for you?  The documentation
>> says '-xc99=%all' is required, but as I recall, the '%' was optional
>> even way back when.
>>
> That doesn't seem to be quite enough unfortunately:
> 
>> cc -V
> cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18
>> dirs
> ~/src/gnu/dist/coreutils-8.9/lib
>> make -n heap.o
> echo "  CC      " heap.o;source='heap.c' object='heap.o' libtool=no \
> DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \
> cc  -I.   -D_REENTRANT   -O -xc99=%all -c -o heap.o heap.c
>> make heap.o
>   CC       heap.o
> "heap.c", line 99: syntax error before or at: void
> "heap.c", line 103: undefined symbol: top
> "heap.c", line 103: warning: improper pointer/integer combination: op "="
> cc: acomp failed for heap.c
> make: *** [heap.o] Error 2
> Exit 2
>> sed -n '96,103p' heap.c
>   if (heap->count == 0)
>     return NULL;
> 
>   void *top = heap->array[1];
>   heap->array[1] = heap->array[heap->count--];
>   heapify_down (heap->array, heap->count, 1, heap->compare);
> 
>   return top;

I've just adjusted that for heap.c as that might
be going to gnulib at some stage.
However you'll need to use your patch
for the rest of coreutils.

http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=683ee76
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8977

cheers,
Pádraig.




Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Tue, 20 Sep 2011 18:01:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 13 years and 249 days ago.

Previous Next


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