This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: IBM's Jikes Java Compiler on Cygwin b20.1
- To: Stipe Tolj <tolj at uni-duesseldorf dot de>
- Subject: Re: IBM's Jikes Java Compiler on Cygwin b20.1
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Fri, 25 Dec 1998 19:30:33 -0600 (CST)
- cc: GNU-Win32 <gnu-win32 at cygnus dot com>
On Thu, 24 Dec 1998, Stipe Tolj wrote:
> (note: long.o had to be compiled using b19.3 since I'm getting an
> internal compiler error using b20.1)
Or use the workaround I had sent you. I recommend not mixing b19 and
b20.x compilers (unless you use egcs for both of course).
> ...
> ld -L. -o jikes.exe jikes.o scanner.o code.o zip.o unzip.o ast.o
> diagnose.o parser.o lpginput.o lcase.o javaact.o error.o set.o symbol.o
> lookup.o depend.o stream.o op.o control.o modifier.o system.o bytecode.o
> body.o decl.o definite.o dump.o expr.o getclass.o init.o double.o
> config.o option.o incrmnt.o case.o long.o -lstdc++ -lgcc -lcrtdll
> -lcygwin -lkernel32
> ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to
> 00401000
Yikes! Why are you using "ld" to link! You're missing the startup files,
and the program crashes and it has every right to. Also, why are you
linking with CRTDLL for a Cygwin app (if it's to get the wcscpy etc,
it's the wrong way to do it)! Never mix Cygwin and MS runtime DLLs.
I'm attaching my trivial patch for Jikes, so you can just type 'make'.
It also enables wide char versions of stuff from config.cpp when
__CYGWIN__ is defined.
Regards,
Mumit
--- Makefile.~1 Fri Dec 25 18:50:26 1998
+++ Makefile Fri Dec 25 18:57:38 1998
@@ -131,6 +131,22 @@ LDFLAGS=-L. -o$(EXECUTABLE)
O=o
SYSOBJECTS=
+# g++ definitions (Cygwin b20.1)
+CC=g++
+# use -W to see warnings (should review from time to time)
+CCREQUIREDFLAGS=-DUNIX -funsigned-char -c -DTYPE_bool -ansi
+CCDEBUGFLAGS=-DTEST -g
+CCOPTFLAGS=-O
+CCFLAGS=$(CCREQUIREDFLAGS) $(CCDEBUGFLAGS)
+CCFLAGS=$(CCREQUIREDFLAGS) $(CCOPTFLAGS)
+ERASE=rm -f
+EXECUTABLE=jikes.exe
+LD=g++
+LDDEBUGFLAGS=-g
+LDFLAGS=-L. -o$(EXECUTABLE)
+O=o
+SYSOBJECTS=
+
OBJECTS=jikes.$(O) scanner.$(O) code.$(O) zip.$(O) unzip.$(O) ast.$(O) diagnose.$(O) \
parser.$(O) lpginput.$(O) lcase.$(O) javaact.$(O) error.$(O) set.$(O) symbol.$(O) \
--- config.cpp.~1 Fri Dec 25 19:17:20 1998
+++ config.cpp Fri Dec 25 19:19:26 1998
@@ -280,7 +280,7 @@ char StringConstant::U8S_B[] = {U_B,U_NU
#endif
-#if defined(GNU_LIBC5)
+#if defined(GNU_LIBC5) || defined(__CYGWIN__)
#include <sys/stat.h>
#ifndef UNIX
int SystemMkdir(char *dirname)
@@ -288,6 +288,7 @@ char StringConstant::U8S_B[] = {U_B,U_NU
return mkdir(dirname, S_IRWXU);
}
#endif
+extern "C" {
size_t wcslen(wchar_t *cs)
{
int n = 0;
@@ -350,6 +351,7 @@ char StringConstant::U8S_B[] = {U_B,U_NU
return (n <= 0 || *cs == *ct ? 0 : (*cs < *ct ? -1 : 1));
}
+} // extern "C"
#elif WIN32_FILE_SYSTEM
#include <direct.h>
int SystemMkdir(char *dirname)