Re: gcc - How to link the RTL statically ?



[A complimentary Cc of this posting was NOT [per weedlist] sent to
Lars Erdmann
<lars.erdmann@xxxxxxxx>], who wrote in article <492d9ac7$0$31332$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxxx>:
??? Why? I was talking about EMX. EMX works as expected; newer
gcc's fail to work as expected. Since there is more than one
difference, I proposed to eliminate differences one-by-one, to find
which one is relevant.

The simplest thing to eliminate is which under-the-cover-linker is used.

And I don't care about EMX,

Who cares what you care about? What I told you is a simple way to
start investigating the problem YOU have with static linking. (See
below...)

it's history (at least if you want to stick to newer versions of gcc).

??? Is not 4.3.2 new enough for you? I'm using EMX with 4.3.2 now
(my setup currently has only -Zmtd supported, though, so I can't check
static linking).

Setting these correspondingly, I have tried both, ilink.exe from VAC365
as well as link386.exe. ilink.exe leads to slightly smaller exe,
link386.exe to slightly larger exe. However, both of them are huge if
you link the C RTL statically.

So we established that it is the structure of the library which
matters; with large probability the linker's problems are not
relevant...

I wonder if the architecture of EMX's __syscall() matters here: in
EMX, unless one uses -Zsys, (almost) all calls to OS's "services" are
routed through a __syscall() interface, which decides which API to
call basing on "syscall number". If klibc has anything analoguous, it
may lead to "everything" being pulled in through the code of
__syscall()...

Yours,
Ilya
.



Relevant Pages

  • Re: Target Machine Error
    ... also my app appears to need SP2, would static linking correct this? ... If your applications consists of just a single .exe, with no DLL's of your own creation, it can almost certainly be static linked. ... If your application uses its own DLL's in addition to the .exe then it may or may not be possible to static link it. ... When you do a static link build al the MFC and CRT code is embedded into your .exe. ...
    (microsoft.public.vc.mfc)
  • Re: lib file and static linking
    ... i understand the static linking, the code will the INJECTED into my ... exe rather than being picked from the dll at the run time due to the ... contains the code for the exported functions or it contains only the ... for dlls, the functions are in the dll, and loaded dynamically. ...
    (microsoft.public.vc.language)
  • Re: Whither GUI conventions?
    ... you dont need static linking and a small app is a fraction of 300K :-). ... "Tom Serface" wrote in message ... stuff bloats the size of the static code then I may be forced to stay behind on a couple of programs I have where the size of the program is really important. ... But if you want really small .exe size, ...
    (microsoft.public.vc.mfc)
  • Re: gcc - How to link the RTL statically ?
    ... -static is, AFAIK, NOOP with EMX. ... I am not talking about EMX. ... And I don't care about EMX, it's history (at least if you want to stick to newer versions of gcc). ... ilink.exe leads to slightly smaller exe, ...
    (comp.os.os2.programmer.misc)
  • Re: Statically Linked App Crashes on ~WindowDC
    ... Static linking is not inherently dangerous unless the authors of the .exe ... have not exercised due diligence with respect to their heaps. ... assumptions under which the DLL was designed to ...
    (microsoft.public.vc.mfc)