Almost successfull compiling GCJ, however..

Me Myself and I stargate7thsymbol@live.co.uk
Mon Mar 5 00:28:00 GMT 2012


I can't succeed in making much further progress based on this.
 
It seems that people think the problem is that I'm creating
 
some conflict by executing commands in the wrong directory.
 
My source code directory is
 
/home/User/gcc-4.6.2/
 
I run ./contrib/download_prerequisites; inside it.
 
I then create 
 
/home/User/objdir/
 
and cd to this directory.  Inside which I run 
 
./../gcc-4.6.2/configure --prefix=/home/User/;
 
 
which is not inside the source directory, being is /home/User/gcc-4.6.2/
 
 
Having configured successfully, I then 
 
make clean;
 
make;
 
which provides me with the same error I have been reporting.
 
What should I do from this stage?
 
 
----------------------------------------
> Date: Thu, 1 Mar 2012 13:09:04 +0200
> From: kai.ruottu@wippies.com
> To: jwakely.gcc@gmail.com
> CC: stargate7thsymbol@live.co.uk; gcc-help@gcc.gnu.org; java@gcc.gnu.org
> Subject: Re: gcc-4.6.2 can't complete make
>
> 1.3.2012 2:54, Jonathan Wakely kirjoitti:
>
> > On 1 March 2012 00:46, Me Myself and I wrote:
> >>
> >> I have started again, moving objdir outside the gcc-4.6.2 source code directory.
> >>
> >> My configure completes, however I still get errors which look remarkably like this:
> >>
> >>
> >> /home/User/objdir
> >>
> >> make install;
> >>
> >> fib2_ui.c:76:29: error: 'FIB_TABLE_LIMIT' undeclared (first use in this function)
> >> fib2_ui.c:76:29: note: each undeclared identifier is reported only once for each function it appears in
> >> make[5] *** [fib2_ui.lo] Error 1
> >> make[5] Leaving directory '/home/User/gcc-4.6.2/objdir/gmp/mpn'
> >> make[4] ***all-recursive] Error 1
> >> make[4] Leaving directory '/home/User/gcc-4.6.2/objdir/gmp'
> >> make[3] *** [all] Error 2
> >> make[3] Leaving directory '/home/User/gcc-4.6.2/objdir/gmp'
> >> make[2] *** [all-stage1-gmp] Error 2
> >> make[2] Leaving directory '/home/User/gcc-4.6.2/objdir'
> >> make[1] *** [stage1-bubble] Error 2
> >> make[1] Leaving directory '/home/User/gcc-4.6.2/objdir'
> >> make: *** [all] Error 2
> >
> > This error comes from running inside the source dir. Either you're
> > still running there, or this isn't the error you're getting.
> >
> > FIB_TABLE_LIMIT should be defined by a file called fib_table.h which
> > gets generated in objdir/gmp
>
> Yes, that seems to be true :
>
> [root@localhost gmp]# grep FIB_TABLE_LIMIT *.h
> fib_table.h:#define FIB_TABLE_LIMIT 47
>
> But I would suspect the build in a subdir of the main GCC source
> directory really could have any influence. In my case 'gcc-4.6.2/build'
> was the equivalent to the 'gcc-4.6.2/objdir' here.
>
> BUT what was totally different between my case and Me_Myself_and_I's
> case was the choice for the "preferred build platform". Meanwhile
> some really seem to trust to the achievements of the MS Company and
> its leaders like Steve Ballmer who has referred to the free software
> Linux kernel as a "cancer that attaches itself in an intellectual
> property sense to everything it touches."
> (http://en.wikipedia.org/wiki/Steve_Ballmer) Once this same guy told us
> with Mr. Gates "MS
> Xenix being the future in the 32-bit PC-world", ie their goal was to
> create a commercial Unix for PCs which rules the whole Unix world...
> Who believes, who not...
>
> In any case the configure command for my "MinGW-targeted GCC on MinGW-
> host" was :
>
> ../configure --build=i686-linux-gnu --host=i586-mingw32 \
> --target=i686-mingw32 --enable-languages=c,c++,java \
> --prefix=/opt/cross --libexecdir=/opt/cross/lib \
> --disable-sjlj-exceptions --with-dwarf2 --enable-shared \
> --disable-win32-registry --disable-nls \
> --enable-libstdcxx-debug --enable-version-specific-runtime-libs \
> --with-gxx-include-dir=/opt/cross/include/c++/4.6.2 \
> --program-prefix=i686-mingw32- --program-suffix=-4.6
>
> Using a different CPU name ('i686' instead of 'i586') made it to be a
> crosscompiler, quite identical with the original Linux-hosted one, not
> a different native GCC...
>
> The '--enable-libgcj' would have been required in order to get libjava
> but as everyone who has tried this knows, producing it doesn't work and
> therefore its build for MinGW target is disabled as default in the
> gcc-4.6.2 sources...
>
> The $host GCC in the build was :
>
> [root@localhost gcc-4.6.2]# i586-mingw32-gcc-4.6 -v
> Using built-in specs.
> COLLECT_GCC=i586-mingw32-gcc-4.6
> COLLECT_LTO_WRAPPER=/opt/cross/lib/gcc/i586-mingw32/4.6.2/lto-wrapper
> Target: i586-mingw32
> Configured with: ../configure --build=i686-linux-gnu
> --host=i686-linux-gnu --target=i586-mingw32
> --enable-languages=c,c++,java --prefix=/opt/cross
> --libexecdir=/opt/cross/lib --enable-shared --enable-libstdcxx-debug
> --enable-version-specific-runtime-libs --disable-sjlj-exceptions
> --disable-win32-registry --disable-nls --with-dwarf2
> --with-gxx-include-dir=/opt/cross/include/c++/4.6.2
> --program-prefix=i586-mingw32- --program-suffix=-4.6
> Thread model: win32
> gcc version 4.6.2 (by Kai Ruottu)
>
> On Linux it succeeded nicely to produce gmp, mpfr and mpc from their
> sources after making one fix in the used mpfr-2.4.2 sources, the
> fixed code is the following :
>
> cygwin* | mingw* | pw32* | cegcc*)
> # When not using gcc, we currently assume that we are using
> # Microsoft Visual C++.
> # hardcode_libdir_flag_spec is actually meaningless, as there is
> # no search path for DLLs.
> hardcode_libdir_flag_spec=' '
> allow_undefined_flag=unsupported
> # Tell ltmain to make .lib files, not .a files.
> libext=a
> # Tell ltmain to make .dll files, not .so files.
>
> Originally there was :
>
> # Tell ltmain to make .lib files, not .a files.
> libext=lib
>
> which caused the mpc configure to not find a suitable 'libmpfr' :-(
> The bug was in two places in 'mpfr-2.4.2/configure'...
>
> Ok, here were hints for those who are going to create a MinGW-hosted
> and MinGW-targeted gcc-4.6.2 on some sane build platform, not on
> Windoze...
>
> The error which I got when trying to get libjava was :
>
> libtool: compile: /home/src/gcc-4.6.2/build/./gcc/xgcc -shared-libgcc
> -B/home/src/gcc-4.6.2/build/./gcc -nostdinc++
> -L/home/src/gcc-4.6.2/build/i586-mingw32/libstdc++-v3/src
> -L/home/src/gcc-4.6.2/build/i586-mingw32/libstdc++-v3/src/.libs
> -L/home/src/gcc-4.6.2/build/i586-mingw32/winsup/mingw
> -L/home/src/gcc-4.6.2/build/i586-mingw32/winsup/w32api/lib -isystem
> /home/src/gcc-4.6.2/winsup/mingw/include -isystem
> /home/src/gcc-4.6.2/winsup/w32api/include -B/opt/cross/i586-mingw32/bin/
> -B/opt/cross/i586-mingw32/lib/ -isystem /opt/cross/i586-mingw32/include
> -isystem /opt/cross/i586-mingw32/sys-include -DHAVE_CONFIG_H -I.
> -I../../../libjava -I./include -I./gcj -I../../../libjava -Iinclude
> -I../../../libjava/include -I../../../libjava/classpath/include
> -Iclasspath/include -I../../../libjava/classpath/native/fdlibm
> -I../../../libjava/../boehm-gc/include -I../boehm-gc/include
> -I../../../libjava/libltdl -I../../../libjava/libltdl
> -I../../../libjava/.././libjava/../gcc -I../../../libjava/../zlib
> -I../../../libjava/../libffi/include -I../libffi/include -fno-rtti
> -fnon-call-exceptions -mthreads -fdollars-in-identifiers -Wswitch-enum
> -D_FILE_OFFSET_BITS=64 -ffloat-store -fomit-frame-pointer -Usun
> -fno-omit-frame-pointer -Wextra -Wall -D_GNU_SOURCE
> -DPREFIX=\"/opt/cross\"
> -DTOOLEXECLIBDIR=\"/opt/cross/lib/gcc/i586-mingw32/4.6.2\"
> -DJAVA_HOME=\"/opt/cross\"
> -DBOOT_CLASS_PATH=\"/opt/cross/share/java/libgcj-4.6.2.jar\"
> -DJAVA_EXT_DIRS=\"/opt/cross/share/java/ext\"
> -DGCJ_ENDORSED_DIRS=\"/opt/cross/share/java/gcj-endorsed\"
> -DGCJ_VERSIONED_LIBDIR=\"/opt/cross/lib/gcj-4.6.2-12\"
> -DPATH_SEPARATOR=\":\" -DECJ_JAR_FILE=\"\"
> -DLIBGCJ_DEFAULT_DATABASE=\"/opt/cross/lib/gcj-4.6.2-12/classmap.db\"
> -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.6.2-12/classmap.db\" -g -Os
> -MT jni.lo -MD -MP -MF .deps/jni.Tpo -c ../../../libjava/jni.cc
> -DDLL_EXPORT -DPIC -o .libs/jni.o
> ../../../libjava/jni.cc: In function 'java::lang::Object*
> _Jv_JNI_ToReflectedField(JNIEnv*, jclass, jfieldID, jboolean)':
> ../../../libjava/jni.cc:1663:14: error: new declaration
> 'java::lang::Object* _Jv_JNI_ToReflectedField(JNIEnv*, jclass, jfieldID,
> jboolean)'
> ../../../libjava/java/lang/reflect/Field.h:93:19: error: ambiguates old
> declaration 'java::lang::Object* _Jv_JNI_ToReflectedField(_Jv_JNIEnv*,
> jclass, jfieldID, jboolean)'
> ../../../libjava/java/lang/reflect/Field.h:83:105: error:
> 'java::lang::Class* java::lang::reflect::Field::declaringClass' is private
> ../../../libjava/jni.cc:1669:14: error: within this context
> ../../../libjava/java/lang/reflect/Field.h:85:8: error: 'jint
> java::lang::reflect::Field::offset' is private
> ../../../libjava/jni.cc:1670:14: error: within this context
> ../../../libjava/java/lang/Class.h:675:14: error: '_Jv_Field*
> java::lang::Class::fields' is private
> ../../../libjava/jni.cc:1670:55: error: within this context
> ../../../libjava/java/lang/reflect/Field.h:84:26: error:
> 'java::lang::String* java::lang::reflect::Field::name' is private
> ../../../libjava/jni.cc:1671:14: error: within this context
> ../../../libjava/jni.cc: In function 'java::lang::Object*
> _Jv_JNI_ToReflectedMethod(JNIEnv*, jclass, jmethodID, jboolean)':
> ../../../libjava/jni.cc:1694:15: error: new declaration
> 'java::lang::Object* _Jv_JNI_ToReflectedMethod(JNIEnv*, jclass,
> jmethodID, jboolean)'
> ../../../libjava/java/lang/reflect/Method.h:78:19: error: ambiguates old
> declaration 'java::lang::Object* _Jv_JNI_ToReflectedMethod(_Jv_JNIEnv*,
> jclass, jmethodID, jboolean)'
> ../../../libjava/java/lang/reflect/Constructor.h:19:3: error:
> 'java::lang::reflect::Constructor::Constructor()' is private
> ../../../libjava/jni.cc:1706:41: error: within this context
> ../../../libjava/java/lang/reflect/Constructor.h:56:8: error: 'jint
> java::lang::reflect::Constructor::offset' is private
> ../../../libjava/jni.cc:1707:10: error: within this context
> ../../../libjava/java/lang/Class.h:666:17: error: '_Jv_Method*
> java::lang::Class::<anonymous union>::methods' is private
> ../../../libjava/jni.cc:1707:50: error: within this context
> ../../../libjava/java/lang/reflect/Constructor.h:53:105: error:
> 'java::lang::Class* java::lang::reflect::Constructor::declaringClass' is
> private
> ../../../libjava/jni.cc:1708:10: error: within this context
> ../../../libjava/java/lang/reflect/Method.h:20:3: error:
> 'java::lang::reflect::Method::Method()' is private
> ../../../libjava/jni.cc:1713:31: error: within this context
> ../../../libjava/java/lang/reflect/Method.h:73:8: error: 'jint
> java::lang::reflect::Method::offset' is private
> ../../../libjava/jni.cc:1714:10: error: within this context
> ../../../libjava/java/lang/Class.h:666:17: error: '_Jv_Method*
> java::lang::Class::<anonymous union>::methods' is private
> ../../../libjava/jni.cc:1714:50: error: within this context
> ../../../libjava/java/lang/reflect/Method.h:64:105: error:
> 'java::lang::Class* java::lang::reflect::Method::declaringClass' is private
> ../../../libjava/jni.cc:1715:10: error: within this context
> ../../../libjava/jni.cc: At global scope:
> ../../../libjava/jni.cc:2891:1: error: invalid conversion from
> 'java::lang::Object* (*)(_Jv_JNIEnv*, jclass, jmethodID, jboolean) {aka
> java::lang::Object* (*)(_Jv_JNIEnv*, java::lang::Class*, _Jv_Method*,
> __java_boolean)}' to 'java::lang::Object* (*)(JNIEnv*, jclass,
> jmethodID, jboolean) {aka java::lang::Object* (*)(_Jv_JNIEnv*,
> java::lang::Class*, _Jv_Method*, __java_boolean)}' [-fpermissive]
> ../../../libjava/jni.cc:2891:1: error: invalid conversion from
> 'java::lang::Object* (*)(_Jv_JNIEnv*, jclass, jfieldID, jboolean) {aka
> java::lang::Object* (*)(_Jv_JNIEnv*, java::lang::Class*, _Jv_Field*,
> __java_boolean)}' to 'java::lang::Object* (*)(JNIEnv*, jclass, jfieldID,
> jboolean) {aka java::lang::Object* (*)(_Jv_JNIEnv*, java::lang::Class*,
> _Jv_Field*, __java_boolean)}' [-fpermissive]
> make[3]: *** [jni.lo] Virhe 1
> make[3]: Poistutaan hakemistosta
> "/home/src/gcc-4.6.2/build/i586-mingw32/libjava"
> make[2]: *** [all-recursive] Virhe 1
>
> As the Me_Myself_and_I's case shows, it isn't that wise to start to
> hit one's head against the wall in a garage which is not suitable
> for building anything there, much better would be to find a better
> place (like a nice small factory with working tools) where to build
> things...
 		 	   		   		 	   		  



More information about the Java mailing list