This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

Building non-cygwin DLL with cyg-gcc


I am trying to build a project that was written using MSVC.  I'm starting with
a basic DLL.  Compiling the .c file with gcc blew chunks but -mno-cygwin got
it to compile.  Now I'm having problems linking.

There seem to be two methods of building DLLs, the User Guide method 
(invoke dlltool multiple times) and the recent Mailing List method (use
the undocumented --output-implib ld switch).  If I do the ML method, I get

  > gcc -Wl,--out-implib,file.a -shared -o file.dll file.o
  Cannot export _bss_end__: symbol not defined
  Cannot export _bss_start__: symbol not defined
  Cannot export _data_end__: symbol not defined
  Cannot export _data_start__: symbol not defined
  Creating library file: Packet.a
  collect2: ld returned 1 exit status
  make: *** [main] Error 1

And of course, this makes sense because ld seems to be trying to export all
symbols.  I have my own .def file with the desired exports listed, but I can't
figure out how to get ld to use it.  It seems like ld has no equivalent of
the --def switch of dlltool (shown in the UG method).

Is it possible to get ld to reference an exports file using the ML method?  If
not, what's the recommended method for building a non-cygwin DLL using cyg gcc?

BTW, I still can't figure out the difference between mingw, w32api, and
-mno-cygwin.  I assume they're all different pieces of the same codebase.

Thanks,
Nate

Tool versions
gcc version gcc-2.95.2-9 19991024 (cygwin experimental)
GNU ld version 2.10.91 (with BFD 2.10.91)
GNU dlltool 2.10.91


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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