Browse Source

Link against libc to avoid __guard_local not found symbol failure at link time for OpenBSD target

git-svn-id: trunk@41981 -
pierre 6 years ago
parent
commit
e7e96f98b2
1 changed files with 13 additions and 0 deletions
  1. 13 0
      tests/test/cg/tcalext6.pp

+ 13 - 0
tests/test/cg/tcalext6.pp

@@ -28,9 +28,22 @@ uses ctypes;
 
 
 {$if defined(CPUARMEL) and defined(FPUSOFT)}
 {$if defined(CPUARMEL) and defined(FPUSOFT)}
 { for softfloat calls in the C code }
 { for softfloat calls in the C code }
+  {$define LIBGCC_NEEDED}
+{$endif}
+
+{$ifdef OPENBSD}
+  { OpenBSD GCC uses __guard_local which is defined in crtbegin.o or crtbeginS.o}
+  {$define LIBC_NEEDED}
+{$endif}
+
+{$ifdef LIBGCC_NEEDED}
 {$linklib gcc}
 {$linklib gcc}
 {$endif}
 {$endif}
 
 
+{$ifdef LIBC_NEEDED}
+{$linklib c}
+{$endif}
+
 type
 type
   int8_t = shortint;
   int8_t = shortint;
   pint8_t = ^int8_t;
   pint8_t = ^int8_t;