public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: dll, java, gcc, cygwin
@ 1998-10-23 23:07 Philip A. Larson
  1998-10-24 10:29 ` John A. Turner
  0 siblings, 1 reply; 14+ messages in thread
From: Philip A. Larson @ 1998-10-23 23:07 UTC (permalink / raw)
  To: 'Paul@Sunnyvale'; +Cc: gnu-win32

Paul, and others. 

I have the following problems when running Cygwin / Qub perl on my Windows 95 machine. Any ideas?

1.)  The BASH shell, indeed the whole bloody computer locks up if you try to run some DOS commands or programs.  The Cygwin FAQ talks about lock-ups with Ctrl-C and downloading a USB patch from OSR2, but I don't thinks it applies.
2.)  Same old problem with getting files to accept permission or ownership changes. Probably because their is no passwd file and when I run mkpasswd it can't find an export function in an API dll. I get affirmative reports when using the -v verbose flag. You have some control over the owner write property if you set the archive, and read only attributes in DOS mode.  Any directory or file ending in .exe, or .com, or .bat, or .pif gets a "x" in the owners permissions.
3.)  The "make test" functions don't work in the install directory on the Storable module I successfully compiled. They work fine if you go ahead and install it and then re-run the tests. 
4.)   "ansidecl.h" is missing from both Cygwin and Qub/perl.  I got one from an old egcs1-1b tar file I had.

Many Thanks,

Phil Larson




-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: dll, java, gcc, cygwin
@ 1998-10-28  0:40 Earnie Boyd
  1998-10-27 15:02 ` Mumit Khan
  1998-10-29  8:16 ` Glen Fullmer-EGF002
  0 siblings, 2 replies; 14+ messages in thread
From: Earnie Boyd @ 1998-10-28  0:40 UTC (permalink / raw)
  To: Glen Fullmer-EGF002, khan; +Cc: mickish, gnu-win32

Have you tried using the libmmalloc.a library that comes with the
cygwin package for your malloc and friends routines?  Note: that there
are two m's and is a Mapped Memory Allocation package.  This has
seemed to fix various other porters problems when I've suggested it.


---Glen Fullmer-EGF002 <Glen_Fullmer-EGF002@email.mot.com> wrote:
>
> Hi Mumit,
> 
> >>>>> "MK" == Mumit Khan <khan@xraylith.wisc.edu> writes:
> 
>    MK> Tried something similar, and sure enough, it crashed and
burned.
>    MK> getenv() probably calls something that calls malloc. If
malloc fails,
>    MK> the system is pretty much useless.
> 
> Yep, also just:
> 
>      char *mstr;
>      mstr = malloc(100);
> 
> fails, in the helloworld example.
>      
>    MK> Of course, everything seems to work when using mingw, but
then you
>    MK> lose the POSIX layer.
> 
> Yeah, we wouldn't want to do that. ;-)
> 
>    MK> problem must be due to some (bad) interaction of MSVC runtime
loaded
>    MK> by Java and Cygwin runtime loaded by the JNI dll.
> 
> Ok, but I don't understand.  So you are saying that Java might be
using a
> runtime library that is not compatible with the DLL library?
> 
> Thanks, 
> Glen
> -- 
> Glen Fullmer,(847)538-3082, Mail: <gfullmer@ccrl.mot.com>,
>  			    Web:  < http://www.enteract.com/~gfullmer >
>
**************************************************************************
> *  "For a successful technology, reality must take precedence       
    *
> *   over public relations, for Nature cannot be fooled." - R. P.
Feynman *
>
**************************************************************************
> -
> For help on using this list (especially unsubscribing), send a
message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
> 

==
-                  \\||//
-------------o0O0--Earnie--0O0o--------------
--          earnie_boyd@yahoo.com          --
-- http://www.freeyellow.com/members5/gw32 --
----------------ooo0O--O0ooo-----------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <Pine.SUN.3.93.981026173739.25460B-100000@modi.xraylith.wisc.edu>]
* RE: dll, java, gcc, cygwin
@ 1998-10-25 20:17 Philip A. Larson
  0 siblings, 0 replies; 14+ messages in thread
From: Philip A. Larson @ 1998-10-25 20:17 UTC (permalink / raw)
  To: gnu-win32, 'John A. Turner'

Hey! That worked.

Sometimes it just takes a little push.

Thanks,

Phil

----------
From:  John A. Turner[SMTP:John.Turner@pobox.com]
Sent:  Saturday, October 24, 1998 1:29 PM
To:  gnu-win32@cygnus.com
Subject:  Re: dll, java, gcc, cygwin

"Philip A. Larson" wrote:
> 
> Paul, and others.
> 
> I have the following problems when running Cygwin / Qub perl on my Windows 95 machine. Any ideas?
> 
> 1.)  The BASH shell, indeed the whole bloody computer locks up if you try to run some DOS commands or programs.  The Cygwin FAQ talks about lock-ups with Ctrl-C and downloading a USB patch from OSR2, but I don't thinks it applies.

Don't be so sure.  I had consistent, repeatable lockups under 95 until I
applied the USB patch.

Thankfully, I no longer use that godforsaken OS with Cygwin.  Now I only
use Cygwin on NT (which is slightly less godforsaken).

--
John A. Turner
Blue Sky | VIFX    - http://www.blueskystudios.com/
Los Alamos Nat Lab - http://www.lanl.gov/home/turner/
Personal           - http://john.turner.org/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: dll, java, gcc, cygwin
@ 1998-10-25  6:39 Earnie Boyd
  1998-10-25  9:45 ` Mumit Khan
  0 siblings, 1 reply; 14+ messages in thread
From: Earnie Boyd @ 1998-10-25  6:39 UTC (permalink / raw)
  To: Mumit Khan, Andrew Mickish; +Cc: Glen Fullmer-EGF002, gnu-win32

---Mumit Khan <khan@xraylith.wisc.edu> wrote:
>
> On Thu, 22 Oct 1998, Andrew Mickish wrote:
> 
> > It might be related to name mangling.  Try adding .def aliases in
your larger
> > example.  I have to supply aliases in a .def file like the
following for every native
> > method I export from the DLL:
> > 
> >      EXPORTS
> >     
Java_HelloWorld_displayHelloWorld=Java_HelloWorld_displayHelloWorld@8
> >      dll_entry@12
> > 
> 
> Here's a proposal: how about I add a --add-stdcall-alias to dlltool
which
> essentially produce the following:
> 
>       EXPORTS
>      
Java_HelloWorld_displayHelloWorld=Java_HelloWorld_displayHelloWorld@8
>       Java_HelloWorld_displayHelloWorld@8
> 
> When creating .def file using ``dlltool --output-def''. Would this
solve 
> the problem? Note that I'm keeping the original symbol as well, but
we 
> could always get rid of that too.
> 

Please, group them together for ease of spliting the file, i.e.:

ThisFunc=ThisFunc@8
ThatFunc=ThatFunc@8
ThisFunc@8
ThatFunc@8


==
-                  \\||//
-------------o0O0--Earnie--0O0o--------------
--          earnie_boyd@yahoo.com          --
-- http://www.freeyellow.com/members5/gw32 --
----------------ooo0O--O0ooo-----------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 14+ messages in thread
* dll, java, gcc, cygwin
@ 1998-10-21 10:06 Glen Fullmer-EGF002
  1998-10-23  0:05 ` Andrew Mickish
  1998-10-23  6:03 ` Mumit Khan
  0 siblings, 2 replies; 14+ messages in thread
From: Glen Fullmer-EGF002 @ 1998-10-21 10:06 UTC (permalink / raw)
  To: gnu-win32

Hi,

I thought others might be interested in this letter I sent to Mumit:
-----
I tried using your dllwrap tool and method to create the JNI HelloWorld
example and it failed as it couldn't find the native routine in the library,
whereas Andrew Mickish's method:
	
	http://www.andrew.cmu.edu/~am2q/HelloWorld.zip 

worked fine for the HelloWorld code. Looking at the code I can't see any
glaring differences.  His makefile uses the loader/dlltool/loader/dlltool
method.  I tried using Andrew's example on a larger piece of code and it
behaves the same as yours, i.e. the library loads but it can't find the
routines within the library.  Perhaps his can only load one routine?  ;-)
Any hints?

My environment is:

   Windows/NT on a dual processor pentium.  
   gcc -v = egcs-2.91.57 19980901 (egcs-1.1 release) (cygwin - B19)
   binutils (2.7-B19)
   dllhelpers-0.2.1

I had to set DLL_LDFLAGS = -Wl,-e,_dll_entry@12 to avoid errors.

Your dllwrap method failed with:

============================Makefile================================

.SUFFIXES:	.java
.SUFFIXES:	.class

DLL_OBJS = HelloWorldImp.o 

DLL_NAME = hello.dll
DLL_EXP_DEF = hello.def
DLL_EXP_LIB = libhello.a
DLLWRAP = dllwrap
DLLTOOL = dlltool

JAVA_HOME=/jdk1.1.6

# Java Files
JSRCS = HelloWorld.java Main.java

JLIBBIN = HelloWorldImp.o

JOBS=$(JSRCS:.java=.class)

DLLWRAP_FLAGS = --driver-name $(CC) --def $(DLL_EXP_DEF)
DLL_CFLAGS = -DBUILDING_DLL=1

# The default entry point defined by dllwrap is DllMain defined in 
# dllinit.c. You can override that here by specifying it in DLL_LDFLAGS.
# (eg., -Wl,-e,_MyDllMain@12 -- note the leading underscore and the
# trailing @12).
DLL_LDFLAGS = -Wl,-e,_dll_entry@12

all:	$(DLL_NAME) $(JOBS) $(JLIBBIN)

$(DLL_NAME):	$(DLL_OBJS) $(DLL_EXP_DEF)
	$(DLLWRAP) $(DLLWRAP_FLAGS) -o $(DLL_NAME) \
	   $(DLL_OBJS) $(DLL_LDFLAGS) $(DLL_LDLIBS)

$(DLL_EXP_LIB): $(DLL_EXP_DEF)
	$(DLLTOOL) --dllname $(DLL_NAME) --def $(DLL_EXP_DEF) \
		--oubput-lib $(DLL_EXP_LIB)
$(DLL_EXP_DEF): $(DLL_OBJS)
	$(DLLTOOL) --export-all --output-def $@ $(DLL_OBJS)

HelloWorldImp.o: HelloWorldImp.c HelloWorld.h
	gcc -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32 -c HelloWorldImp.c

.java.class:
	$(JAVA_HOME)/bin/javac $*.java

HelloWorld.h: HelloWorld.class
	$(JAVA_HOME)/bin/javah HelloWorld

clean:
	rm -f *.class *.o core hello.dll* 

==============================HelloWorld.java============================
class HelloWorld {
  public native void displayHelloWorld();
  
  static {
    System.loadLibrary("hello");
  }
}

==============================HelloWorldImp.c============================
/* following for PC port */
#define __int64 long  

#include <jni.h>
#include "HelloWorld.h"
#include <stdio.h>

JNIEXPORT void JNICALL 
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj) 
{
  printf("Hello world!\n");
  return;
}
==============================Output=====================================
/jdk1.1.6/bin/javac HelloWorld.java
/jdk1.1.6/bin/javah HelloWorld
gcc -I/jdk1.1.6/include -I/jdk1.1.6/include/win32 -c HelloWorldImp.c
dlltool --export-all --output-def hello.def HelloWorldImp.o 
dllwrap --driver-name gcc --def hello.def -o hello.dll \
   HelloWorldImp.o  -Wl,-e,_dll_entry@12 
/jdk1.1.6/bin/javac Main.java

/jdk1.1.6/bin/java Main
java.lang.UnsatisfiedLinkError: displayHelloWorld
				at Main.main(Main.java:3)

=========================================================================

Am I missing something here? (besides my sanity! ;-)

Thanks,

Glen
-- 
Glen Fullmer,(847)538-3082, Mail: <gfullmer@ccrl.mot.com>,
*******************************************************************************
*  "For a successful technology, reality must take precedence                 *
*   over public relations, for Nature cannot be fooled." - Richard P. Feynman *
*******************************************************************************

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1998-10-29  8:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-23 23:07 dll, java, gcc, cygwin Philip A. Larson
1998-10-24 10:29 ` John A. Turner
  -- strict thread matches above, loose matches on Subject: below --
1998-10-28  0:40 Earnie Boyd
1998-10-27 15:02 ` Mumit Khan
1998-10-29  8:16 ` Glen Fullmer-EGF002
     [not found] <Pine.SUN.3.93.981026173739.25460B-100000@modi.xraylith.wisc.edu>
1998-10-26 16:05 ` Glen Fullmer-EGF002
1998-10-25 20:17 Philip A. Larson
1998-10-25  6:39 Earnie Boyd
1998-10-25  9:45 ` Mumit Khan
1998-10-21 10:06 Glen Fullmer-EGF002
1998-10-23  0:05 ` Andrew Mickish
1998-10-24 14:15   ` Mumit Khan
1998-10-23  6:03 ` Mumit Khan
1998-10-24  3:21   ` Glen Fullmer-EGF002

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).