public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/1248: Fails to compile: "implicit declaration of function `int __builtin_expect(...)"
@ 2000-12-20 12:22 warnes
  0 siblings, 0 replies; only message in thread
From: warnes @ 2000-12-20 12:22 UTC (permalink / raw)
  To: java-gnats

>Number:         1248
>Category:       libgcj
>Synopsis:       Fails to compile: "implicit declaration of function `int __builtin_expect(...)"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bryce
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:15 PST 2000
>Closed-Date:    Sat May 20 16:34:03 PDT 2000
>Last-Modified:  Sat May 20 17:00:00 PDT 2000
>Originator:     Greg Warnes
>Release:        CVS 2000-05-18
>Organization:
>Environment:
Linux 2.2.15, gcj-2.9.2 with Bryce's patches
>Description:
Compilation terminates with:

rm -f .libs/prims.lo
In file included from ../../../libgcj/libjava/java/lang/Object.h:16,
                 from ../../../libgcj/libjava/gcj/cni.h:16,
                 from ../../../libgcj/libjava/prims.cc:32:
../../../libgcj/libjava/gcj/javaprims.h:259: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/gcj/javaprims.h:261: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/gcj/javaprims.h:263: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/gcj/javaprims.h:268: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/gcj/javaprims.h:274: warning: `__malloc__' attribute directive ignored
In file included from ../../../libgcj/libjava/gcj/cni.h:17,
                 from ../../../libgcj/libjava/prims.cc:32:
../../../libgcj/libjava/java/lang/Class.h: In function `void _Jv_InitClass(java::lang::Class *)':
../../../libgcj/libjava/java/lang/Class.h:206: implicit declaration of function `int __builtin_expect(...)'
In file included from ../../../libgcj/libjava/prims.cc:33:
../../../libgcj/libjava/include/jvm.h: At top level:
../../../libgcj/libjava/include/jvm.h:97: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:99: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:101: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:109: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:145: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:191: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:193: warning: `__malloc__' attribute directive ignored
../../../libgcj/libjava/include/jvm.h:228: warning: `__malloc__' attribute directive ignored
make[2]: *** [prims.lo] Error 1
make[2]: Leaving directory `/usr/src/libgcj-build/i586-pc-linux-gnu/libjava'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/libgcj-build/i586-pc-linux-gnu/libjava'
make: *** [all-target-libjava] Error 2












>How-To-Repeat:

>Fix:
Removed the __builtin_expect call from Class.h
>Release-Note:

>Audit-Trail:

Formerly PR libgcj/226


From: "Gregory R. Warnes" <warnes@biostat.washington.edu>
To: java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: libgcj/226: Fails to compile: "implicit declaration of function
 `int __builtin_expect(...)"
Date: Thu, 18 May 2000 21:46:07 +0000 (GMT)

 Temporary workaround: #define it.  (patch below)
 
 It would probably be a good idea to add an autoconf test for
 __builtin_expect .  If the verfion of gcc doesn't know about it, then use
 the #define.  I'd give it a whack, but I've never touched autoconf.
 
 I did do an altavista search, and such a test turns up in the libc config
 script at  http://mirror.schell.de/libc/configure .
 
 -Greg
 
 --- libgcj/libjava/java/lang/Class.h-orig	Thu May 18 14:36:09 2000
 +++ libgcj/libjava/java/lang/Class.h	Thu May 18 14:35:25 2000
 @@ -18,6 +18,10 @@
  #include <java/lang/String.h>
  #include <java/net/URL.h>
  
 +#ifndef HAVE_BUILTIN_EXPECT
 +#define  __builtin_expect( stmt, flag ) (stmt)
 +#endif
 +
  // We declare these here to avoid including gcj/cni.h.
  extern "C" void _Jv_InitClass (jclass klass);
  extern "C" void _Jv_RegisterClasses (jclass *classes);
 
 
 

From: Tom Tromey <tromey@cygnus.com>
To: "Gregory R. Warnes" <warnes@biostat.washington.edu>
Cc: java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Subject: Re: libgcj/226: Fails to compile: "implicit declaration of function
 `int __builtin_expect(...)"
Date: Thu, 18 May 2000 14:51:25 -0700 (PDT)

 >>>>> "Gregory" == Gregory R Warnes <warnes@biostat.washington.edu> writes:
 
 Gregory> It would probably be a good idea to add an autoconf test for
 Gregory> __builtin_expect .
 
 I agree, and that's what I'm planning to do.
 I might be able to get to it today.
 We'll see.  It depends on how my current project goes.
 
 Tom

From: "Gregory R. Warnes" <warnes@biostat.washington.edu>
To: Tom Tromey <tromey@cygnus.com>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: libgcj/226: Fails to compile: "implicit declaration of function
 `int __builtin_expect(...)"
Date: Thu, 18 May 2000 21:54:24 +0000 (GMT)

 Just to save time, the relevant portion of the libc configure script is
 
 ----begin quote----
 echo $ac_n "checking for __builtin_expect""... $ac_c" 1>&6
 echo "configure:2845: checking for __builtin_expect" >&5
 if eval "test \"`echo '$''{'libc_cv_gcc_builtin_expect'+set}'`\" =
 set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<EOF
 #line 2850 "configure"
 int foo (int a)
 {
   a = __builtin_expect (a, 10);
   return a == 10 ? 0 : 1;
 }
 EOF
 if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles
                             -o conftest conftest.c -lgcc >&5'; { (eval
 echo configure:2858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
   libc_cv_gcc_builtin_expect=yes
 else
   libc_cv_gcc_builtin_expect=no
 fi
 rm -f conftest*
 fi
 
 echo "$ac_t""$libc_cv_gcc_builtin_expect" 1>&6
 if test "$libc_cv_gcc_builtin_expect" = yes; then
   cat >> confdefs.h <<\EOF
 #define HAVE_BUILTIN_EXPECT 1
 EOF
 
 fi
 ----end quote----
 
 
 On Thu, 18 May 2000, Tom Tromey wrote:
 
   TT>> >>>>> "Gregory" == Gregory R Warnes <warnes@biostat.washington.edu> writes:
   TT>> 
   TT>> Gregory> It would probably be a good idea to add an autoconf test for
   TT>> Gregory> __builtin_expect .
   TT>> 
   TT>> I agree, and that's what I'm planning to do.
   TT>> I might be able to get to it today.
   TT>> We'll see.  It depends on how my current project goes.
   TT>> 
   TT>> Tom
   TT>> 
 
Responsible-Changed-From-To: tromey->bryce
Responsible-Changed-By: bryce
Responsible-Changed-When: Sat May 20 16:34:03 2000
Responsible-Changed-Why:
    I checked in a fix.
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Sat May 20 16:34:03 2000
State-Changed-Why:
    I checked in a fix.

From: bryce@sourceware.cygnus.com
To: java-gnats@sourceware.cygnus.com
Cc:  
Subject: libgcj/226
Date: 20 May 2000 23:30:46 -0000

 CVSROOT:	/cvs/java
 Module name:	libgcj
 Changes by:	bryce@sourceware.cygnus.com	00/05/20 16:30:46
 
 Modified files:
 	libjava        : ChangeLog 
 	libjava/java/lang: Class.h 
 	libjava/java/util/zip: ZipFile.java natInflater.cc 
 
 Log message:
 	2000-05-20  Bryce McKinlay  <bryce@albatross.co.nz>
 	
 	Fix for PR libgcj/226:
 	* java/lang/Class.h (_Jv_InitClass): Don't call __builtin_expect,
 	since this is an installed header.
 	
 	Fix for PR libgcj/228:
 	* java/util/zip/ZipFile (getInputStream): Create inflater with
 	nowrapper option.
 	
 	* java/util/zip/natInflater.cc (inflate): Throw zlib's error message
 	with DataFormatException.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/gcc/libjava/ChangeLog.diff?cvsroot=java&r1=1.384&r2=1.385
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/lang/Class.h.diff?cvsroot=java&r1=1.21&r2=1.22
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/util/zip/ZipFile.java.diff?cvsroot=java&r1=1.8&r2=1.9
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/util/zip/natInflater.cc.diff?cvsroot=java&r1=1.6&r2=1.7
 

From: bryce@albatross.co.nz
To: bryce@albatross.co.nz, java-gnats@sourceware.cygnus.com,
  tromey@cygnus.com, warnes@biostat.washington.edu
Cc:  
Subject: Re: libgcj/226
Date: 20 May 2000 23:34:04 -0000

 Synopsis: Fails to compile: "implicit declaration of function `int __builtin_expect(...)"
 
 Responsible-Changed-From-To: tromey->bryce
 Responsible-Changed-By: bryce
 Responsible-Changed-When: Sat May 20 16:34:03 2000
 Responsible-Changed-Why:
     I checked in a fix.
 State-Changed-From-To: open->closed
 State-Changed-By: bryce
 State-Changed-When: Sat May 20 16:34:03 2000
 State-Changed-Why:
     I checked in a fix.
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=226&database=java

From: Tom Tromey <tromey@cygnus.com>
To: bryce@albatross.co.nz
Cc: java-gnats@sourceware.cygnus.com, tromey@cygnus.com,
        warnes@biostat.washington.edu
Subject: Re: libgcj/226
Date: Sat, 20 May 2000 16:59:07 -0700 (PDT)

 Bryce>     I checked in a fix.
 
 I think this is just a partial fix.
 We also need to change configure to check for __builtin_expect.
 
 Tom
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:22 libgcj/1248: Fails to compile: "implicit declaration of function `int __builtin_expect(...)" warnes

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