|
@@ -208,7 +208,7 @@ begin
|
|
Glibc21:=false;
|
|
Glibc21:=false;
|
|
with Info do
|
|
with Info do
|
|
begin
|
|
begin
|
|
- ExeCmd[1]:='ld $OPT $DYNLINK $STRIP -L. -o $EXE $RES';
|
|
|
|
|
|
+ ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $RES';
|
|
DllCmd[1]:='ld $OPT -shared -L. -o $EXE $RES';
|
|
DllCmd[1]:='ld $OPT -shared -L. -o $EXE $RES';
|
|
DllCmd[2]:='strip --strip-unneeded $EXE';
|
|
DllCmd[2]:='strip --strip-unneeded $EXE';
|
|
{ first try glibc2 }
|
|
{ first try glibc2 }
|
|
@@ -348,6 +348,9 @@ begin
|
|
{ be sure that libc is the last lib }
|
|
{ be sure that libc is the last lib }
|
|
if linklibc then
|
|
if linklibc then
|
|
LinkRes.Add('-lc');
|
|
LinkRes.Add('-lc');
|
|
|
|
+ { when we have -static for the linker the we also need libgcc }
|
|
|
|
+ if (cs_link_staticflag in aktglobalswitches) then
|
|
|
|
+ LinkRes.Add('-lgcc');
|
|
if linkdynamic and (Info.DynamicLinker<>'') then
|
|
if linkdynamic and (Info.DynamicLinker<>'') then
|
|
LinkRes.AddFileName(Info.DynamicLinker);
|
|
LinkRes.AddFileName(Info.DynamicLinker);
|
|
LinkRes.Add(')');
|
|
LinkRes.Add(')');
|
|
@@ -366,14 +369,18 @@ var
|
|
cmdstr : string;
|
|
cmdstr : string;
|
|
success : boolean;
|
|
success : boolean;
|
|
DynLinkStr : string[60];
|
|
DynLinkStr : string[60];
|
|
|
|
+ StaticStr,
|
|
StripStr : string[40];
|
|
StripStr : string[40];
|
|
begin
|
|
begin
|
|
if not(cs_link_extern in aktglobalswitches) then
|
|
if not(cs_link_extern in aktglobalswitches) then
|
|
Message1(exec_i_linking,current_module^.exefilename^);
|
|
Message1(exec_i_linking,current_module^.exefilename^);
|
|
|
|
|
|
{ Create some replacements }
|
|
{ Create some replacements }
|
|
|
|
+ StaticStr:='';
|
|
StripStr:='';
|
|
StripStr:='';
|
|
DynLinkStr:='';
|
|
DynLinkStr:='';
|
|
|
|
+ if (cs_link_staticflag in aktglobalswitches) then
|
|
|
|
+ StaticStr:='-static';
|
|
if (cs_link_strip in aktglobalswitches) then
|
|
if (cs_link_strip in aktglobalswitches) then
|
|
StripStr:='-s';
|
|
StripStr:='-s';
|
|
If (cs_profile in aktmoduleswitches) or
|
|
If (cs_profile in aktmoduleswitches) or
|
|
@@ -388,6 +395,7 @@ begin
|
|
Replace(cmdstr,'$EXE',current_module^.exefilename^);
|
|
Replace(cmdstr,'$EXE',current_module^.exefilename^);
|
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
|
Replace(cmdstr,'$RES',outputexedir+Info.ResName);
|
|
Replace(cmdstr,'$RES',outputexedir+Info.ResName);
|
|
|
|
+ Replace(cmdstr,'$STATIC',StaticStr);
|
|
Replace(cmdstr,'$STRIP',StripStr);
|
|
Replace(cmdstr,'$STRIP',StripStr);
|
|
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
|
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
|
@@ -439,7 +447,10 @@ end;
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.8 2000-01-11 09:52:07 peter
|
|
|
|
|
|
+ Revision 1.9 2000-02-09 10:35:48 peter
|
|
|
|
+ * -Xt option to link staticly against c libs
|
|
|
|
+
|
|
|
|
+ Revision 1.8 2000/01/11 09:52:07 peter
|
|
* fixed placing of .sl directories
|
|
* fixed placing of .sl directories
|
|
* use -b again for base-file selection
|
|
* use -b again for base-file selection
|
|
* fixed group writing for linux with smartlinking
|
|
* fixed group writing for linux with smartlinking
|
|
@@ -468,4 +479,4 @@ end.
|
|
* redesigned linker object
|
|
* redesigned linker object
|
|
+ library support for linux (only procedures can be exported)
|
|
+ library support for linux (only procedures can be exported)
|
|
|
|
|
|
-}
|
|
|
|
|
|
+}
|