Compiling rxtx with gcj
roychris@free.fr
roychris@free.fr
Thu Sep 22 10:38:00 GMT 2005
Quoting Andrew Haley <aph@redhat.com>:
> roychris@free.fr writes:
> > I compiled the libraries without optimisation.
> > I run the program with gdb with a breakpoint just before the seg fault :
> >
> > Starting program: /home/fbr/rxtx-2.1-6/test
> > [Thread debugging using libthread_db enabled]
> > [New Thread -1228843328 (LWP 15033)]
> > [New Thread -1229452368 (LWP 15034)]
> > RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0
> > Found port: /dev/ttyS0
> > [New Thread -1238045776 (LWP 15035)]
> > [New Thread -1246434384 (LWP 15036)]
> > [Switching to Thread -1238045776 (LWP 15035)]
> >
> > Breakpoint 1, report_serial_events (eis=0xb634e1c8) at
> > /home/fbr/rxtx-2.1-6/src/SerialImp.c:3570
> > 3570 if(!send_event( eis, SPE_DATA_AVAILABLE, 1 ))
> > (gdb) step
> > send_event (env=0xb634e1c8, jobj=0x1, type=1, flag=-1227867629) at
> > /home/fbr/rxtx-2.1-6/src/ParallelImp.c:797
> > 797 jclass jclazz = (*env)->GetObjectClass( env, jobj );
> >
> > I really don't understand why when SerialImp.c call send_event
> method it's the
> > ParallelImp.c one that is called. They don't have the same number of
> > argument !
> > The good send_event method in this context is at line 4430 in SerialImp.c .
> > I tried to declare the two functions (in ParallelImp.c and
> SerialImp.c) static
> > and I have the same problem in another function :
>> This doesn't seem to make sense. Your JNI programs seem to be written
> in C, and C doesn't have methods. C only has functions, and if you
> have multiple functions called send_event then the shared library
> loader will call the first function it finds that has the same name.
> It doesn't prefer the function that is in the same file as the
> caller.
>> I can't imagine what is supposed to happen here. Can you just remove
> SerialImp.c or ParallelImp.c?
>> Andrew.
>
Ok, I know what you mean. I mustn't have two functions with the same
name in my
librairies. If I remove the librairies where there is send_event it may work.
But how the jvm (sun or kaffe) does ? It uses these librairies when I make a
call to a serial port and how it knows which one to use ?
How can I do to compile this driver with gcj and to resolve this calls ?
More information about the Java
mailing list