* mingw32 gcj compile failure and possible patch
@ 2002-04-02 5:48 aking
2002-04-02 10:53 ` Adam Megacz
0 siblings, 1 reply; 10+ messages in thread
From: aking @ 2002-04-02 5:48 UTC (permalink / raw)
To: java
This is my first attempted patch, so please be gentle :)
Without the attached (timy) patch, I am unable to compile and execute a
simple 'hello world' program with the mingw32 port. Unfortunately, I am
much more of a java coder than a C programmer, so I'm not sure if it's a
correct patch or not.
Here's the gcj output without the patch:
aking@nanostorm:~/gcj-test$ i686-pc-mingw32-gcj --main=HelloWorld -o hello.exe
HelloWorld.java
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(win32.o):
In function `Z26_Jv_platform_close_on_execi':
/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/include/platform.h:25:
multiple definition of `_Jv_platform_close_on_exec(int)'
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(prims.o)(.text+0x0):/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/../../../gcc/libjava/prims.cc:
first defined here
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(natSystem.o):
In function
`Z34_Jv_GetArrayElementFromElementTypePN4java4lang6ObjectEPNS0_5ClassE':
/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/../../../gcc/libjava/gcj/cni.h(.text+0x0):
multiple definition of `_Jv_platform_close_on_exec(int)'
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(prims.o)(.text+0x0):/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/../../../gcc/libjava/prims.cc:
first defined here
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(natPlainSocketImpl.o):
In function `Z26_Jv_platform_close_on_execi':
/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/include/platform.h:25:
multiple definition of `_Jv_platform_close_on_exec(int)'
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(prims.o)(.text+0x0):/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/../../../gcc/libjava/prims.cc:
first defined here
aking@nanostorm:~/gcj-test$
With the patch, the java program compiles and runs fine under Windows ME.
The patch:
*** gcc-3.1-branch/libjava/include/win32.h Sun Mar 10 13:00:04 2002
--- mingw-gcj/gcc/libjava/include/win32.h Mon Apr 1 22:21:36 2002
*************** details. */
*** 21,27 ****
extern void _Jv_platform_initialize (void);
extern jlong _Jv_platform_gettimeofday ();
! void _Jv_platform_close_on_exec (jint)
{
// Ignore.
}
--- 21,27 ----
extern void _Jv_platform_initialize (void);
extern jlong _Jv_platform_gettimeofday ();
! inline void _Jv_platform_close_on_exec (jint)
{
// Ignore.
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-02 5:48 mingw32 gcj compile failure and possible patch aking
@ 2002-04-02 10:53 ` Adam Megacz
2002-04-03 10:38 ` Frank Jacobs
0 siblings, 1 reply; 10+ messages in thread
From: Adam Megacz @ 2002-04-02 10:53 UTC (permalink / raw)
To: aking; +Cc: java
Thank you for the patch! I took the opportunity to clean up the
formatting on that function, and will apply it as shown below
(branch+trunk) as soon as it finishes building.
- a
Index: win32.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/win32.h,v
retrieving revision 1.3.8.2
diff -u -r1.3.8.2 win32.h
--- win32.h2002/03/10 18:00:041.3.8.2
+++ win32.h2002/04/02 18:48:24
@@ -21,7 +21,8 @@
extern void _Jv_platform_initialize (void);
extern jlong _Jv_platform_gettimeofday ();
-void _Jv_platform_close_on_exec (jint)
+inline void
+_Jv_platform_close_on_exec (jint)
{
// Ignore.
}
--
The web is dead; long live the Internet.
http://www.xwt.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-02 10:53 ` Adam Megacz
@ 2002-04-03 10:38 ` Frank Jacobs
2002-04-03 12:14 ` aking
2002-04-04 14:21 ` Adam Megacz
0 siblings, 2 replies; 10+ messages in thread
From: Frank Jacobs @ 2002-04-03 10:38 UTC (permalink / raw)
To: java
Thanks for sending out the patch! I finally got a GCJ
Linux->Win32 cross compiler working last night; it
almost brought tears to my eyes. ;-)
I have a question about executable size. When I tried
the standard Hello, World application, my resulting
executable was 10 MB. Any ideas as to why this may be?
I've read through the Cross Compiler FAQ, but couldn't
find any hints on this.
FYI, I configured and built the compiler using a
script posted by Adam in January. I modified it to
remove the patches in it, but it is basically the
same. See
http://gcc.gnu.org/ml/java/2002-01/msg00454.html for
Adam's original script.
Thanks a bunch -- I'm very much a beginner when it
comes to cross compilers, so my apologies if there is
an easy answer to this one.
--- Adam Megacz <gcj@lists.megacz.com> wrote:
>
> Thank you for the patch! I took the opportunity to
> clean up the
> formatting on that function, and will apply it as
> shown below
> (branch+trunk) as soon as it finishes building.
>
> - a
>
> Index: win32.h
>
===================================================================
> RCS file: /cvs/gcc/gcc/libjava/include/win32.h,v
> retrieving revision 1.3.8.2
> diff -u -r1.3.8.2 win32.h
> --- win32.h2002/03/10 18:00:041.3.8.2
> +++ win32.h2002/04/02 18:48:24
> @@ -21,7 +21,8 @@
> extern void _Jv_platform_initialize (void);
> extern jlong _Jv_platform_gettimeofday ();
>
> -void _Jv_platform_close_on_exec (jint)
> +inline void
> +_Jv_platform_close_on_exec (jint)
> {
> // Ignore.
> }
>
> --
> The web is dead; long live the Internet.
> http://www.xwt.org/
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-03 10:38 ` Frank Jacobs
@ 2002-04-03 12:14 ` aking
2002-04-05 14:42 ` Adam Megacz
2002-04-04 14:21 ` Adam Megacz
1 sibling, 1 reply; 10+ messages in thread
From: aking @ 2002-04-03 12:14 UTC (permalink / raw)
To: Frank Jacobs; +Cc: java
On Wed, Apr 03, 2002 at 10:23:11AM -0800, Frank Jacobs wrote:
> I have a question about executable size. When I tried
> the standard Hello, World application, my resulting
> executable was 10 MB.
Just strip it:
aking@nanostorm:~/gcj-test$ i686-pc-mingw32-gcj --main=HelloWorld -o hello.exe HelloWorld.java
aking@nanostorm:~/gcj-test$ ls -al hello.exe
-rwxr-xr-x 1 aking users 10824061 Apr 3 14:17 hello.exe*
aking@nanostorm:~/gcj-test$ strip hello.exe
aking@nanostorm:~/gcj-test$ ls -al hello.exe
-rwxr-xr-x 1 aking users 1208320 Apr 3 14:17 hello.exe*
There now seems to be an exception when compiling java code that uses
exceptions:
aking@nanostorm:~/gcj-test$ i686-pc-mingw32-gcj --main=GCJTest -o gcjtest GCJTest.java
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(exception.o): In function `abort':
/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/../../../gcc/libjava/exception.cc:27: multiple definition of `abort'
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libmsvcrt.a(ds00510.o)(.text+0x0): first defined here
I was hoping Adam M. would have a chance to look at this error, but
if not, I'll try and track it down this evening. The java code
is at the end.
Adam K
public class GCJTest
{
public static void main( String[] args )
{
try
{
Thread.sleep( 2000 );
}
catch( Exception e )
{
}
}
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-03 10:38 ` Frank Jacobs
2002-04-03 12:14 ` aking
@ 2002-04-04 14:21 ` Adam Megacz
2002-04-05 7:08 ` Frank Jacobs
1 sibling, 1 reply; 10+ messages in thread
From: Adam Megacz @ 2002-04-04 14:21 UTC (permalink / raw)
To: null11x; +Cc: java
Frank Jacobs <forkjake@yahoo.com> writes:
> I have a question about executable size. When I tried the standard
> Hello, World application, my resulting executable was 10 MB.
If you strip it, it should go down to 3MB.
I'll be releasing gump (GCJ Unreachable Method Pruner) in a few weeks,
which should bring it down below a meg (209kb gzipped is my record so
far, but I know I can do even better than that).
- a
--
The web is dead; long live the Internet.
http://www.xwt.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-04 14:21 ` Adam Megacz
@ 2002-04-05 7:08 ` Frank Jacobs
0 siblings, 0 replies; 10+ messages in thread
From: Frank Jacobs @ 2002-04-05 7:08 UTC (permalink / raw)
To: java
gump -- that'll be really cool!!!
--- Adam Megacz <gcj@lists.megacz.com> wrote:
>
> Frank Jacobs <forkjake@yahoo.com> writes:
> > I have a question about executable size. When I
> tried the standard
> > Hello, World application, my resulting executable
> was 10 MB.
>
> If you strip it, it should go down to 3MB.
>
> I'll be releasing gump (GCJ Unreachable Method
> Pruner) in a few weeks,
> which should bring it down below a meg (209kb
> gzipped is my record so
> far, but I know I can do even better than that).
>
> - a
>
> --
> The web is dead; long live the Internet.
> http://www.xwt.org/
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-03 12:14 ` aking
@ 2002-04-05 14:42 ` Adam Megacz
2002-04-05 20:21 ` Adam Megacz
0 siblings, 1 reply; 10+ messages in thread
From: Adam Megacz @ 2002-04-05 14:42 UTC (permalink / raw)
To: aking; +Cc: Frank Jacobs, java
aking@dreammechanics.com writes:
> I was hoping Adam M. would have a chance to look at this error, but
It should be fixed now -- could you try again?
2002-04-04 Adam Megacz <adam@xwt.org>
* include/win32.h (_Jv_platform_close_on_exec): added inline
modifier.
- a
--
The web is dead; long live the Internet.
http://www.xwt.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-05 14:42 ` Adam Megacz
@ 2002-04-05 20:21 ` Adam Megacz
2002-04-05 22:10 ` aking
0 siblings, 1 reply; 10+ messages in thread
From: Adam Megacz @ 2002-04-05 20:21 UTC (permalink / raw)
To: aking; +Cc: Frank Jacobs, java
Adam Megacz <gcj@lists.megacz.com> writes:
> aking@dreammechanics.com writes:
> > I was hoping Adam M. would have a chance to look at this error, but
> It should be fixed now -- could you try again?
Er, that fix was for a differnt problem. Here's the fix for your
problem. Could you cvs update and try again?
- a
2002-04-05 Adam Megacz <adam@xwt.org>
* exception.cc (abort): added static modifier
Index: exception.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/exception.cc,v
retrieving revision 1.20
diff -u -r1.20 exception.cc
--- exception.cc 2002/02/13 00:29:42 1.20
+++ exception.cc 2002/04/06 04:17:54
@@ -23,7 +23,8 @@
// stdlib.h's abort().
namespace std
{
- __attribute__ ((__noreturn__)) void abort ()
+ static __attribute__ ((__noreturn__)) void
+ abort ()
{
::abort ();
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-05 20:21 ` Adam Megacz
@ 2002-04-05 22:10 ` aking
2002-04-06 6:33 ` Bryce McKinlay
0 siblings, 1 reply; 10+ messages in thread
From: aking @ 2002-04-05 22:10 UTC (permalink / raw)
To: Adam Megacz; +Cc: java
On Fri, Apr 05, 2002 at 08:16:04PM -0800, Adam Megacz wrote:
>
> Adam Megacz <gcj@lists.megacz.com> writes:
> > aking@dreammechanics.com writes:
> > > I was hoping Adam M. would have a chance to look at this error, but
>
> > It should be fixed now -- could you try again?
>
> Er, that fix was for a differnt problem. Here's the fix for your
> problem. Could you cvs update and try again?
>
Strange.. I just did an update, but I'm not seeing this patch
in exception.cc. Is the cvs server I'm using some kind of mirror?
It's subversions.gnu.org:/cvsroot/gcc
Anyways, I applied your patch manually and it does indeed
fix the link error. Thanks!
Adam
> 2002-04-05 Adam Megacz <adam@xwt.org>
>
> * exception.cc (abort): added static modifier
>
> Index: exception.cc
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/exception.cc,v
> retrieving revision 1.20
> diff -u -r1.20 exception.cc
> --- exception.cc 2002/02/13 00:29:42 1.20
> +++ exception.cc 2002/04/06 04:17:54
> @@ -23,7 +23,8 @@
> // stdlib.h's abort().
> namespace std
> {
> - __attribute__ ((__noreturn__)) void abort ()
> + static __attribute__ ((__noreturn__)) void
> + abort ()
> {
> ::abort ();
> }
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mingw32 gcj compile failure and possible patch
2002-04-05 22:10 ` aking
@ 2002-04-06 6:33 ` Bryce McKinlay
0 siblings, 0 replies; 10+ messages in thread
From: Bryce McKinlay @ 2002-04-06 6:33 UTC (permalink / raw)
To: aking; +Cc: Adam Megacz, java
aking@dreammechanics.com wrote:
>Strange.. I just did an update, but I'm not seeing this patch
>in exception.cc. Is the cvs server I'm using some kind of mirror?
>It's subversions.gnu.org:/cvsroot/gcc
>
Yes, the GCC CVS on subversions is a mirror which is updated once or
twice a day, I think. gcc.gnu.org is the primary repository but it tends
to be a lot slower, so please use subversions for anonymous CVS if
possible.
regards
Bryce.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2002-04-06 6:10 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-02 5:48 mingw32 gcj compile failure and possible patch aking
2002-04-02 10:53 ` Adam Megacz
2002-04-03 10:38 ` Frank Jacobs
2002-04-03 12:14 ` aking
2002-04-05 14:42 ` Adam Megacz
2002-04-05 20:21 ` Adam Megacz
2002-04-05 22:10 ` aking
2002-04-06 6:33 ` Bryce McKinlay
2002-04-04 14:21 ` Adam Megacz
2002-04-05 7:08 ` Frank Jacobs
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).