unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [patch] guile 1.8.4 build problem on x86_64-sun-solaris2.10
@ 2008-02-20  4:11 Tim Mooney
  2008-02-23 10:37 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Mooney @ 2008-02-20  4:11 UTC (permalink / raw)
  To: bug-guile


I'm trying to build guile 1.8.4 on x86_64-sun-solaris2.10 with the Sun
Workshop 12 toolchain.  The OS and the toolchain are up to date with
patches.

I've tried with both

  	CFLAGS='-Xa -xO2 -xstrconst -mt -KPIC -xtarget=native -m64 -xarch=native'

and the same with the addition of -xc99=all (which should be the default
anyway...).  Either way, the configure proceeds fine and the build makes
it to libguile/numbers.c and then fails with:

   cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/local/gnu/include
-I/local/gnu/include -I/usr/local/include -I/local/gnu/include
-I/local/gnu/include -I/usr/local/include -D_REENTRANT -Xa -xc99=all -xO2
-xstrconst -mt -KPIC -xtarget=native -m64 -xarch=native
-I/local/gnu/include -I/local/gnu/include -I/usr/local/include -c
numbers.c  -KPIC -DPIC -o .libs/libguile_la-numbers.o
"numbers.c", line 5339: invalid type combination
"numbers.c", line 5339: incomplete _Imaginary type specifier
"numbers.c", line 5343: identifier redeclared: scm_make_rectangular
          current : function(pointer to struct scm_unused_struct {}, double
imaginary) returning pointer to struct scm_unused_struct {}
          previous: function(pointer to struct scm_unused_struct {}, pointer
to struct scm_unused_struct {}) returning pointer to struct
scm_unused_struct {} : "../libguile/numbers.h", line 249
"numbers.c", line 5343: formal parameter lacks name: param #2
"numbers.c", line 5345: syntax error before or at: _Imaginary
"numbers.c", line 5347: cannot recover from previous errors
cc: acomp failed for numbers.c

I was puzzled at what the compiler was upset about until I preprocessed
the file and examined it.

/usr/include/complex.h on Solaris has these defines near the top:


/*
   * Compilation environments for Solaris must provide the _Imaginary
   * datatype
   * and the compiler intrinsics _Complex_I and _Imaginary_I
   */
#define _Complex_I  _Complex_I
#define complex     _Complex
#define _Imaginary_I    _Imaginary_I
#define imaginary   _Imaginary
#undef  I
#define I       _Imaginary_I


It looks like the "#define imaginary _Imaginary" is being triggered by
this:


SCM_DEFINE (scm_make_rectangular, "make-rectangular", 2, 0, 0,
              (SCM real, SCM imaginary),
          "Return a complex number constructed of the given @var{real} and\n"
          "@var{imaginary} parts.")

in numbers.c.

The following patch avoids the problem:


--- guile-1.8.4.orig/libguile/numbers.c	2008-02-12 05:24:46.000000000 -0600
+++ guile-1.8.4/libguile/numbers.c	2008-02-19 22:04:21.511969000 -0600
@@ -5336,13 +5336,13 @@
   }

   SCM_DEFINE (scm_make_rectangular, "make-rectangular", 2, 0, 0,
-            (SCM real, SCM imaginary),
-	    "Return a complex number constructed of the given @var{real} and\n"
-	    "@var{imaginary} parts.")
+            (SCM real_part, SCM imaginary_part),
+	    "Return a complex number constructed of the given @var{real_part} and\n"
+	    "@var{imaginary_part} parts.")
   #define FUNC_NAME s_scm_make_rectangular
   {
     struct dpair xy;
-  scm_two_doubles (real, imaginary, FUNC_NAME, &xy);
+  scm_two_doubles (real_part, imaginary_part, FUNC_NAME, &xy);
     return scm_c_make_rectangular (xy.x, xy.y);
   }
   #undef FUNC_NAME

With that patch in place, the rest of the compile proceeds, and "gmake
check" reports:


Totals for this test run:
passes:                 11878
failures:               1
unexpected passes:      0
expected failures:      25
unresolved test cases:  9
untested test cases:    0
unsupported test cases: 11
errors:                 0

FAIL: check-guile



The FAIL seems to be:

FAIL: time.test: strftime: C99 %z format: EST+5



Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] guile 1.8.4 build problem on x86_64-sun-solaris2.10
  2008-02-20  4:11 [patch] guile 1.8.4 build problem on x86_64-sun-solaris2.10 Tim Mooney
@ 2008-02-23 10:37 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2008-02-23 10:37 UTC (permalink / raw)
  To: bug-guile

Hi,

Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> writes:

> /usr/include/complex.h on Solaris has these defines near the top:
>
>
> /*
>   * Compilation environments for Solaris must provide the _Imaginary
>   * datatype
>   * and the compiler intrinsics _Complex_I and _Imaginary_I
>   */
> #define _Complex_I  _Complex_I
> #define complex     _Complex
> #define _Imaginary_I    _Imaginary_I
> #define imaginary   _Imaginary
> #undef  I
> #define I       _Imaginary_I
>
>
> It looks like the "#define imaginary _Imaginary" is being triggered by
> this:
>
>
> SCM_DEFINE (scm_make_rectangular, "make-rectangular", 2, 0, 0,
>              (SCM real, SCM imaginary),

Thanks for finding it!  I just committed your patch, so it will be in 1.8.5.

> FAIL: time.test: strftime: C99 %z format: EST+5

Can you show the result of the following Scheme expressions in Guile:

  1. (strftime "%z" (gmtime 0))

  2. (begin
       (putenv "TZ=GMT+0")
       (tzset)
       (let ((tm (localtime 86400)))
	 (strftime "%z" tm)))

  3. (begin
       (putenv "TZ=EST+5")
       (tzset)
       (let ((tm (localtime 86400)))
	 (strftime "%z" tm)))

Thanks in advance,
Ludovic.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-23 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20  4:11 [patch] guile 1.8.4 build problem on x86_64-sun-solaris2.10 Tim Mooney
2008-02-23 10:37 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).