pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: devel/py-meson on NetBSD/aarch64



On Fri, Aug 23, 2019 at 01:43:38PM +0000, nia wrote:
> On Fri, Aug 23, 2019 at 02:26:38PM +0100, Robert Swindells wrote:
> > 
> > Trying to build graphics/MesaLib on NetBSD/aarch64 I get this warning:
> > 
> > WARNING: Unknown CPU family 'evbarm', please report this at https://github.com/mesonbuild/meson/issues/new with theoutput of `uname -a` and `cat /proc/cpuinfo`
> > Build machine cpu family: evbarm
> > Build machine cpu: evbarm
> 
> It seems to be using platform.machine() from the Python standard
> library:
> 
> https://docs.python.org/3/library/platform.html
> 
> We probably can't just add evbarm to the list of architectures it
> understands, it needs to differenciate between 32-bit and 64-bit.
> 
> What does platform.processor() return on NetBSD aarch64?

Can you test this patch?

Also, can someone test this on 32-bit evbarm?

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-meson/Makefile,v
retrieving revision 1.28
diff -u -r1.28 Makefile
--- Makefile	23 Aug 2019 11:07:00 -0000	1.28
+++ Makefile	23 Aug 2019 14:08:49 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.28 2019/08/23 11:07:00 nia Exp $
 
 DISTNAME=	meson-0.51.1
-PKGREVISION=	3
+PKGREVISION=	4
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITE_PYPI:=m/meson/}
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-meson/distinfo,v
retrieving revision 1.25
diff -u -r1.25 distinfo
--- distinfo	23 Aug 2019 11:07:00 -0000	1.25
+++ distinfo	23 Aug 2019 14:08:49 -0000
@@ -7,5 +7,5 @@
 SHA1 (patch-mesonbuild_compilers_compilers.py) = 08404a441ec8ba37c780af4fba44492021f858dd
 SHA1 (patch-mesonbuild_dependencies_dev.py) = 068b7e6a105eec694c469f0bf50324385900f91f
 SHA1 (patch-mesonbuild_envconfig.py) = 82199f5ed59d368b76c932112da7d42e2f32001a
-SHA1 (patch-mesonbuild_environment.py) = 7df96002a8b625cfa08b88cfa4f0cf4d5b76cf64
+SHA1 (patch-mesonbuild_environment.py) = cede400a52da51ac2d8a9b8cfc28142e7228cc31
 SHA1 (patch-mesonbuild_scripts_depfixer.py) = 6ed6fdfd7454b517ad5d1ebd1c387ebd73437d4b
Index: patches/patch-mesonbuild_environment.py
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-meson/patches/patch-mesonbuild_environment.py,v
retrieving revision 1.4
diff -u -r1.4 patch-mesonbuild_environment.py
--- patches/patch-mesonbuild_environment.py	6 Jul 2019 22:42:25 -0000	1.4
+++ patches/patch-mesonbuild_environment.py	23 Aug 2019 14:08:49 -0000
@@ -1,10 +1,52 @@
 $NetBSD: patch-mesonbuild_environment.py,v 1.4 2019/07/06 22:42:25 adam Exp $
 
+Support NetBSD aarch64 and earm.
+
 Support SunOS ar and SunOS-specific GCC behaviour.
 
---- mesonbuild/environment.py.orig	2019-06-16 18:54:18.000000000 +0000
+--- mesonbuild/environment.py.orig	2019-07-09 16:34:42.000000000 +0000
 +++ mesonbuild/environment.py
-@@ -613,6 +613,8 @@ class Environment:
+@@ -215,6 +215,10 @@ def detect_cpu_family(compilers: Compile
+     """
+     if mesonlib.is_windows():
+         trial = detect_windows_arch(compilers)
++    elif platform.system() == 'NetBSD':
++        # platform.machine() returns the "machine type" on NetBSD, not CPU
++        # family, e.g. 'evbarm' is returned on aarch64.
++        trial = platform.processor().lower()
+     else:
+         trial = platform.machine().lower()
+     if trial.startswith('i') and trial.endswith('86'):
+@@ -224,7 +228,7 @@ def detect_cpu_family(compilers: Compile
+     # OpenBSD's 64 bit arm architecute identifies as 'arm64'
+     elif trial == 'arm64':
+         trial = 'aarch64'
+-    elif trial.startswith('arm'):
++    elif trial.startswith('arm') or trial.startswith('earm'):
+         trial = 'arm'
+     elif trial.startswith('ppc64'):
+         trial = 'ppc64'
+@@ -271,6 +275,10 @@ def detect_cpu_family(compilers: Compile
+ def detect_cpu(compilers: CompilersDict):
+     if mesonlib.is_windows():
+         trial = detect_windows_arch(compilers)
++    elif platform.system() == 'NetBSD':
++        # platform.machine() returns the "machine type" on NetBSD, not CPU
++        # family, e.g. 'evbarm' is returned on aarch64.
++        trial = platform.processor().lower()
+     else:
+         trial = platform.machine().lower()
+     if trial in ('amd64', 'x64'):
+@@ -283,6 +291,8 @@ def detect_cpu(compilers: CompilersDict)
+         # Same check as above for cpu_family
+         if any_compiler_has_define(compilers, '__arm__'):
+             trial = 'arm'
++    elif trial.startswith('earm'):
++            trial = 'arm'
+     elif trial == 'e2k':
+         # Make more precise CPU detection for Elbrus platform.
+         trial = platform.processor().lower()
+@@ -613,6 +623,8 @@ class Environment:
              return CompilerType.GCC_MINGW
          elif '__CYGWIN__' in defines:
              return CompilerType.GCC_CYGWIN
@@ -13,7 +55,7 @@
          return CompilerType.GCC_STANDARD
  
      def _get_compilers(self, lang, for_machine):
-@@ -1220,6 +1222,8 @@ class Environment:
+@@ -1220,6 +1232,8 @@ class Environment:
                  return ArLinker(linker)
              if p.returncode == 1 and err.startswith('usage'): # OSX
                  return ArLinker(linker)



Home | Main Index | Thread Index | Old Index