Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

How do you build a DLL with gcc? 2003 R3 SUA

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> How do you build a DLL with gcc? 2003 R3 SUA Page: [1]
Login
Message << Older Topic   Newer Topic >>
How do you build a DLL with gcc? 2003 R3 SUA - Feb. 23, '06, 4:07:56 PM   
rjnorman

 

Posts: 12
Joined: Jan. 27, '06,
Status: offline
I want to have a mainline module (this could be either Win32 or SUA) which loads a dll containing C functions that use the POSIX (aka SUA) API, but expose functions for later use. Then I want to load a Win32 DLL which will have calls to the functions in the POSIX (SUA) dll.
The small 'Help_and_ReleaseNotes" document talks about using link.exe to creat a .def file, but link.exe has no such function that I coud find. Also, even if I manually create a .def file, then what do a I do with it? gcc & ld do not seem to know anything about .def. I also tried using link.exe but then it has problems finding the POSIX function even when I also included libc.a for link.exe. I did not try libc.so with link.exe but I do not think link.exe would know what a .so is...

Can anyone give me more details specific examples for creating a dll using gcc (or cc or c89) and using a .def to define the entry points to the dll?

Thanks
Ron Norman
Post #: 1
RE: How do you build a DLL with gcc? 2003 R3 SUA - Feb. 26, '06, 12:10:59 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
I suggest that you look at the internals of the c89 script.
The "-R" option is what sets the mixed-mode compile and link.

There is not a "POSIX DLL" in the sense you are thinking of it.
The PSXDLL.DLL is a thin layer for the LPC calls from a process
to the Interix subsystem. All of the shared libraries with Interix/SUA
are Unix shared libraries -- not DLL's.

The general intent of the mixed mode is for a Unix/Interix program to
be making calls to the Win32 API's. Not the other way around. The resulting
binary is marked as Win32, but the whole thing can be fragile because you
are mixing the paradigms of two different OS's (Unix & Win32).

(in reply to rjnorman)
Post #: 2
RE: How do you build a DLL with gcc? 2003 R3 SUA - Jul. 11, '06, 2:08:37 AM   
RSanjay

 

Posts: 2
Joined: Apr. 27, '06,
Status: offline
If the objective is to build a dll which uses POSIX API's then SUA provide a mechanism of doing so but with limitation that this dll can make only SUA calls.

Man c89
-G
Create an SUA .dll file that exposes POSIX functionality to
other Windows process. Use in conjunction with the -B dll flag.
-B linkspec
Use the GNU linker, ld(1), instead of the Visual C linker. If the
argument linkspec is dynamic, the binary will be dynamically linked using ld.exe.
If it is static, the binary will be statically
linked (using link.exe itself). If the argument is
dll, the compiler will link to libc.dll (again with link.exe), to expose
functionality as a Subsystem for UNIX-based Applications (SUA) DLL. Please see the
-G option for more details on creating SUA DLLs.

c89 -D <DLLNAMESPACE> -G -B dll -o suadll.dll suadll.c

suadll.c is created in same fashion as any win32 dll program file.

But again reiterating Roodney's point, semantics of POSIX and WIN32 need to be taken into consideration.

(in reply to Rodney)
Post #: 3
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> How do you build a DLL with gcc? 2003 R3 SUA Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047