nixpkgs/pkgs/development/compilers/fpc/mark-paths.patch
Timo Kaufmann f928b91f34 fpc: 3.0.4 -> 3.2.0
There was no 3.1 for some reason. The old sed-based path patching was
broken and resulted in syntax errors since it was a bit over-eager.
Instead of fixing it, I decided to replace it with a patch file which is
easier to inspect and will fail in a more obvious way next time.

The patch is now applied unconditionally, since it actually applies to
all linux platforms. The changes are localized to linux-specific code,
so it does not hurt to apply it on non-linux platforms as well.

Hedgewars needs a small fix to work with the new version. Done in the
same commit to avoid a broken commit.
2020-09-03 14:52:18 +02:00

101 lines
3.5 KiB
Diff

diff --git a/fpcsrc/compiler/systems/t_linux.pas b/fpcsrc/compiler/systems/t_linux.pas
index a7398fb9..a1e41ecb 100644
--- a/fpcsrc/compiler/systems/t_linux.pas
+++ b/fpcsrc/compiler/systems/t_linux.pas
@@ -135,13 +135,13 @@ begin
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true);
{ /lib64 should be the really first, so add it before everything else }
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib',true);
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64',true);
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true);
{$else}
{$ifdef powerpc64}
if target_info.abi<>abi_powerpc_elfv2 then
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib64;=/usr/X11R6/lib64',true)
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib64;=/usr/X11R6/lib64',true)
else
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true);
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true);
{$else powerpc64}
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib;=/usr/lib;=/usr/X11R6/lib',true);
{$endif powerpc64}
@@ -185,53 +185,53 @@ begin
end;
{$ifdef m68k}
- const defdynlinker='/lib/ld.so.1';
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
{$endif m68k}
{$ifdef i386}
- const defdynlinker='/lib/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
{$endif}
{$ifdef x86_64}
- const defdynlinker='/lib64/ld-linux-x86-64.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux-x86-64.so.2';
{$endif x86_64}
{$ifdef sparc}
- const defdynlinker='/lib/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
{$endif sparc}
{$ifdef powerpc}
- const defdynlinker='/lib/ld.so.1';
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
{$endif powerpc}
{$ifdef powerpc64}
- const defdynlinkerv1='/lib64/ld64.so.1';
- const defdynlinkerv2='/lib64/ld64.so.2';
+ const defdynlinkerv1='@dynlinker-prefix@/lib64/ld64.so.1';
+ const defdynlinkerv2='@dynlinker-prefix@/lib64/ld64.so.2';
var defdynlinker: string;
{$endif powerpc64}
{$ifdef arm}
{$ifdef FPC_ARMHF}
- const defdynlinker='/lib/ld-linux-armhf.so.3';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux-armhf.so.3';
{$else FPC_ARMHF}
{$ifdef FPC_ARMEL}
- const defdynlinker='/lib/ld-linux.so.3';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.3';
{$else FPC_ARMEL}
- const defdynlinker='/lib/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
{$endif FPC_ARMEL}
{$endif FPC_ARMHF}
{$endif arm}
{$ifdef aarch64}
-const defdynlinker='/lib/ld-linux-aarch64.so.1';
+const defdynlinker='@dynlinker-prefix@/lib/ld-linux-aarch64.so.1';
{$endif aarch64}
{$ifdef mips}
- const defdynlinker='/lib/ld.so.1';
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
{$endif mips}
{$ifdef sparc64}
- const defdynlinker='/lib64/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux.so.2';
{$endif sparc64}
@@ -266,9 +266,9 @@ begin
libctype:=uclibc;
end
{$ifdef i386}
- else if FileExists(sysrootpath+'/lib/ld-linux.so.1',false) then
+ else if FileExists(sysrootpath+'@dynlinker-prefix@/lib/ld-linux.so.1',false) then
begin
- DynamicLinker:='/lib/ld-linux.so.1';
+ DynamicLinker:='@dynlinker-prefix@/lib/ld-linux.so.1';
libctype:=glibc2;
end
{$endif i386}