Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Message-ID: <024e01c0c63f$11b07470$0200a8c0@lifelesswks> From: "Robert Collins" To: , Subject: gcj && libjava for cygwin Date: Mon, 16 Apr 2001 16:32:52 +1000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_024B_01C0C692.E23590A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 16 Apr 2001 06:25:35.0401 (UTC) FILETIME=[0BC38990:01C0C63E] This is a multi-part message in MIME format. ------=_NextPart_000_024B_01C0C692.E23590A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Well it's a lot further along than it was... I'm going to have to leave it alone for now... so here's the current status: Part 1: for java AT gcc DOT gnu DOT org.. Hi, the attached patch should be acceptable for committing to the gcc tree. (The two line hack I sent to java AT gcc DOT gnu DOT org to prevent parsing files twice is still needed, I'll clean that up as previously discussed once I get some feedback on the best method). The patch fixes a couple of minor compile time issues. I also found that cygwin's ip6 support isn't complete enough for libjava. Someone interested can either rework libjava or extend cygwin, but I won't be attempting that. As configure found IP6 support, I edited $(top_builddir)/i686-pc-cygwin/libjava/include/config.h and undef'd the IP6 defines that configure found. Rob. Part 2: for cygwin-apps. I copied this to the cygwin-apps list for any cygwin porters interested in picking up the ball and running with it (I don't have the time, and with no java projects it doesn't make much sense to offer ;] ). If you want to test this do the following: grab gcc 3 from CVS (not head, get the gcc 3 branch. Configure it as per http://gcc.gnu.org/java/build-snapshot.html. Cygwin uses threads=posix as per that page. DONT SKIP STEP 4. GCJ is disabled for cygwin by default. before building: Apply the patch from http://gcc.gnu.org/ml/java/2001-04/msg00260.html. This is not a final patch, but it will fix the issue on cygwin (unless you use case_check:strict.). Apply the patch from this email. Edit the config.h file referenced above and disable the IP6 defines. edit i686-pc-cygwin/libjava/config.stats remove the two references to -lpthread (incorrectly detected - I haven't looked into why yet). in i686-pc-cygwin/libjava run ./config.status ditto for boehm-gc then carry on with the rest of step 5. It dies on the final link of jv-convert.exe: /usr/src/gcc3/build/gcc/gcj -B/usr/src/gcc3/build/i686-pc-cygwin/libjava / -B/usr/src/gcc3/ build/gcc/ -ffloat-store -g -O2 -o jv-convert.exe --main=gnu.gcj.convert.Convert -shared-l ibgcc gnu/gcj/convert/BytesToUnicode.o gnu/gcj/convert/Convert.o gnu/gcj/convert/Input_885 9_1.o gnu/gcj/convert/Input_ASCII.o gnu/gcj/convert/Input_EUCJIS.o gnu/gcj/convert/Input_J avaSrc.o gnu/gcj/convert/Input_SJIS.o gnu/gcj/convert/Input_UTF8.o gnu/gcj/convert/Input_i conv.o gnu/gcj/convert/IOConverter.o gnu/gcj/convert/Output_8859_1.o gnu/gcj/convert/Outpu t_ASCII.o gnu/gcj/convert/Output_EUCJIS.o gnu/gcj/convert/Output_JavaSrc.o gnu/gcj/convert /Output_SJIS.o gnu/gcj/convert/Output_UTF8.o gnu/gcj/convert/Output_iconv.o gnu/gcj/conver t/UnicodeToBytes.o -L/usr/src/gcc3/build/i686-pc-cygwin/libjava ./.libs/libgcj.a -L/usr/s rc/gcc3/build/i686-pc-cygwin/libstdc++-v3/src -L/usr/src/gcc3/build/i686 -pc-cygwin/libstdc ++-v3/src/.libs -L/usr/lib/w32api/ -L/usr/src/gcc3/build/gcc -L/usr/lib/ mingw -lgcc -lcygw in -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc ./../boehm-gc/.libs/libgcjgc.a -L/usr/sr c/gcc3/build/i686-pc-cygwin/libjava/../boehm-gc/.libs ./../zlib/.libs/libzgcj.a -L/usr/src /gcc3/build/i686-pc-cygwin/libjava/../zlib/.libs -L/usr/src/gcc3/build/i 686-pc-cygwin/libj ava/.libs -Wl,--rpath -Wl,/usr/src/gcc3/install/lib ./.libs/libgcj.a(natClass.o)(.text$_ZN4java4lang5ClassC1Ev+0x0): multiple definition of `j ava::lang::Class::Class()' ./.libs/libgcj.a(Class.o)(.text+0x3a0): first defined here /cygdrive/e/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccZRJIDimain%O(.text+0x0): multiple definition of `main' /usr/lib/libcygwin.a(libcmain.o)(.text+0x0): first defined here gnu/gcj/convert/BytesToUnicode.o(.text+0x252): undefined reference to `_Jv_Sjlj_Throw' gnu/gcj/convert/BytesToUnicode.o(.text+0x5e1): undefined reference to `_Jv_Sjlj_Throw' gnu/gcj/convert/UnicodeToBytes.o(.text+0x252): undefined reference to `_Jv_Sjlj_Throw' gnu/gcj/convert/UnicodeToBytes.o(.text+0x5e1): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(System.o)(.text+0x3df): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(StringBuffer.o)(.text+0x508): more undefined references to `_Jv_Sjlj_Thro w' follow ./.libs/libgcj.a(SimpleTimeZone.o)(.data+0x0):SimpleTimeZone.java: undefined reference to `Jv_byteVTable' ./.libs/libgcj.a(StringTokenizer.o)(.text+0x3a3): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(BasicPermission.o)(.text+0x99): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(BasicPermission.o)(.text+0x32d): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(BasicPermission.o)(.text+0x3b5): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(BufferedReader.o)(.text+0x2ed): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(BufferedReader.o)(.text+0xdb1): more undefined references to `_Jv_Sjlj_Th row' follow ./.libs/libgcj.a(natFirstThread.o)(.text+0xfb): undefined reference to `JNI_OnLoad' ./.libs/libgcj.a(natFirstThread.o)(.text+0x11a): undefined reference to `JNI_OnLoad' ./.libs/libgcj.a(Vector.o)(.text+0x6e): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Vector.o)(.text+0x1fe): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Vector.o)(.text+0x271): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Vector.o)(.text+0x89f): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Vector.o)(.text+0xabf): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Vector.o)(.text+0xba1): more undefined references to `_Jv_Sjlj_Throw' fol low ./.libs/libgcj.a(GregorianCalendar.o)(.data+0x0):GregorianCalendar.java: undefined referen ce to `Jv_intVTable' ./.libs/libgcj.a(GregorianCalendar.o)(.data+0x60): undefined reference to `Jv_intVTable' ./.libs/libgcj.a(GregorianCalendar.o)(.data+0xc0): undefined reference to `Jv_intVTable' ./.libs/libgcj.a(SimpleDateFormat.o)(.text+0x9cf): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(SimpleDateFormat.o)(.text+0x3939): undefined reference to `_Jv_Sjlj_Throw ' ./.libs/libgcj.a(DateFormat.o)(.text+0x21a): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(DateFormat.o)(.text+0x3cd): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(DateFormat.o)(.text+0x6a6): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Stack.o)(.text+0xa1): more undefined references to `_Jv_Sjlj_Throw' follo w ./.libs/libgcj.a(ZipEntry.o)(.data+0x0): undefined reference to `Jv_shortVTable' ./.libs/libgcj.a(ZipFile.o)(.text+0x119): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(ZipFile.o)(.text+0x44b): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(ZipFile.o)(.text+0x479): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(ZipFile.o)(.text+0x6f9): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(ZipFile.o)(.text+0x79e): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(ZipFile.o)(.text+0x81e): more undefined references to `_Jv_Sjlj_Throw' fo llow ./.libs/libgcj.a(InetAddress.o)(.data+0x0): undefined reference to `Jv_byteVTable' ./.libs/libgcj.a(Socket.o)(.text+0x5d4): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Socket.o)(.text+0x7b9): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Socket.o)(.text+0x8f1): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Socket.o)(.text+0xb08): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(Socket.o)(.text+0xc09): undefined reference to `_Jv_Sjlj_Throw' ./.libs/libgcj.a(URLConnection.o)(.text+0x40e): more undefined references to `_Jv_Sjlj_Thr ow' follow /usr/lib/libcygwin.a(libcmain.o)(.text+0x6a): undefined reference to `WinMain AT 16' I'm at a loss at this point. There are two apparent issues to me: the duplicate defined class IMO is likely related to the missing symbols. The WinMain AT 16 shouldn't be turning up unless the linker is getting seriously confused. Also the inclusion of mingw in the library search path is worrying. So consider a chunk of research done, a few problems solved, and this doco for the next adventurer. Remarks: Once everything is compiling and linkking, you _may_ hit an issue with classes not being found or something similar. My java here has a bunch of strcmp on filenames converted to strcasecmp. I don't believe that will affect the functionality - changing them didn't fix the fault with the Paint class. However changing them _may_ have fixed fault I would have run into later. My recommendation: don't change them unless you can pinpoint them as a bug. (Cygwin is case preserving and thus shouldn't need strcasecmp for most things.) Secondly, the X client includes may be needed to build libjava properly. I don't know if they are , cause I have them :] P.S. As I don't program java I have no idea of the type or amount of bugs hiding in the background. Have fun! Rob ------=_NextPart_000_024B_01C0C692.E23590A0 Content-Type: application/octet-stream; name="libjava.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libjava.patch" Index: java/lang/natSystem.cc=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/gcc/gcc/libjava/java/lang/natSystem.cc,v=0A= retrieving revision 1.35.2.2=0A= diff -u -p -r1.35.2.2 natSystem.cc=0A= --- natSystem.cc 2001/04/02 05:22:09 1.35.2.2=0A= +++ natSystem.cc 2001/04/16 06:27:14=0A= @@ -251,7 +251,11 @@ java::lang::System::getSystemTimeZone (v=0A= #ifdef STRUCT_TM_HAS_GMTOFF=0A= tzoffset =3D -(tim->tm_gmtoff); // tm_gmtoff is secs EAST of UTC.=0A= #elif HAVE_TIMEZONE=0A= +#ifdef __CYGWIN__=0A= + tzoffset =3D _timezone;=0A= +#else=0A= tzoffset =3D timezone; // timezone is secs WEST of UTC.=0A= +#endif /* CYGWIN */=0A= #else=0A= // FIXME: there must be another global if neither tm_gmtoff nor = timezone=0A= // is available, esp. if tzname is valid.=0A= Index: java/lang/reflect/natMethod.cc=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/gcc/gcc/libjava/java/lang/reflect/natMethod.cc,v=0A= retrieving revision 1.20=0A= diff -u -p -r1.20 natMethod.cc=0A= --- natMethod.cc 2001/01/08 23:28:56 1.20=0A= +++ natMethod.cc 2001/04/16 06:27:15=0A= @@ -13,6 +13,9 @@ details. */=0A= #if HAVE_ALLOCA_H=0A= #include =0A= #endif=0A= +#ifdef __CYGWIN__=0A= +#define alloca __builtin_alloca=0A= +#endif=0A= =0A= #include =0A= #include =0A= Index: java/util/natGregorianCalendar.cc=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/gcc/gcc/libjava/java/util/natGregorianCalendar.cc,v=0A= retrieving revision 1.8=0A= diff -u -p -r1.8 natGregorianCalendar.cc=0A= --- natGregorianCalendar.cc 2000/12/28 05:55:56 1.8=0A= +++ natGregorianCalendar.cc 2001/04/16 06:27:16=0A= @@ -41,7 +41,11 @@ java::util::GregorianCalendar::computeTi=0A= #if defined (STRUCT_TM_HAS_GMTOFF)=0A= t -=3D tim.tm_gmtoff;=0A= #elif defined (HAVE_TIMEZONE)=0A= +#ifdef __CYGWIN__=0A= + t +=3D _timezone;=0A= +#else=0A= t +=3D timezone;=0A= +#endif /* CYGWIN */=0A= #endif=0A= // Adjust for milliseconds.=0A= time =3D t * (jlong) 1000 + elements(fields)[MILLISECOND];=0A= ------=_NextPart_000_024B_01C0C692.E23590A0--