* [java, libjava] Allow C++ compilation with Solaris headers
@ 2011-08-09 15:40 Rainer Orth
2011-08-09 17:33 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2011-08-09 15:40 UTC (permalink / raw)
To: gcc-patches; +Cc: java-patches
While testing the patches to finally fix
PR libstdc++-v3/1773 __cplusplus defined to 1, should be 199711L
I came across two build failures when testing on i386-pc-solaris2.11:
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c: In function 'void print_constant(std::FILE*, JCF*, int, int)':
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:793:33: error: call of overloaded 'frexp(uint32&, int*)' is ambiguous
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:793:33: note: candidates are:
/var/gcc/gcc-4.7.0-20110805/11-gcc/./prev-gcc/include-fixed/iso/math_iso.h:216:21: note: long double std::frexp(long double, int*)
/var/gcc/gcc-4.7.0-20110805/11-gcc/./prev-gcc/include-fixed/iso/math_iso.h:186:15: note: float std::frexp(float, int*)
/var/gcc/gcc-4.7.0-20110805/11-gcc/./prev-gcc/include-fixed/iso/math_iso.h:86:15: note: double std::frexp(double, int*)
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:836:33: error: call of overloaded 'frexp(long long unsigned int&, int*)' is ambiguous
/vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:836:33: note: candidates are:
/var/gcc/gcc-4.7.0-20110805/11-gcc/./prev-gcc/include-fixed/iso/math_iso.h:216:21: note: long double std::frexp(long double, int*)
/var/gcc/gcc-4.7.0-20110805/11-gcc/./prev-gcc/include-fixed/iso/math_iso.h:186:15: note: float std::frexp(float, int*)
/var/gcc/gcc-4.7.0-20110805/11-gcc/./prev-gcc/include-fixed/iso/math_iso.h:86:15: note: double std::frexp(double, int*)
/vol/gcc/src/hg/trunk/solaris/libjava/exception.cc: In function 'void std::abort()':
/vol/gcc/src/hg/trunk/solaris/libjava/exception.cc:28:10: error: 'void std::abort()' was declared 'extern' and later 'static' [-fpermissive]
/var/gcc/gcc-4.7.0-20110805/11-gcc/./gcc/include-fixed/iso/stdlib_iso.h:132:13: error: previous declaration of 'void std::abort()' [-fpermissive]
The following patch fixes both and allows the bootstrap to complete
without regressions.
Ok for mainline?
Rainer
2011-08-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/java:
* jcf-dump.c (print_constant): Cast first frexp arg.
libjava:
* exception.cc (std::abort): Remove static.
diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c
--- a/gcc/java/jcf-dump.c
+++ b/gcc/java/jcf-dump.c
@@ -790,7 +790,7 @@ print_constant (FILE *out, JCF *jcf, int
/* Normal; add the implicit bit. */
mantissa |= ((uint32)1 << 23);
- f = frexp (mantissa, &dummy);
+ f = frexp ((float) mantissa, &dummy);
f = ldexp (f, exponent + 1);
fprintf (out, "%.10g", f);
}
@@ -833,7 +833,7 @@ print_constant (FILE *out, JCF *jcf, int
/* Normal; add the implicit bit. */
mantissa |= ((uint64)1 << 52);
- d = frexp (mantissa, &dummy);
+ d = frexp ((double) mantissa, &dummy);
d = ldexp (d, exponent + 1);
fprintf (out, "%.20g", d);
}
diff --git a/libjava/exception.cc b/libjava/exception.cc
--- a/libjava/exception.cc
+++ b/libjava/exception.cc
@@ -1,6 +1,7 @@
// Functions for Exception Support for Java.
-/* Copyright (C) 1998, 1999, 2001, 2002, 2006, 2010 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001, 2002, 2006, 2010, 2011
+ Free Software Foundation
This file is part of libgcj.
@@ -24,7 +25,7 @@ details. */
// stdlib.h's abort().
namespace std
{
- static __attribute__ ((__noreturn__)) void
+ __attribute__ ((__noreturn__)) void
abort ()
{
::abort ();
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [java, libjava] Allow C++ compilation with Solaris headers
2011-08-09 15:40 [java, libjava] Allow C++ compilation with Solaris headers Rainer Orth
@ 2011-08-09 17:33 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2011-08-09 17:33 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches, java-patches
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
Rainer> 2011-08-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Rainer> gcc/java:
Rainer> * jcf-dump.c (print_constant): Cast first frexp arg.
Rainer> libjava:
Rainer> * exception.cc (std::abort): Remove static.
Ok.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-09 17:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-09 15:40 [java, libjava] Allow C++ compilation with Solaris headers Rainer Orth
2011-08-09 17:33 ` Tom Tromey
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).