* also use -T when cross-compiling a shared library using a sysroot on

Linux (we want to replace the entire built-in linker script in that case)

git-svn-id: trunk@31450 -
This commit is contained in:
Jonas Maebe 2015-08-29 12:26:12 +00:00
parent e391a37b30
commit 882421a3ad

View File

@ -317,11 +317,15 @@ begin
with Info do
begin
ExeCmd[1]:='ld '+platform_select+platformopt+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE';
DllCmd[1]:='ld '+platform_select+' $OPT $INIT $FINI $SONAME -shared -L. -o $EXE';
{ when we want to cross-link we need to override default library paths }
if length(sysrootpath) > 0 then
begin
ExeCmd[1]:=ExeCmd[1]+' -T';
DllCmd[1]:=DllCmd[1]+' -T';
end;
ExeCmd[1]:=ExeCmd[1]+' $RES';
DllCmd[1]:='ld '+platform_select+' $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
DllCmd[1]:=DllCmd[1]+' $RES';
DllCmd[2]:='strip --strip-unneeded $EXE';
ExtDbgCmd[1]:='objcopy --only-keep-debug $EXE $DBG';
ExtDbgCmd[2]:='objcopy --add-gnu-debuglink=$DBG $EXE';
@ -729,7 +733,8 @@ begin
{$ifdef AArch64}
{$define LINKERSCRIPT_INCLUDED}
if isdll or (sysrootpath='') then begin
if sysrootpath='' then
begin
{ On other architectures, supplying a complete linker script
without the -T option just results in:
warning: link.res contains output sections; did you forget -T?
@ -745,7 +750,9 @@ begin
add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
add(' }');
add('}');
end else begin
end
else
begin
{ Complete linker script for aarch64-linux: }
add('SECTIONS');
add('{');