bugGuile - Bugs: bug #21378, guile 1.8.3 numbers.c fails to...

 
 

bug #21378: guile 1.8.3 numbers.c fails to compile in Solaris 9

Submitted by:  David Halik <dhalik>
Submitted on:  Sat 20 Oct 2007 09:29:04 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: Ludovic Courtès <civodul>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 07 Feb 2008 09:32:33 AM UTC, comment #7:

Hi David,

Thanks a lot for the patch, which is now installed. Hopefully 1.8.4 will compile out-of-the-box with Sun Studio.

Ludovic.

Ludovic Courtès <civodul>
Project AdministratorIn charge of this item.
Wed 06 Feb 2008 04:23:27 PM UTC, comment #6:

The patch allowed numbers.c to be compiled without a problem, however it looks like the same issue occurs in libguile/strings.c

"strings.c", line 132: reference to static identifier "scm_double_cell" in extern inline function

This compiles by replacing

SCM_C_INLINE_KEYWORD SCM with only SCM on line 127

The only other problem I encountered was with the file read.c Sun CC doesn't have the predefined macro _FUNCTION_. I believe _FUNCTION_ should return the undecorated name of the enclosing function (as a string). Since it only occurs twice in the file I just replaced it with the name of the enclosing function which allowed the compile to complete. Appears to run fine after installation.

I have your original changes plus the two mentioned above attached in the file below.

Thanks,

Dave D.

(file #14971)

David Diffenbaugh <davediff>
Wed 06 Feb 2008 01:56:51 PM UTC, comment #5:

Hey, I'm waiting on a full response from my tester, but it looks like there was another file that needed the change that isn't in your patch. The fix works, but I think he had to add it one more time. I'll ask him to post his results today.

David Halik <dhalik>
Wed 06 Feb 2008 01:52:47 PM UTC, comment #4:

I committed the proposed change to both branches, so it will be in 1.8.4.

Thanks,
Ludovic.

Ludovic Courtès <civodul>
Project AdministratorIn charge of this item.
Mon 04 Feb 2008 01:40:09 PM UTC, comment #3:

Sorry for taking soooo long to handle this.

It appears that the main issue here is that all these functions are declared `extern' in "numbers.h", and then defined "inline" in `numbers.c'.

From my understanding of the standard (summarized in Bruno Haible's message that you cited), this isn't correct: the function should have been either declared "extern inline", in which case its definition should appear in every translation unit, or the function is just declared "extern", in which case it cannot be defined "inline".

So I suggest removing the "inline" keyword for all these definitions. It appears that this does not affect the code generated by GCC -O2, as evidenced by "objdump -d numbers.o", since all calls to these functions within `numbers.c' are inlined (calls from outside are not inlined, which is normal).

Please, try out the attached patch and let me know if it works with Sun CC.

Thanks!

Ludovic.

(file #14954)

Ludovic Courtès <civodul>
Project AdministratorIn charge of this item.
Sun 21 Oct 2007 04:38:46 PM UTC, comment #2:

Ah, I see what you're getting at. I've actually run into this before. "inline" is the correct keyword in suncc, but it is much more strict C99 than gcc, which is usually the case with Sun Studio. You might want to check out this post, it explains the different uses of inline related to Sun, C99, GNU, etc, and their incompatibilities with examples. This isn't my best subject, but it looks like your question can be answered there.

http://www.mail-archive.com/bug-gnulib@gnu.org/msg04321.html

As far as your configure, it looks like it finds inline ok, Suncc is just not happy with its usage.

configure:21606: checking for inline
configure:21656: result: inline
ac_cv_c_inline=inline
SCM_I_GSC_C_INLINE='"inline"'

We try to use Suncc whenever possible to avoid gcc lib dependencies across our platforms and because Suncc ferrets out Sun problems more often, but it is always possible of course. ;) Thanks for the clarification about the bugtracker by the way.

-Dave

David Halik <dhalik>
Sun 21 Oct 2007 01:25:28 PM UTC, comment #1:

Hello,

Can you please send us the output of "grep inline config.log"?

Also, do you know whether Sun Studio's CC supports the `inline' keyword (or `__inline__' or similar), with the same semantics as in C99 and GNU C? Is a special compiler flag needed to obtain it?

Besides, note that compiling on Solaris with GCC should work.

Thanks,
Ludovic.

PS: Comments entered in the bug tracker are automatically forwarded to `bug-guile@gnu.org'.

Ludovic Courtès <civodul>
Project AdministratorIn charge of this item.
Sat 20 Oct 2007 09:29:04 PM UTC, original submission:

Hello,

I'm posting this to -unavailable- as well since I'm not sure where the proper place is. When compiling guile 1.8.3 in Solaris 9 with Sun Studio I'm receiving this fatal error:

source='numbers.c' object='libguile_la-numbers.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \
/bin/bash ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/usr/local/include -I/usr/local/include/gmp32 -D_REENTRANT -g -c -o libguile_la-numbers.lo `test -f 'numbers.c' || echo './'`numbers.c
cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/usr/local/include -I/usr/local/include/gmp32 -D_REENTRANT -g -c numbers.c -KPIC -DPIC -o .libs/libguile_la-numbers.o
"numbers.c", line 190: reference to static identifier "scm_double_cell" in extern inline function
"numbers.c", line 199: reference to static identifier "scm_double_cell" in extern inline function
"numbers.c", line 208: reference to static identifier "scm_double_cell" in extern inline function
"numbers.c", line 217: reference to static identifier "scm_double_cell" in extern inline function
"numbers.c", line 238: reference to static identifier "scm_double_cell" in extern inline function
cc: acomp failed for numbers.c

Any help would be appreciated.
Thanks!
-Dave

David Halik <dhalik>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #14971:  guile.inline-2.patch added by davediff (3KiB - application/octet-stream)
file #14954:  ,,numbers-inline.diff added by civodul (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by davediff (Updated the item)
  • -unavailable- added by civodul (Posted a comment)
  • -unavailable- added by dhalik (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 Feb 2008 04:23:27 PM UTCdavediffAttached File-=>Added guile.inline-2.patch, #14971
    Wed 06 Feb 2008 01:52:47 PM UTCcivodulOpen/ClosedOpen=>Closed
    Mon 04 Feb 2008 01:40:09 PM UTCcivodulAttached File-=>Added ,,numbers-inline.diff, #14954
      Assigned toNone=>civodul

    Back to the top


    Powered by Savane 3.1-cleanup1