summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-06-17 20:19:48 +0000
committerkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-06-17 20:19:48 +0000
commit5f07e56cd191b3d005a0ad1e37ec05123fb1fcbe (patch)
treee68c4a12e4a89eca98233ee9f0b88f8e987d96bd
parent20083517a81bbe3da17247c0fd25038f7cd7b90e (diff)
downloadfpc-5f07e56cd191b3d005a0ad1e37ec05123fb1fcbe.tar.gz
put #ifdef TARGETOS / #endif around the gcclib section, otherwise the various host paths can cause a hard to debug mess during crosscompiling in some cases
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@42243 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--utils/fpcmkcfg/fpcmkcfg.pp10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/fpcmkcfg/fpcmkcfg.pp b/utils/fpcmkcfg/fpcmkcfg.pp
index 21adc09928..6196509f2c 100644
--- a/utils/fpcmkcfg/fpcmkcfg.pp
+++ b/utils/fpcmkcfg/fpcmkcfg.pp
@@ -281,6 +281,16 @@ begin
end;
end;
end; {case}
+
+ { ifdef everything above related to the target OS otherwise host linker/clib paths can leak
+ into the target while cross-ing, and cause nonworking executables (Darwin-x86_64 to ARM-Linux
+ for example on my setup), and while it's advised to use -n when crosscompiling, it can
+ cause hard to identify issues if -n is forgotten... (KB) }
+ if result <> '' then
+ result := '#ifdef ' + BuildOSTarget + LineEnding +
+ result + LineEnding +
+ '#endif' + LineEnding;
+
end;