problem create shared dll and -shared option
Craig A. Vanderborgh
craigv@voxware.com
Thu Mar 27 17:21:00 GMT 2003
Sure, first here is the output of "make -n" for the build:
zetar% make -n
make config=dbgthreads -f Makecommon HelloWorld.dll
make[1]: Entering directory `/a/zetar/craigv/sarmwinceb/vbx/src/jnidll'
arm-wince-pe-gcc -c -I/usr/local/include/java
-I/usr/local/include/java/win32 -I -march=armv4 -DSARM -DWIN32
-DNEWLIB -DGNUWINCE -DALIGN64 -DLITENDIAN -DARM -D_ARM_ -fno-exceptions
-O0 -DDEBUG -Dpthreads -D_MT HelloWorld.cc
arm-wince-pe-ld -s --dll --subsystem wince:3.00 -e _DllMain --base-file
HelloWorld.base -o HelloWorld.dll HelloWorld.o
-L/a/zetar/craigv/sarmwinceb/lib -L/usr/local/wince/arm-wince-pe/lib
-L/usr/local/wince/lib/gcc-lib/arm-wince-pe/3.2 -lsupc++ -lm -lc
-lwinsock -lcoredll -lgcc
arm-wince-pe-dlltool --verbose -dllname HelloWorld.dll --def
HelloWorld.def --base-file HelloWorld.base --output-exp HelloWorld.exp
arm-wince-pe-ld -s --dll --subsystem wince:3.00 -e _DllMain --base-file
HelloWorld.base HelloWorld.exp -o HelloWorld.dll HelloWorld.o
-L/a/zetar/craigv/sarmwinceb/lib -L/usr/local/wince/arm-wince-pe/lib
-L/usr/local/wince/lib/gcc-lib/arm-wince-pe/3.2 -lsupc++ -lm -lc
-lwinsock -lcoredll -lgcc
arm-wince-pe-dlltool --verbose --dllname HelloWorld.dll --def
HelloWorld.def --base-file HelloWorld.base --output-exp HelloWorld.exp
arm-wince-pe-ld -M --dll --subsystem wince:3.00 -e _DllMain
HelloWorld.exp -o HelloWorld.dll HelloWorld.o
-L/a/zetar/craigv/sarmwinceb/lib -L/usr/local/wince/arm-wince-pe/lib
-L/usr/local/wince/lib/gcc-lib/arm-wince-pe/3.2 -lsupc++ -lm -lc
-lwinsock -lcoredll -lgcc > map 2>&1
make[1]: Leaving directory `/a/zetar/craigv/sarmwinceb/vbx/src/jnidll'
Second I have attached an updated archive for gnuwince-jnidll.tar.bz2.
I didn't realize it, but the example was a little bit out of date -
we're using "newlib" for the C runtime these days. The new version of
the example reflects this difference, and includes the link map and the
HelloWorld.base file that you're interested in.
We had to do a fair amount of work to get GCC working properly for the
arm-wince-pe target. It sounds like your configuration may not be
"quite there" yet.. Let me know if I can help. By the way, what
exactly *is* your target platform anyhow? Are you running wince?
craig
On Wed, 2003-03-26 at 21:18, longchuan wrote:
> Hi craig:
> Firstly, i want to say thanks to you and Kai Ruottu.
>
> I think the key point is the .base.
> Documents said that this file contains relocation info and is
> generated by ld.exe. I have try your 5 step after compiled .cc file,
> but my arm-pe gcc seems doesn't create such base file, just create a
> file with the expected name but zero size at step 1. This also happen to
> my mingw32 win32 target gcc.
>
> So I wonder if is only meaningful for arm-wince-pe target?
>
> By the way, dlltool create export file for dll does contain relocation
> info, i assume
> this by objdump -x xxx.exp, the header information said it HAS_RELOC,
> HAS_DEBUG, HAS_SYMS, HAS_LOCALS
> why this .base file necessary? seemed that ld strip such info by
> default.
>
> Could you copy and paste the output of "make -n"?
> you know , i working under win2k, i try to run make
> script from cygwin but some macro is not expended,
> i wonder if there is any special option of ld to create .base file.
> this is the actual command line i run for step 1.
> ld --dll --subsystem console --base-file helloworld.base -o
> helloworld.dll HelloWorld.o
> you know, get a zero size file helloworld.base. :((
>
> Any ideas?
>
> Meanwhile , i would download and run wince-pe toolchain on Linux
> to see what is going on.
>
> regards
> wreckor
>
> > -----Original Message-----
> > From: Craig A. Vanderborgh [mailto:craigv@voxware.com]
> > Sent: Wednesday, March 26, 2003 22:34
> > To: longchuan
> > Cc: crossgcc@sources.redhat.com
> > Subject: Re: problem create shared dll and -shared option
> >
> >
> > Hello,
> >
> > We got dll's using GCC compiled with arm-wince-pe working last year.
> > The main trick is that the "-shared" option does not work
> > correctly for the arm-wince-pe target. With the help of Kai
> > Ruotto (on crossgcc) we arrived at the conclusion that a
> > special 5 step linking process is required to create dll's
> > with the relocations done properly on arm-wince-pe.
> >
> > I have attached an example (with an all-important
> > "project.mk") that shows you how to do the link so that the
> > result will run on wince. This example creates a "Hello
> > World" type of thing that can function as a JNI component for
> > java. We hope this helps you.
> >
> > Also, a fully operational toolchain for arm-wince-pe
> > (gcc-3.2/binutils2.13) is available "ready-to-run" for
> > x86linux (RedHat 7.1+). Just make sure you have "-march" set
> > for your platform. You can get the toolchain from this url:
> >
> > http://www.atomiser.org/open_source_wince/wincegcc031303.tar.bz2
> >
> > This toolchain will build an operational dll from the sources
> > I've attached.
> >
> > regards,
> > craig vanderborgh
> > voxware incorporated
> >
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list