This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix build on Haiku beta, set correct Haiku usrinc and locinc, add -fno-stack-protecto...
authorThibault DUPONCHELLE <thibault.duponchelle@gmail.com>
Fri, 12 Jun 2020 12:19:52 +0000 (14:19 +0200)
committerℕicolas ℝ <nicolas@atoomic.org>
Tue, 29 Sep 2020 16:11:41 +0000 (10:11 -0600)
and haiku.sh (and disable accordingly -fstack-protector* in Configure)

Configure
ext/Errno/Errno_pm.PL
hints/amigaos.sh
hints/haiku.sh

index e98c4d1..16d6370 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -5388,23 +5388,24 @@ default|recommended)
        # is to add the flag to the flags passed to the compiler at link time,
        # as that way the compiler can do the right implementation dependant
        # thing. (NWC)
-       case "$osname" in
-       amigaos) ;; # -fstack-protector builds but doesn't work
-       *)      case "$gccversion" in
-               ?*)     set stack-protector-strong -fstack-protector-strong
-                       eval $checkccflag
-                       case "$dflt" in
-                       *-fstack-protector-strong*) ;; # It got added.
-                       *) # Try the plain/older -fstack-protector.
-                          set stack-protector -fstack-protector
-                          eval $checkccflag
-                          ;;
-                       esac
-                       ;;
+       case "$ccflags" in
+       *-fno-stack-protector*)
+           echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
+           ;;
+       *) case "$gccversion" in
+          ?*)  set stack-protector-strong -fstack-protector-strong
+               eval $checkccflag
+               case "$dflt" in
+               *-fstack-protector-strong*) ;; # It got added.
+               *) # Try the plain/older -fstack-protector.
+                  set stack-protector -fstack-protector
+                  eval $checkccflag
+                  ;;
                esac
                ;;
+           esac
+           ;;
        esac
-       ;;
 esac
 
 case "$mips_type" in
index 762f382..1fddb94 100644 (file)
@@ -147,7 +147,7 @@ sub get_files {
        $file{$linux_errno_h} = 1;
     } elsif ($^O eq 'haiku') {
        # hidden in a special place
-       $file{'/boot/develop/headers/posix/errno.h'} = 1;
+       $file{'/boot/system/develop/headers/posix/errno.h'} = 1;
 
     } elsif ($^O eq 'vos') {
        # avoid problem where cpp returns non-POSIX pathnames
index c7b9e5e..8b34d89 100644 (file)
@@ -6,3 +6,5 @@ for f in amigaos4/*.h amigaos4/*.c
 do
   cp -f $f .
 done
+
+ccflags="$ccflags -fno-stack-protector"
index 9e2f447..0ec7479 100644 (file)
@@ -6,7 +6,6 @@ case "$prefix" in
 *) ;; # pass the user supplied value through
 esac
 
-
 libpth="$(finddir B_USER_DEVELOP_DIRECTORY)/lib $(finddir B_SYSTEM_DEVELOP_DIRECTORY)/lib $(finddir B_COMMON_DIRECTORY)/lib /system/lib"
 usrinc="$(finddir B_SYSTEM_DEVELOP_DIRECTORY)/headers/posix"
 locinc="$(finddir B_USER_CONFIG_DIRECTORY)/develop/headers $(finddir B_COMMON_DIRECTORY)/headers $(finddir B_SYSTEM_DEVELOP_DIRECTORY)/headers"
@@ -32,6 +31,8 @@ d_syserrlst='undef'
 cc="gcc"
 ld='gcc'
 
+ccflags="$ccflags -fno-stack-protector"
+
 # The runtime loader library path variable is LIBRARY_PATH.
 case "$ldlibpthname" in
 '') ldlibpthname=LIBRARY_PATH ;;