public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Error building libgcj on HP 10.20
@ 2000-04-01  0:00 'David Scott Urban
  2000-04-01  0:00 ` Jeff Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: 'David Scott Urban @ 2000-04-01  0:00 UTC (permalink / raw)
  To: java-discuss

I am trying to build libgcj on aq HP running HPUX 10.20.

Uname -a - HP-UX spica B.10.20 A 9000/735 unknown

gcc -v - Reading specs from 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/specs
gcc version 2.95.2 19991024 (release)

cpp -v - Reading specs from 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/cpp -lang-c -v 
-iprefix 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/hppa1.1-hp-hpux10
.20/2.95.2/ -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix 
-D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ 
-D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix 
-Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa) -D__hp9000s700 
-D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ -
GNU CPP version 2.95.2 19991024 (release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
 /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include
 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../hppa1
.1-hp-hpux10.20/include
 /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../inclu
de/g++-3
 /usr/local/include
End of omitted list.

During the build, I received the following error:

c++ -DHAVE_CONFIG_H -I. -I../../../libgcj/libjava -I./include 
-I../../../libgcj/libjava -Iinclude -I../../../libgcj/libjava/include 
-I../../../libgcj/libjava/../boehm-gc -I./../boehm-gc -DSILENT=1 -DNO_SIGNALS=1 
-DNO_DEBUGGING=1 -DJAVA_FINALIZATION=1 
-I../../../libgcj/libjava/../compat-include -I../../../libgcj/libjava/../zlib 
-I../../../libgcj/libjava/../libffi/include -I../libffi/include -fno-rtti 
-fvtable-thunks -fsjlj-exceptions -W -Wall -g -O2 -Wp,-MD,.deps/interpret.pp -c  
-fPIC -DPIC ../../../libgcj/libjava/interpret.cc -o .libs/interpret.lo
In file included from ../../../libgcj/libjava/include/jvm.h:14,
                 from ../../../libgcj/libjava/interpret.cc:17:
../../../libgcj/libjava/gcj/javaprims.h:260: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/gcj/javaprims.h:262: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/gcj/javaprims.h:264: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/gcj/javaprims.h:269: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/gcj/javaprims.h:275: warning: `__malloc__' attribute 
directive ignored
In file included from ../../../libgcj/libjava/interpret.cc:17:
../../../libgcj/libjava/include/jvm.h:64: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/include/jvm.h:66: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/include/jvm.h:68: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/include/jvm.h:105: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/include/jvm.h:149: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/include/jvm.h:151: warning: `__malloc__' attribute 
directive ignored
../../../libgcj/libjava/include/jvm.h:166: warning: `__malloc__' attribute 
directive ignored
In file included from ../../../libgcj/libjava/java/lang/mprec.h:36,
                 from ../../../libgcj/libjava/java/lang/fdlibm.h:25,
                 from ../../../libgcj/libjava/interpret.cc:20:
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h: 
In function `double pow(double, int)':
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:74
: declaration of C function `double pow(double, int)' conflicts with
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:71
: previous declaration `double pow(double, double)' here
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h: 
In function `double pow(double, int)':
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:75
: warning: `double' used for argument 2 of `pow(double, int)'
In file included from ../../../libgcj/libjava/interpret.cc:20:
../../../libgcj/libjava/java/lang/fdlibm.h: At top level:
../../../libgcj/libjava/java/lang/fdlibm.h:73: declaration of C function `double 
pow(double, double)' conflicts with
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:74
: previous declaration `double pow(double, int)' here
gmake[2]: *** [interpret.lo] Error 1

Any help would be reatly appreciated.

Scott Urban


D. S. Urban   
email : urban@ast.lmco.com
-------------------------------------------------------------------------------
To be the person, you must know the person. To know the person, you must
understand the person. To understand the person, you must listen. To listen,
you must open your mind and put aside all preconceived ideas and notions.
-------------------------------------------------------------------------------
All opinions expressed are my own not that of my employer

PS: Attached are the two header files creating the problems

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

* Re: Error building libgcj on HP 10.20
  2000-04-01  0:00 Error building libgcj on HP 10.20 'David Scott Urban
@ 2000-04-01  0:00 ` Jeff Sturm
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Sturm @ 2000-04-01  0:00 UTC (permalink / raw)
  To: 'David Scott Urban; +Cc: java-discuss

> In file included from ../../../libgcj/libjava/java/lang/mprec.h:36,
>                  from ../../../libgcj/libjava/java/lang/fdlibm.h:25,
>                  from ../../../libgcj/libjava/interpret.cc:20:
> /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:
> In function `double pow(double, int)':
> /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:74
> : declaration of C function `double pow(double, int)' conflicts with
                   ^^^^^^^^^^

There's a clue... pow(double, int) is supposed to be declared as an
inline C++ function, not a C function.

The header libjava/java/lang/mprec.h includes <math.h> from  within a
`extern "C" {...}' block... that looks wrong to me.  (Are nested "C"
blocks even allowed in C++?)

Try the patch below and let us know if it works.  (BTW the warnings
about __malloc__ indicate your gcj compiler is out-of-date.)

Index: mprec.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/mprec.h,v
retrieving revision 1.3
diff -u -r1.3 mprec.h
--- mprec.h     1999/07/12 09:40:07     1.3
+++ mprec.h     2000/01/07 18:56:47
@@ -33,6 +33,10 @@
 #include <config.h>
 #include "ieeefp.h"

+#ifdef __cplusplus
+}
+#endif
+
 #include <math.h>
 // #include <float.h>
 // #include <errno.h>
@@ -51,6 +55,9 @@
 #include <sys/config.h>
 #endif

+#ifdef __cplusplus
+extern "C" {
+#endif

 /* ISO C9X int type declarations */

-- 
Jeff Sturm
jsturm@sigma6.com

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

* Re: Error building libgcj on HP 10.20
@ 2000-04-01  0:00 'David Scott Urban
  2000-04-01  0:00 ` Jeff Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: 'David Scott Urban @ 2000-04-01  0:00 UTC (permalink / raw)
  To: jsturm; +Cc: java-discuss

Jeff,

Tha patch worked for the first problem. Now, I am receiving the following error 
later related to the pow function:

c++ -DHAVE_CONFIG_H -I. -I../../../libgcj/libjava -I./include 
-I../../../libgcj/libjava -Iinclude -I../../../libgcj/libjava/include 
-I../../../libgcj/libjava/../boehm-gc -I./../boehm-gc -DSILENT=1 -DNO_SIGNALS=1 
-DNO_DEBUGGING=1 -DJAVA_FINALIZATION=1 
-I../../../libgcj/libjava/../compat-include -I../../../libgcj/libjava/../zlib 
-I../../../libgcj/libjava/../libffi/include -I../libffi/include -fno-rtti 
-fvtable-thunks -fsjlj-exceptions -W -Wall -D_GNU_SOURCE -g -O2 -c  -fPIC -DPIC 
../../../libgcj/libjava/java/lang/natMath.cc -o java/lang/.libs/natMath.lo
../../../libgcj/libjava/java/lang/natMath.cc: In function `jdouble 
java::lang::Math::pow (__java_double, __java_double)':
../../../libgcj/libjava/java/lang/natMath.cc:82: call of overloaded `pow 
(jdouble, jdouble)' is ambiguous
../../../libgcj/libjava/java/lang/fdlibm.h:73: candidates are: double pow 
(double, double)
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.96/include/math.h:72:  
               double pow (double, int)
../../../libgcj/libjava/java/lang/natMath.cc:83: warning: control reaches end of 
non-void function `java::lang::Math::pow (__java_double, __java_double)'
gmake[2]: *** [java/lang/natMath.lo] Error 1
gmake[2]: Leaving directory 
`/tmp_mnt/home/urban/gnu_src/compile/objdir/hppa1.1-hp-hpux10.20/libjava'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory 
`/tmp_mnt/home/urban/gnu_src/compile/objdir/hppa1.1-hp-hpux10.20/libjava'
gmake: *** [all-target-libjava] Error 2

Scott Urban

> From java-discuss-return-1692-urban=ast.lmco.com@sourceware.cygnus.com Fri Jan 
 7 15:16 MST 2000
> Date: Fri, 07 Jan 2000 17:53:55 -0500
> From: Jeff Sturm <jsturm@sigma6.com>
> Subject: Re: Error building libgcj on HP 10.20
> To: "'David Scott Urban" <urban@ast.lmco.com>,
        java-discuss@sourceware.cygnus.com
> MIME-version: 1.0
> Delivered-to: mailing list java-discuss@sourceware.cygnus.com
> Mailing-List: contact java-discuss-help@sourceware.cygnus.com; run by ezmlm
> X-Accept-Language: en
> List-Post: < mailto:java-discuss@sourceware.cygnus.com >
> List-Subscribe: < mailto:java-discuss-subscribe@sourceware.cygnus.com >
> List-Unsubscribe: 
< mailto:java-discuss-unsubscribe-urban=ast.lmco.com@sourceware.cygnus.com >
> List-Archive: < http://sourceware.cygnus.com/ml/java-discuss/ >
> List-Help: < mailto:java-discuss-help@sourceware.cygnus.com >, 
< http://sourceware.cygnus.com/ml/#faqs >
> 
> *sigh* my mail agent, or something garbled the patch... use the one
> attached to this message instead.
> 
> Jeff Sturm wrote:
> > 
> > David Scott Urban wrote:
> > > The patch did not work. I am still getting the same error.
> > 
> > OK.  I don't have a HP/UX machine here to test with, so I was guessing a
> > little.  This time I put the "inline pow(double, int)" into my math.h so
> > I can duplicate the error.
> > 
> > I discovered that fdlibm.h does the same thing, wrapping the includes
> > into a extern "C" block.  Both files are patched below.  This should
> > work on a fresh libgcj tree:
> 
> -- 
> Jeff Sturm
> jsturm@sigma6.com
> 

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

* Re: Error building libgcj on HP 10.20
  2000-04-01  0:00 ` Jeff Sturm
@ 2000-04-01  0:00   ` Jeff Sturm
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Sturm @ 2000-04-01  0:00 UTC (permalink / raw)
  To: 'David Scott Urban, java-discuss

*sigh* my mail agent, or something garbled the patch... use the one
attached to this message instead.

Jeff Sturm wrote:
> 
> David Scott Urban wrote:
> > The patch did not work. I am still getting the same error.
> 
> OK.  I don't have a HP/UX machine here to test with, so I was guessing a
> little.  This time I put the "inline pow(double, int)" into my math.h so
> I can duplicate the error.
> 
> I discovered that fdlibm.h does the same thing, wrapping the includes
> into a extern "C" block.  Both files are patched below.  This should
> work on a fresh libgcj tree:

-- 
Jeff Sturm
jsturm@sigma6.com
Index: fdlibm.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/fdlibm.h,v
retrieving revision 1.2
diff -u -r1.2 fdlibm.h
--- fdlibm.h	1999/06/24 20:41:47	1.2
+++ fdlibm.h	2000/01/07 22:13:47
@@ -12,10 +12,6 @@
  */
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <config.h>
 #include <stdlib.h>
 
@@ -47,6 +43,10 @@
 /* These typedefs are true for the targets running Java. */
 
 #define _IEEE_LIBM
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*
  * ANSI/POSIX
Index: mprec.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/mprec.h,v
retrieving revision 1.3
diff -u -r1.3 mprec.h
--- mprec.h	1999/07/12 09:40:07	1.3
+++ mprec.h	2000/01/07 22:13:48
@@ -26,9 +26,6 @@
 	dmg@research.att.com or research!dmg
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 #include <config.h>
 #include "ieeefp.h"
@@ -51,6 +48,9 @@
 #include <sys/config.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* ISO C9X int type declarations */
 

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

* Re: Error building libgcj on HP 10.20
  2000-04-01  0:00 'David Scott Urban
@ 2000-04-01  0:00 ` Jeff Sturm
  2000-04-01  0:00   ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Sturm @ 2000-04-01  0:00 UTC (permalink / raw)
  To: David Scott Urban; +Cc: java-discuss

David Scott Urban wrote:
> ../../../libgcj/libjava/java/lang/natMath.cc: In function `jdouble
> java::lang::Math::pow (__java_double, __java_double)':
> ../../../libgcj/libjava/java/lang/natMath.cc:82: call of overloaded `pow
> (jdouble, jdouble)' is ambiguous
> ../../../libgcj/libjava/java/lang/fdlibm.h:73: candidates are: double pow
> (double, double)

Try this:

Index: natMath.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natMath.cc,v
retrieving revision 1.2
diff -u -r1.2 natMath.cc
--- natMath.cc  1999/09/10 22:03:08     1.2
+++ natMath.cc  2000/01/10 19:25:51
@@ -79,7 +79,7 @@
 
 jdouble java::lang::Math::pow(jdouble y, jdouble x)
 {
-  return (jdouble)::pow((jdouble)y, (jdouble)x);
+  return (jdouble)::pow((double)y, (double)x);
 }  
 
 jdouble java::lang::Math::IEEEremainder(jdouble y, jdouble x)

-- 
Jeff Sturm
jsturm@sigma6.com

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

* Re: Error building libgcj on HP 10.20
  2000-04-01  0:00 'David Scott Urban
@ 2000-04-01  0:00 ` Jeff Sturm
  2000-04-01  0:00   ` Jeff Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Sturm @ 2000-04-01  0:00 UTC (permalink / raw)
  To: 'David Scott Urban; +Cc: java-discuss

David Scott Urban wrote:
> The patch did not work. I am still getting the same error.

OK.  I don't have a HP/UX machine here to test with, so I was guessing a
little.  This time I put the "inline pow(double, int)" into my math.h so
I can duplicate the error.

I discovered that fdlibm.h does the same thing, wrapping the includes
into a extern "C" block.  Both files are patched below.  This should
work on a fresh libgcj tree:


Index: fdlibm.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/fdlibm.h,v
retrieving revision 1.2
diff -u -r1.2 fdlibm.h
--- fdlibm.h    1999/06/24 20:41:47     1.2
+++ fdlibm.h    2000/01/07 22:02:10
@@ -12,10 +12,6 @@
  */


-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <config.h>
 #include <stdlib.h>
Index: mprec.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/mprec.h,v
retrieving revision 1.3
diff -u -r1.3 mprec.h
--- mprec.h     1999/07/12 09:40:07     1.3
+++ mprec.h     2000/01/07 22:04:26
@@ -26,9 +26,6 @@
        dmg@research.att.com or research!dmg
  */

-#ifdef __cplusplus
-extern "C" {
-#endif

 #include <config.h>
 #include "ieeefp.h"
@@ -51,6 +48,9 @@
 #include <sys/config.h>
 #endif

+#ifdef __cplusplus
+extern "C" {
+#endif

 /* ISO C9X int type declarations */

@@ -47,6 +43,10 @@
 /* These typedefs are true for the targets running Java. */

 #define _IEEE_LIBM
+
+#ifdef __cplusplus
+extern "C" {
+#endif

 /*
  * ANSI/POSIX

-- 
Jeff Sturm
jsturm@sigma6.com

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

* Re: Error building libgcj on HP 10.20
@ 2000-04-01  0:00 'David Scott Urban
  2000-04-01  0:00 ` Jeff Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: 'David Scott Urban @ 2000-04-01  0:00 UTC (permalink / raw)
  To: jsturm; +Cc: java-discuss

The patch did not work. I am still getting the same error.

I am currently using gcc 2.95.2 with the java patches applied. I am going to try 
and compile the latest snapshot. Then, recompile libgcj with the patch applied 
to see if that makes a difference.

I will start with a fresh setup of libgcj.

Scott Urban

> 
> > In file included from ../../../libgcj/libjava/java/lang/mprec.h:36,
> >                  from ../../../libgcj/libjava/java/lang/fdlibm.h:25,
> >                  from ../../../libgcj/libjava/interpret.cc:20:
> > 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:
> > In function `double pow(double, int)':
> > 
/home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:74
> > : declaration of C function `double pow(double, int)' conflicts with
>                    ^^^^^^^^^^
> 
> There's a clue... pow(double, int) is supposed to be declared as an
> inline C++ function, not a C function.
> 
> The header libjava/java/lang/mprec.h includes <math.h> from  within a
> `extern "C" {...}' block... that looks wrong to me.  (Are nested "C"
> blocks even allowed in C++?)
> 
> Try the patch below and let us know if it works.  (BTW the warnings
> about __malloc__ indicate your gcj compiler is out-of-date.)
> 
> Index: mprec.h
> ===================================================================
> RCS file: /cvs/java/libgcj/libjava/java/lang/mprec.h,v
> retrieving revision 1.3
> diff -u -r1.3 mprec.h
> --- mprec.h     1999/07/12 09:40:07     1.3
> +++ mprec.h     2000/01/07 18:56:47
> @@ -33,6 +33,10 @@
>  #include <config.h>
>  #include "ieeefp.h"
> 
> +#ifdef __cplusplus
> +}
> +#endif
> +
>  #include <math.h>
>  // #include <float.h>
>  // #include <errno.h>
> @@ -51,6 +55,9 @@
>  #include <sys/config.h>
>  #endif
> 
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> 
>  /* ISO C9X int type declarations */
> 
> -- 
> Jeff Sturm
> jsturm@sigma6.com

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

* Re: Error building libgcj on HP 10.20
  2000-04-01  0:00 ` Jeff Sturm
@ 2000-04-01  0:00   ` Tom Tromey
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Tromey @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: David Scott Urban, java-discuss

>>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:

Jeff> -  return (jdouble)::pow((jdouble)y, (jdouble)x);
Jeff> +  return (jdouble)::pow((double)y, (double)x);

There were a few of these in natMath.cc.
I'll be sending and committing a patch soon.

Thanks,
Tom

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

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01  0:00 Error building libgcj on HP 10.20 'David Scott Urban
2000-04-01  0:00 ` Jeff Sturm
2000-04-01  0:00 'David Scott Urban
2000-04-01  0:00 ` Jeff Sturm
2000-04-01  0:00   ` Tom Tromey
2000-04-01  0:00 'David Scott Urban
2000-04-01  0:00 ` Jeff Sturm
2000-04-01  0:00   ` Jeff Sturm

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).