I think this patch is now cleaned up enough to look for OKs.

The patch to numeric.c works around an issue with clang and
-Wdeclaration-after-statement that was fixed more correctly upstream,
but pulling in the full fix in seemed like overkill for now.

https://github.com/Perl/perl5/issues/17725
https://github.com/Perl/perl5/pull/17750

This patch does miss `rm gnu/usr.bin/perl/DynaLoader.sed` that we no
longer need, not sure which cvs diff flag I missed on that.

Other than that, as described in my original email:


On Fri, Apr 10, 2020 at 06:17:33PM -0700, Andrew Hewus Fresh wrote:
> Recently it was pointed out that we don't link /usr/lib/libperl.so.* to
> libm the way is expected for code that also links to libperl.  That led
> me to go digging again into the customization we have around the perl
> build and getting terribly confused.  That did somewhat clear up after
> reading more about bsd.*.mk, but still feel like some of this mess was
> to make the vax work, but I couldn't actually figure it out from the cvs
> logs why it exists.
> 
> In any case, this patch does a few things, some of which I can split up
> and put in separately if it comes to that.
> 
> * Puts back some of the upstream Makefile.SH that we removed
>   * and a little Dynaloader too
> 
> * Changes Configure flags to -de instead of -dsE
>   * So Configure does the work previously handled by depend.done
> 
> * Adjusts the installperl script to put libperl where we want it
> 
> * Moves some build flag discovery into hint/openbsd.sh
>   (Which I can then push upstream)
>   * Figuring out the correct PICFLAG, which means perl will now use the
>     same one, not -fpic for things built by Makefile.bsdwapper on archs
>     that want it and -fPIC for everything else.
>   * Using no-tree-ter on alpha, due to a compiler bug.
> 
> * Lets the perl infrastructure build libperl again
>   * Notably, this stops creating libperl.a, but I have a patch
>     around that puts it back, just not sure if we need it.
>   * Which means "we" don't actually build anything anymore, we leave all
>     that to the perl upstream Makefile so all the "stuff" to do with
>     that can go away.
>   * Which means ldd now mentions libm as it should
> 
> * Some tidying of the rest of Makefile.bsd-wrapper*
> 
> It seems to build fine on my
>   alpha, amd64, arm64, armv7, i386, macppc, octeon, and sparc64.
> 
> 
> The individual changes are committed, in a clean-up-build branch, to the
> GitHub repo where I keep track of them, along with build logs from my
> test machines both with and without this patch:
> https://github.com/afresh1/OpenBSD-perl/tree/clean-up-build


Index: gnu/usr.bin/perl/numeric.c
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/numeric.c,v
retrieving revision 1.6
diff -u -p -r1.6 numeric.c
--- gnu/usr.bin/perl/numeric.c  9 Apr 2020 01:32:11 -0000       1.6
+++ gnu/usr.bin/perl/numeric.c  17 May 2020 16:44:29 -0000
@@ -34,8 +34,8 @@ values, including such things as replace
 PERL_STATIC_INLINE NV
 S_strtod(pTHX_ const char * const s, char ** e)
 {
-    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     NV result;
+    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
 
     STORE_LC_NUMERIC_SET_TO_NEEDED();
 
Index: distrib/sets/lists/comp/mi
===================================================================
RCS file: /cvs/src/distrib/sets/lists/comp/mi,v
retrieving revision 1.1498
diff -u -p -r1.1498 mi
--- distrib/sets/lists/comp/mi  22 Apr 2020 02:04:00 -0000      1.1498
+++ distrib/sets/lists/comp/mi  17 May 2020 16:44:21 -0000
@@ -1536,7 +1536,6 @@
 ./usr/lib/libpanelw_p.a
 ./usr/lib/libpcap.a
 ./usr/lib/libpcap_p.a
-./usr/lib/libperl.a
 ./usr/lib/libpthread.a
 ./usr/lib/libpthread_p.a
 ./usr/lib/libradius.a
Index: gnu/usr.bin/perl/DynaLoader.sed
===================================================================
RCS file: gnu/usr.bin/perl/DynaLoader.sed
diff -N gnu/usr.bin/perl/DynaLoader.sed
--- gnu/usr.bin/perl/DynaLoader.sed     17 Nov 2014 21:00:55 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-s@"dlutils.c"@"ext/DynaLoader/dlutils.c"@
-/^#ifndef RTLD_LAZY/{N;N;c\
-#define VERSION "1.20"\
-#define XS_VERSION "1.20"\
-#define DLOPEN_WONT_DO_RELATIVE_PATHS
-}
Index: gnu/usr.bin/perl/Makefile.SH
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/Makefile.SH,v
retrieving revision 1.51
diff -u -p -r1.51 Makefile.SH
--- gnu/usr.bin/perl/Makefile.SH        25 Apr 2020 21:15:23 -0000      1.51
+++ gnu/usr.bin/perl/Makefile.SH        17 May 2020 16:44:23 -0000
@@ -822,11 +822,11 @@ CCDLFLAGS         = `echo $ccdlflags|sed -e 's@
 LIBPERL_NONSHR         = libperl_nonshr$(LIB_EXT)
 MINIPERL_NONSHR                = miniperl_nonshr$(EXE_EXT)
 
-#$(LIBPERL_NONSHR): $(perllib_objs)
-#      $(RMS) $(LIBPERL_NONSHR)
-#      $(AR) rc $(LIBPERL_NONSHR) $(perllib_objs)
+$(LIBPERL_NONSHR): $(perllib_objs)
+       $(RMS) $(LIBPERL_NONSHR)
+       $(AR) rc $(LIBPERL_NONSHR) $(perllib_objs)
 
-$(MINIPERL_NONSHR): miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)  perlmini$(OBJ_EXT)
+$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)  
perlmini$(OBJ_EXT)
        $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
            opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
 
@@ -925,33 +925,33 @@ $(DTRACE_MAIN_O): perldtrace.d perlmain$
 !NO!SUBS!
                ;;
     esac
-#      $spitshell >>$Makefile <<'!NO!SUBS!'
-#$(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT)
-#!NO!SUBS!
-#      case "$useshrplib" in
-#      true)
-#              $spitshell >>$Makefile <<'!NO!SUBS!'
-#      rm -f $@
-#      $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
-#!NO!SUBS!
-#              case "$osname" in
-#              aix)
-#                      $spitshell >>$Makefile <<'!NO!SUBS!'
-#      rm -f libperl$(OBJ_EXT)
-#      mv $@ libperl$(OBJ_EXT)
-#      $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
-#!NO!SUBS!
-#                      ;;
-#              esac
-#              ;;
-#      *)
-#              $spitshell >>$Makefile <<'!NO!SUBS!'
-#      rm -f $(LIBPERL)
-#      $(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER)
-#      @$(ranlib) $(LIBPERL)
-#!NO!SUBS!
-#              ;;
-#      esac
+       $spitshell >>$Makefile <<'!NO!SUBS!'
+$(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT)
+!NO!SUBS!
+       case "$useshrplib" in
+       true)
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+       rm -f $@
+       $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+!NO!SUBS!
+               case "$osname" in
+               aix)
+                       $spitshell >>$Makefile <<'!NO!SUBS!'
+       rm -f libperl$(OBJ_EXT)
+       mv $@ libperl$(OBJ_EXT)
+       $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
+!NO!SUBS!
+                       ;;
+               esac
+               ;;
+       *)
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+       rm -f $(LIBPERL)
+       $(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER)
+       @$(ranlib) $(LIBPERL)
+!NO!SUBS!
+               ;;
+       esac
        $spitshell >>$Makefile <<'!NO!SUBS!'
 
 # How to build executables.
@@ -1017,6 +1017,10 @@ NAMESPACEFLAGS = -force_flat_namespace
                esac
                $spitshell >>$Makefile <<'!NO!SUBS!'
 lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
+       -@rm -f miniperl.xok
+       $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+           $(miniperl_objs) $(libs)
+       $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib 
-MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run 
make minitest; exit 1'
        $(MINIPERL) -f write_buildcustomize.pl
 !NO!SUBS!
                ;;
Index: gnu/usr.bin/perl/Makefile.bsd-wrapper
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/Makefile.bsd-wrapper,v
retrieving revision 1.109
diff -u -p -r1.109 Makefile.bsd-wrapper
--- gnu/usr.bin/perl/Makefile.bsd-wrapper       4 Jul 2017 13:10:13 -0000       
1.109
+++ gnu/usr.bin/perl/Makefile.bsd-wrapper       17 May 2020 16:44:23 -0000
@@ -3,8 +3,7 @@
 # Build wrapper for Perl
 #
 
-
-CONFIGURE_ARGS= -dsE -Dopenbsd_distribution=defined 
-Dccflags='-DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE'
+CONFIGURE_ARGS=        -de -Dopenbsd_distribution=defined
 
 .if !exists(${.OBJDIR}/config.over)
 CONFIGURE_ARGS+= -Dmksymlinks
@@ -12,51 +11,21 @@ CONFIGURE_ARGS+= -Dmksymlinks
 
 .MAIN: all
 
-# Arguments passed to Configure...
-
-CPPFLAGS+= -DPERL_CORE -DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE -DBIG_TIME -I.
-
-GEN_AFTER=     bitcount.h config.h mg_data.h uudmap.h cflags makedepend \
-               myconfig Makefile Policy.sh pod/Makefile
-
-GENERATED=     config.sh ${GEN_AFTER}
+CLEANFILES=    config.sh
 
-${GEN_AFTER}: config.sh
-
-CLEANFILES=    config.sh Policy.sh DynaLoader.c
+config.sh:     ${.CURDIR}/config.over ${.CURDIR}/hints/openbsd.sh
+       cd ${.OBJDIR} && PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
+           exec /bin/sh ${.CURDIR}/Configure ${CONFIGURE_ARGS}
 
 # nothing!
 depend:
        @:
 
-depend.done: ${GENERATED}
-       cd ${.OBJDIR} && exec ${MAKE} depend
-       touch $@
-
-config.sh:     ${.CURDIR}/config.over
-       cd ${.OBJDIR} && PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
-           exec /bin/sh ${.CURDIR}/Configure ${CONFIGURE_ARGS}
-
-Makefile cflags makedepend makedir myconfig Policy.sh config.h:
-       cd ${.OBJDIR} && exec /bin/sh ${@:S/./_/}.SH
-
-pod/Makefile:
-       cd ${.OBJDIR}/pod && exec /bin/sh Makefile.SH
-
-uudmap.h: bitcount.h
-mg_data.h: bitcount.h
-
-bitcount.h: generate_uudmap
-       ./generate_uudmap uudmap.h bitcount.h mg_data.h
-
-generate_uudmap: generate_uudmap.o
-       ${CC} ${CPPFLAGS} ${CFLAGS} -o generate_uudmap generate_uudmap.o
-
 test:
-       -@if [ -e Makefile ]; then ${MAKE} test; fi
+       -@test -e Makefile && ${MAKE} test
 
 clean:
-       -@if [ -e Makefile ]; then ${MAKE} realclean; fi
+       -@test -e Makefile && ${MAKE} realclean
 
 cleandir:
        -@if [ ${.CURDIR} != ${.OBJDIR} ]; then \
@@ -65,10 +34,10 @@ cleandir:
            test -e Makefile && ${MAKE} distclean; \
            rm -f ${CLEANFILES}; \
        fi
-       @cd ${.CURDIR} && ${MAKE} -f Makefile.bsd-wrapper1 cleandir
+       cd ${.CURDIR} && ${MAKE} -f Makefile.bsd-wrapper1 cleandir
 
-all:   depend.done
-       cd ${.CURDIR} && exec ${MAKE} -f Makefile.bsd-wrapper1 perl.build 
CPPFLAGS="${CPPFLAGS}" GENERATED="${GENERATED}"
+all:   config.sh
+       cd ${.CURDIR} && exec ${MAKE} -f Makefile.bsd-wrapper1 perl.build
        cd ${.CURDIR} && exec ${MAKE} -f Makefile.bsd-wrapper1 mansrc.build
 
 install:
Index: gnu/usr.bin/perl/Makefile.bsd-wrapper1
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/Makefile.bsd-wrapper1,v
retrieving revision 1.39
diff -u -p -r1.39 Makefile.bsd-wrapper1
--- gnu/usr.bin/perl/Makefile.bsd-wrapper1      9 Apr 2020 02:54:54 -0000       
1.39
+++ gnu/usr.bin/perl/Makefile.bsd-wrapper1      17 May 2020 16:44:23 -0000
@@ -1,43 +1,9 @@
 .include <bsd.own.mk>
 
-# There is no point in building a profiled libperl that is never used.
-NOPROFILE=
-
-# Perl builds with -fno-strict-aliasing, we want libperl to do the same
-CFLAGS+= -fno-strict-aliasing
-
-H2PH=          /usr/bin/h2ph
-
-LIB=   perl
-
-SRCS1= gv.c toke.c perly.c pad.c regcomp.c dump.c util.c mg.c reentr.c \
-       mro_core.c keywords.c hv.c av.c run.c pp_hot.c sv.c pp.c scope.c 
pp_ctl.c \
-       pp_sys.c doop.c doio.c dquote.c regexec.c utf8.c taint.c deb.c 
universal.c \
-       globals.c perlio.c perlapi.c numeric.c mathoms.c locale.c time64.c \
-       pp_pack.c pp_sort.c caretx.c
-SRCS=  ${SRCS1} op.c perl.c
-
-# We must not try to mkdep DynaLoader.c as it requires miniperl
-OBJS+= DynaLoader.o
-
-# For generating DynaLoader.c
-.if defined(NOPIC)
-DYNALOADER=ext/DynaLoader/dl_none.xs
-.else
-DYNALOADER=ext/DynaLoader/dl_dlopen.xs
-.endif
-
 .if defined (INSTALL_STRIP) && ${INSTALL_STRIP} == "-s"
 STRIPFLAGS='-s'
 .endif
 
-perl.build:    perl.lib DynaLoader.c
-       cd ${.OBJDIR} && exec ${MAKE}
-
-# Never try to regenerate perly.c or perly.h
-perly.c perly.h: perly.y
-       -@true
-
 # If we are cross-compiling, we use the native pod2man.
 # Otherwise, we use the pod2man (and libperl) we just
 # built since we don't know what's in the tree.
@@ -844,76 +810,22 @@ stamp-mansrc.build:
 
 .PHONY: mansrc.build
 
+perl.build:
+       cd ${.OBJDIR} && exec ${MAKE}
+
 cleandir:
        rm -f ${MAN} stamp-mansrc.build
 
-.include <bsd.lib.mk>
-# These have to come after the inclusion of <bsd.lib.mk>
-
-# Need -fPIC, not -fpic on sparc
-.if ($(TARGET_MACHINE_ARCH) == sparc)
-PICFLAG=-fPIC
-.endif
-
-# Unaligned access on alpha with -ftree-ter
-# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59679
-# More details
-# https://rt.perl.org/Public/Bug/Display.html?id=120888
-.if ($(TARGET_MACHINE_ARCH) == alpha)
-CFLAGS+= -fno-tree-ter
-.endif
-
-# The DynaLoader extension is now compiled statically into libperl
-miniperl: ${GENERATED} ${SRCS1:S/.c/.o/g} opmini.o perlmini.o miniperlmain.o
-       ${CC} ${CPPFLAGS} ${CFLAGS} -o $@ ${SRCS1:S/.c/.o/g} opmini.o 
perlmini.o miniperlmain.o ${LDFLAGS} -lm -lutil
-
-opmini.c: op.c
-       rm -f opmini.c
-       cp op.c opmini.c
-
-opmini.o: opmini.c
-       ${CC} ${CPPFLAGS} ${CFLAGS} -DPERL_EXTERNAL_GLOB -c  $> -o $@
-
-perlmini.o: perlmini.c
-       ${CC} ${CPPFLAGS} ${CFLAGS} -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -c 
$> -o $@
-
-lib/Config.pm: miniperl config.sh
-       cd ${.OBJDIR} && exec ${MAKE} preplibrary
-
-DynaLoader.c: miniperl ${DYNALOADER} lib/Config.pm
-       ./miniperl -Ilib -Idist/Cwd -Idist/Cwd/lib -Idist/ExtUtils-ParseXS/lib \
-           -Icpan/Getopt-Long/lib -Idist/constant/lib -Iext/re \
-           -mExtUtils::Typemaps dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp \
-           -noprototypes -typemap ../../lib/ExtUtils/typemap ${DYNALOADER} | \
-           sed -f ${.CURDIR}/DynaLoader.sed > $@; test -s $@ || rm -f $@
-
-perl.lib:      ${GENERATED} ${_LIBS}
-
-install: install.lib install.perl maninstall
+install: install.perl maninstall
        -chmod -R a+rX ${DESTDIR}/usr/libdata/perl5
 
 install.perl:
        cd ${.OBJDIR}; INSTALL=${INSTALL} INSTALL_COPY=${INSTALL_COPY} \
-        STRIPFLAGS=${STRIPFLAGS} INSTALLFLAGS=-o NOLIBINSTALL=1 \
-        LD_LIBRARY_PATH=${.OBJDIR} exec ./perl installperl --user=${LIBOWN} 
--group=${LIBGRP} --destdir=${DESTDIR} -o ${STRIPFLAGS}
+        STRIPFLAGS=${STRIPFLAGS} INSTALLFLAGS=-o \
+        LD_LIBRARY_PATH=${.OBJDIR} exec ./perl installperl \
+         --user=${LIBOWN} --group=${LIBGRP} \
+         --destdir=${DESTDIR} -o ${STRIPFLAGS}
 
-install.lib:
-       ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 lib${LIB}.a 
\
-           ${DESTDIR}${LIBDIR}
-.if (${INSTALL_COPY} != "-p")
-       ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
-.endif
-       chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}.a
-.if !defined(NOPROFILE)
-       ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \
-           lib${LIB}_p.a ${DESTDIR}${LIBDIR}
-.if (${INSTALL_COPY} != "-p")
-       ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
-.endif
-       chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
-.endif
-.if !defined(NOPIC) && defined(major) && defined(minor)
-       ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-           lib${LIB}.so.${major}.${minor} ${DESTDIR}${LIBDIR}
-.endif
-.PHONY: perl.lib install.lib perl.build install.perl man.build
+.PHONY: perl.build install.perl man.build
+
+.include <bsd.man.mk>
Index: gnu/usr.bin/perl/installperl
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/installperl,v
retrieving revision 1.49
diff -u -p -r1.49 installperl
--- gnu/usr.bin/perl/installperl        30 Dec 2019 02:15:16 -0000      1.49
+++ gnu/usr.bin/perl/installperl        17 May 2020 16:44:29 -0000
@@ -383,7 +383,7 @@ elsif ($Is_Cygwin) { # On Cygwin symlink
     # [als] hard-coded 'libperl' name... not good!
     #@corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
     @corefiles = <*.h *.inc perl*$Config{lib_ext}>;
-    push(@corefiles,<libperl*.*>) unless defined($ENV{"NOLIBINSTALL"});
+    install($libperl, "$opts{destdir}$Config{glibpth}/$libperl", "0444");
 
     # AIX needs perl.exp installed as well.
     push(@corefiles,'perl.exp') if $^O eq 'aix';
Index: gnu/usr.bin/perl/ext/DynaLoader/Makefile.PL
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/ext/DynaLoader/Makefile.PL,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile.PL
--- gnu/usr.bin/perl/ext/DynaLoader/Makefile.PL 30 Dec 2019 02:15:18 -0000      
1.23
+++ gnu/usr.bin/perl/ext/DynaLoader/Makefile.PL 17 May 2020 16:44:52 -0000
@@ -65,8 +65,8 @@ sub MY::static {
 
     return "
 $object : \$(FIRST_MAKEFILE) \$(OBJECT)
-       #\$(RM_RF) $object
-       #\$(CP) \$(OBJECT) $object
+       \$(RM_RF) $object
+       \$(CP) \$(OBJECT) $object
 
 static :: $object
 ";
Index: gnu/usr.bin/perl/hints/openbsd.sh
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/hints/openbsd.sh,v
retrieving revision 1.71
diff -u -p -r1.71 openbsd.sh
--- gnu/usr.bin/perl/hints/openbsd.sh   30 Dec 2019 02:15:18 -0000      1.71
+++ gnu/usr.bin/perl/hints/openbsd.sh   17 May 2020 16:44:54 -0000
@@ -31,6 +31,14 @@ case "$osvers" in
        d_setruid=$undef
 esac
 
+# OpenBSD 5.5 on has 64 bit time_t
+case "$osvers" in
+[0-4].*|5.[0-4]) ;;
+*)
+       cppflags="$cppflags -DBIG_TIME"
+       ;;
+esac
+
 #
 # Not all platforms support dynamic loading...
 # For the case of "$openbsd_distribution", the hints file
@@ -47,7 +55,11 @@ alpha-2.[0-8]|mips-2.[0-8]|powerpc-2.[0-
        test -z "$usedl" && usedl=$define
        # We use -fPIC here because -fpic is *NOT* enough for some of the
        # extensions like Tk on some OpenBSD platforms (ie: sparc)
-       cccdlflags="-DPIC -fPIC $cccdlflags"
+       PICFLAG=-fPIC
+       if [ -e /usr/share/mk/bsd.own.mk ]; then
+               PICFLAG=`make -f /usr/share/mk/bsd.own.mk -V PICFLAG`
+       fi
+       cccdlflags="-DPIC ${PICFLAG} $cccdlflags"
        case "$osvers" in
        [01].*|2.[0-7]|2.[0-7].*)
                lddlflags="-Bshareable $lddlflags"
@@ -58,7 +70,7 @@ alpha-2.[0-8]|mips-2.[0-8]|powerpc-2.[0-
                ;;
        *) # from 3.1 onwards
                ld=${cc:-cc}
-               lddlflags="-shared -fPIC $lddlflags"
+               lddlflags="-shared ${PICFLAG} $lddlflags"
                libswanted=`echo $libswanted | sed 's/ dl / /'`
                ;;
        esac
@@ -84,6 +96,7 @@ esac
 # around for old NetBSD binaries.
 libswanted=`echo $libswanted | sed 's/ crypt / /'`
 
+# OpenBSD hasn't ever needed linking to libutil
 libswanted=`echo $libswanted | sed 's/ util / /'`
 
 # Configure can't figure this out non-interactively
@@ -103,6 +116,18 @@ m88k-3.4)
    ;;
 esac
 
+#
+# Unaligned access on alpha with -ftree-ter
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59679
+# More details
+# https://rt.perl.org/Public/Bug/Display.html?id=120888
+#
+case "${ARCH}-${osvers}" in
+    alpha-*)
+    ccflags="-fno-tree-ter $ccflags"
+    ;;
+esac
+
 # Special per-arch specific ccflags
 case "${ARCH}-${osvers}" in
     vax-*)
@@ -166,5 +191,8 @@ esac
 # https://marc.info/?l=openbsd-bugs&m=155364568608759&w=2
 # which is being fixed.  In the meantime, forbid POSIX 2008 locales
 d_newlocale="$undef"
+
+# OpenBSD's locale support is not that complete yet
+ccflags="-DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE $ccflags"
 
 # end
Index: gnu/usr.bin/perl/git_version.h
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/git_version.h,v
retrieving revision 1.7
diff -u -p -r1.7 git_version.h
--- gnu/usr.bin/perl/git_version.h      17 Nov 2014 21:00:55 -0000      1.7
+++ gnu/usr.bin/perl/git_version.h      17 May 2020 16:44:28 -0000
@@ -1,6 +1,5 @@
 /**************************************************************************
-* WARNING: 'git_version.h' is automatically generated by make_patchnum.pl
-*          DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
+* WARNING: 'git_version.h' is statically defined on OpenBSD
 ***************************************************************************/
 
 #define PERL_GIT_UNPUSHED_COMMITS              \
Index: gnu/usr.bin/perl/lib/Config_git.pl
===================================================================
RCS file: /cvs/src/gnu/usr.bin/perl/lib/Config_git.pl,v
retrieving revision 1.1
diff -u -p -r1.1 Config_git.pl
--- gnu/usr.bin/perl/lib/Config_git.pl  20 May 2010 19:26:32 -0000      1.1
+++ gnu/usr.bin/perl/lib/Config_git.pl  17 May 2020 16:44:54 -0000
@@ -1,6 +1,5 @@
 ######################################################################
-# WARNING: 'lib/Config_git.pl' is generated by make_patchnum.pl
-#          DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
+# WARNING: 'lib/Config_git.pl' is statically defined on OpenBSD
 ######################################################################
 $Config::Git_Data=<<'ENDOFGIT';
 git_commit_id=''

Reply via email to