On Thu, Oct 28, 2021 at 11:30:34AM +1100, Jonathan Gray wrote:
> On Tue, Oct 26, 2021 at 06:20:47PM -0400, Kurt Mosiejczuk wrote:
> > On Tue, Oct 26, 2021 at 10:04:42PM +0200, Christian Weisgerber wrote:
> > > lang/python/3.8 fails to build with llvm13.  The reason appears to be
> > > some silly confusion between "openbsd7" and "openbsd7.0" in the build
> > > system:

> > > The trigger appears to be the new support for "cc --print-multiarch":

> > > llvm 12 says on stderr:
> > >   cc: error: unsupported option '--print-multiarch'
> > >   cc: error: no input files

> > > llvm 13 says on stdout:
> > >   amd64-unknown-openbsd7.0

> > > I haven't managed to trace this any further.

> > This patch to configure.ac should neutralize the MULTIARCH stuff which
> > isn't applicable to OpenBSD anyway. It builds properly on my laptop which is
> > still using LLVM 11.1. I'll try building LLVM 13 tonight and see if it
> > works with that, but someone else is welcome to try this patch before I
> > get to it.

> also needed for lang/python/3.9

Did the readline module compile ok for you? I did this same diff, but the
readline module built but then I got an error because it wouldn't import
properly.

--Kurt

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/python/3.9/Makefile,v
> retrieving revision 1.9
> diff -u -p -r1.9 Makefile
> --- Makefile  1 Sep 2021 17:41:48 -0000       1.9
> +++ Makefile  28 Oct 2021 00:23:53 -0000
> @@ -11,6 +11,7 @@ SHARED_LIBS =               python3.9 0.0
>  VERSION_SPEC =               >=3.9,<3.10
>  #PSUBDIR =           python/3.9.0
>  
> +REVISION-main =              0
>  
>  CONFIGURE_ARGS +=    --with-ensurepip=no
>  CONFIGURE_ARGS +=    --enable-loadable-sqlite-extensions
> Index: files/CHANGES.OpenBSD
> ===================================================================
> RCS file: /cvs/ports/lang/python/3.9/files/CHANGES.OpenBSD,v
> retrieving revision 1.4
> diff -u -p -r1.4 CHANGES.OpenBSD
> --- files/CHANGES.OpenBSD     12 Jun 2021 04:00:22 -0000      1.4
> +++ files/CHANGES.OpenBSD     28 Oct 2021 00:23:53 -0000
> @@ -11,5 +11,8 @@ ports infrastructure, configure.ac was p
>  3.  Disable libuuid, otherwise Python prefers it over the libc uuid
>  functions.
>  
> +4.  Disable MULTIARCH check in configure.ac since OpenBSD is not a
> +multi-arch platform and it causes build problems.
> +
>  These changes are available in the OpenBSD CVS repository
>  <http://www.openbsd.org/anoncvs.html> in ports/lang/python/3.9.
> Index: patches/patch-configure_ac
> ===================================================================
> RCS file: /cvs/ports/lang/python/3.9/patches/patch-configure_ac,v
> retrieving revision 1.4
> diff -u -p -r1.4 patch-configure_ac
> --- patches/patch-configure_ac        1 Sep 2021 17:41:48 -0000       1.4
> +++ patches/patch-configure_ac        28 Oct 2021 00:23:53 -0000
> @@ -2,6 +2,7 @@ $OpenBSD: patch-configure_ac,v 1.4 2021/
>  
>  #1: Set ports library version
>  #2: Don't pick up an installed linux/e2fsprogs libuuid.so
> +#3: OpenBSD isn't multi-arch
>  
>  Index: configure.ac
>  --- configure.ac.orig
> @@ -15,6 +16,26 @@ Index: configure.ac
>   
>   # The later defininition of _XOPEN_SOURCE disables certain features
>   # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
> +@@ -727,7 +727,7 @@ then
> + fi
> + 
> + 
> +-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
> ++MULTIARCH=$(false)
> + AC_SUBST(MULTIARCH)
> + 
> + AC_MSG_CHECKING([for the platform triplet based on compiler 
> characteristics])
> +@@ -743,8 +743,8 @@ cat >> conftest.c <<EOF
> + #undef powerpc
> + #undef sparc
> + #undef unix
> +-#if defined(__ANDROID__)
> +-    # Android is not a multiarch system.
> ++#if defined(__ANDROID__) || defined (__OpenBSD__)
> ++    # Neither Android nor OpenBSD are multiarch systems.
> + #elif defined(__linux__)
> + # if defined(__x86_64__) && defined(__LP64__)
> +         x86_64-linux-gnu
>  @@ -2858,18 +2858,7 @@ AC_CHECK_LIB(dl, dlopen)      # Dynamic linking for 
> SunOS/S
>   AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
>   

Reply via email to