This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgcj.dll on MinGW


Danny Smith wrote:

> Native windows exe's (including ld.exe  built by mingw) don't understand
> symlinks.. What actually did native ld say when you gave it a symlink.
> cygwin1.dll dependent exes can use  symlinks

When I copied the native gcc over to my windows machine from my Linux
build box, the symlinks were dereferenced.  This had the result of making
libgcj.dll.a be an actual copy of the dll instead of a link.  While messy,
this actually saves space since the import library was occupying about
40MB whereas the dll occupies 20 or so.

> Relying on --enable-auto-export and --enable-runtime-pseudo-reloc can be
> dangerous, if you are importing read-only data structures, but it sounds
> like
> you've been lucky so far
> Search the cygwin mailing list archives for some discussion of this issue

I think that is --enable-auto-import, right?  Anyway, using heuristics to
determine linker symbol mappings never quite felt right to me.  I think
the real answer lies deeper in the bowels of gcj.  However, even
addressing those issues appropriately requires a working dll build
environment, since the fix will need to be done at compile time and will
necessarily involve the gcj compiler taking action based on compiler flags
indicating a dll build.  I'm ok putting a little weight on the linker
heuristics as a stepping stone to fixing the real root problems.

> Use dlltool  --export-all --output-def,libgcj.def libgcj0_convenience.a
> This will also mark DATA symbols
>
> Actually, why do you need a def file anyway?
I was originally banging my head on the wall because it seemed that the
-Wl,--export-all-symbols option to the linker was not working.  The
resulting dll was only exporting a handful of symbols from libffi and
libltdl.  I think the issue is that during a full shared build of gcc,
these libraries are compiling appropriately with the __declspec(dllexport)
attributes.  The notes in the linker documentation state that if it finds
even a single symbol with this attribute, it will disable auto exporting
of all symbols.  It seemed that the only way to override this was to
generate a def file containing all of the wanted exports.

TJ


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]