summaryrefslogtreecommitdiff
path: root/compiler/systems/t_aix.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-01-21 23:28:34 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-01-21 23:28:34 +0000
commit1903b037de2fb3e75826406b46f055acb70963fa (patch)
tree604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /compiler/systems/t_aix.pas
parentad1141d52f8353457053b925cd674fe1d5c4eafc (diff)
parent953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff)
downloadfpc-blocks.tar.gz
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/systems/t_aix.pas')
-rw-r--r--compiler/systems/t_aix.pas23
1 files changed, 16 insertions, 7 deletions
diff --git a/compiler/systems/t_aix.pas b/compiler/systems/t_aix.pas
index beb6eec417..0d26dbca1d 100644
--- a/compiler/systems/t_aix.pas
+++ b/compiler/systems/t_aix.pas
@@ -43,6 +43,7 @@ interface
TLinkerAIX=class(texternallinker)
private
prtobj : string[80];
+ assumebinutils,use_gld : boolean;
Function WriteResponseFile(isdll:boolean) : Boolean;
public
constructor Create;override;
@@ -51,7 +52,6 @@ interface
function MakeSharedLibrary:boolean;override;
end;
-
implementation
uses
@@ -117,8 +117,8 @@ begin
sure that the binary does not contain any relocations in the text
section (otherwise you get an error at load time instead of at link time
in case something is wrong) }
- ExeCmd[1]:='ld -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $STRIP -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
- DllCmd[1]:='ld -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $INITFINI $STRIP -G -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
+ ExeCmd[1]:='$LDBIN -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $STRIP -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
+ DllCmd[1]:='$LDBIN -bpT:0x10000000 -bpD:0x20000000 -btextro $OPT $INITFINI $STRIP -G -L. -o $EXE $CATRES' {$ifdef powerpc64}+' -b64'{$endif};
if cs_debuginfo in current_settings.moduleswitches then
begin
{ debugging helpers }
@@ -139,6 +139,11 @@ begin
{$else}
{$error unsupported AIX architecture}
{$endif}
+ assumebinutils:=
+ not(cs_link_native in current_settings.globalswitches) or
+ (not(cs_link_on_target in current_settings.globalswitches) and
+ not(source_info.system in systems_aix)) ;
+ use_gld:=assumebinutils and (source_info.system in systems_aix)
end;
@@ -148,12 +153,8 @@ Var
i : longint;
HPath : TCmdStrListItem;
s,s1 : TCmdStr;
- assumebinutils : boolean;
begin
result:=False;
- assumebinutils:=
- not(cs_link_on_target in current_settings.globalswitches) and
- not(source_info.system in systems_aix) ;
{ Open link.res file }
LinkRes:=TLinkRes.Create(outputexedir+Info.ResName,assumebinutils);
with linkres do
@@ -261,6 +262,10 @@ begin
{ Call linker }
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
+ if assumebinutils and (source_info.system in systems_aix) then
+ Replace(binstr,'$LDBIN','gld')
+ else
+ Replace(binstr,'$LDBIN','ld');
binstr:=FindUtil(utilsprefix+BinStr);
Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
Replace(cmdstr,'$OPT',Info.ExtraOptions);
@@ -351,6 +356,10 @@ begin
{ Call linker }
SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
+ if assumebinutils and (source_info.system in systems_aix) then
+ Replace(binstr,'$LDBIN','gld')
+ else
+ Replace(binstr,'$LDBIN','ld');
binstr:=FindUtil(utilsprefix+BinStr);
{ on AIX, shared libraries are special object files that are stored inside
an archive. In that archive, the 32 bit version of the library is called