Your message dated Sat, 18 Aug 2018 19:34:15 +0000
with message-id <[email protected]>
and subject line Bug#904076: fixed in pypy 6.0.0+dfsg-2
has caused the Debian Bug report #904076,
regarding pypy: hurd support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
904076: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904076
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: pypy
Version: 6.0.0+dfsg-1
Severity: important
Tags: patch upstream
Forwarded: https://bitbucket.org/pypy/pypy/issues/2848/gnu-hurd-port
User: [email protected]
User-tags: hurd

Hello,

pypy is becoming more and more a dependence for a lot of packages. I
have worked on the hurd port, here is the patch I have come up with and
submitted to https://bitbucket.org/pypy/pypy/issues/2848/gnu-hurd-port
There were a couple of issues which were fixed upstream, I have also
attached the patches.

Samuel

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'stable-debug'), (500, 'oldoldstable'), (500, 
'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.17.0 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Samuel
Now, it we had this sort of thing:
  yield -a     for yield to all traffic
  yield -t     for yield to trucks
  yield -f     for yield to people walking (yield foot)
  yield -d t*  for yield on days starting with t
...you'd have a lot of dead people at intersections, and traffic jams you
wouldn't believe...
(Discussion in comp.os.linux.misc on the intuitiveness of commands.)
Index: pypy-6.0.0+dfsg/rpython/translator/platform/__init__.py
===================================================================
--- pypy-6.0.0+dfsg.orig/rpython/translator/platform/__init__.py
+++ pypy-6.0.0+dfsg/rpython/translator/platform/__init__.py
@@ -310,6 +310,13 @@ elif "openbsd" in sys.platform:
         host_factory = OpenBSD
     else:
         host_factory = OpenBSD_64
+elif sys.platform.startswith('gnu'):
+    from rpython.translator.platform.hurd import Hurd
+    import platform
+    if platform.architecture()[0] == '32bit':
+        host_factory = Hurd
+    else:
+        host_factory = Hurd_64
 elif os.name == 'nt':
     from rpython.translator.platform.windows import Windows, Windows_x64
     import platform
Index: pypy-6.0.0+dfsg/rpython/translator/platform/hurd.py
===================================================================
--- /dev/null
+++ pypy-6.0.0+dfsg/rpython/translator/platform/hurd.py
@@ -0,0 +1,42 @@
+"""Support for Hurd."""
+
+import os
+import platform
+import sys
+from rpython.translator.platform.posix import BasePosix
+
+class BaseHurd(BasePosix):
+    name = "hurd"
+
+    link_flags = tuple(
+                 ['-pthread',]
+                 + os.environ.get('LDFLAGS', '').split())
+    extra_libs = ('-lrt',)
+    cflags = tuple(
+             ['-O3', '-pthread', '-fomit-frame-pointer',
+              '-Wall', '-Wno-unused', '-Wno-address']
+             + os.environ.get('CFLAGS', '').split())
+    standalone_only = ()
+    shared_only = ('-fPIC',)
+    so_ext = 'so'
+
+    def _args_for_shared(self, args, **kwds):
+        return ['-shared'] + args
+
+    def _include_dirs_for_libffi(self):
+        return self._pkg_config("libffi", "--cflags-only-I",
+                                ['/usr/include/libffi'],
+                                check_result_dir=True)
+
+    def _library_dirs_for_libffi(self):
+        return self._pkg_config("libffi", "--libs-only-L",
+                                ['/usr/lib/libffi'],
+                                check_result_dir=True)
+
+
+class Hurd(BaseHurd):
+    shared_only = () # it seems that on 32-bit GNU, compiling with -fPIC
+                     # gives assembler that asmgcc is not happy about.
+
+class HurdPIC(BaseHurd):
+    pass
Index: pypy-6.0.0+dfsg/rpython/rlib/rposix.py
===================================================================
--- pypy-6.0.0+dfsg.orig/rpython/rlib/rposix.py
+++ pypy-6.0.0+dfsg/rpython/rlib/rposix.py
@@ -1086,9 +1086,12 @@ def _make_waitmacro(name):
         else:
             return bool(c_func(status))
 
-WAIT_MACROS = ['WCOREDUMP', 'WIFCONTINUED', 'WIFSTOPPED',
+WAIT_MACROS = ['WCOREDUMP', 'WIFSTOPPED',
                'WIFSIGNALED', 'WIFEXITED',
                'WEXITSTATUS', 'WSTOPSIG', 'WTERMSIG']
+if not sys.platform.startswith('gnu'):
+    WAIT_MACROS.append('WIFCONTINUED')
+
 for name in WAIT_MACROS:
     _make_waitmacro(name)
 
Index: pypy-6.0.0+dfsg/rpython/jit/backend/detect_cpu.py
===================================================================
--- pypy-6.0.0+dfsg.orig/rpython/jit/backend/detect_cpu.py
+++ pypy-6.0.0+dfsg/rpython/jit/backend/detect_cpu.py
@@ -57,6 +57,7 @@ def detect_model_from_host_platform():
             'i486': MODEL_X86,
             'i586': MODEL_X86,
             'i686': MODEL_X86,
+            'i686-AT386': MODEL_X86,
             'i86pc': MODEL_X86,    # Solaris/Intel
             'x86': MODEL_X86,      # Apple
             'Power Macintosh': MODEL_PPC_64,
Index: pypy-6.0.0+dfsg/pypy/module/_multiprocessing/interp_semaphore.py
===================================================================
--- pypy-6.0.0+dfsg.orig/pypy/module/_multiprocessing/interp_semaphore.py
+++ pypy-6.0.0+dfsg/pypy/module/_multiprocessing/interp_semaphore.py
@@ -57,7 +57,10 @@ else:
         TIMESPEC = platform.Struct('struct timespec', [('tv_sec', rffi.TIME_T),
                                                        ('tv_nsec', rffi.LONG)])
         SEM_FAILED = platform.ConstantInteger('SEM_FAILED')
-        SEM_VALUE_MAX = platform.ConstantInteger('SEM_VALUE_MAX')
+        if sys.platform.startswith('gnu'):
+            SEM_VALUE_MAX = sys.maxint
+        else:
+            SEM_VALUE_MAX = platform.ConstantInteger('SEM_VALUE_MAX')
         SEM_TIMED_WAIT = platform.Has('sem_timedwait')
         SEM_T_SIZE = platform.SizeOf('sem_t')
 
@@ -69,7 +72,10 @@ else:
     SEM_T          = rffi.COpaquePtr('sem_t', compilation_info=eci)
     #                rffi.cast(SEM_T, config['SEM_FAILED'])
     SEM_FAILED     = config['SEM_FAILED']
-    SEM_VALUE_MAX  = config['SEM_VALUE_MAX']
+    if sys.platform.startswith('gnu'):
+        SEM_VALUE_MAX = sys.maxint
+    else:
+        SEM_VALUE_MAX  = config['SEM_VALUE_MAX']
     SEM_TIMED_WAIT = config['SEM_TIMED_WAIT']
     SEM_T_SIZE = config['SEM_T_SIZE']
     if sys.platform == 'darwin':
# HG changeset patch
# User Armin Rigo <[email protected]>
# Date 1530647130 -7200
#      Tue Jul 03 21:45:30 2018 +0200
# Node ID 60d37209763ded4f11bfdb86d7e1700109b9ce8e
# Parent  55061f499bd529fa3efa23e47c77c22133884d99
Fix rvmprof/dummy: stop_sampling() is supposed to return an integer, not None

diff -r 55061f499bd5 -r 60d37209763d rpython/rlib/rvmprof/dummy.py
--- a/rpython/rlib/rvmprof/dummy.py     Sun Jul 01 22:39:13 2018 +0200
+++ b/rpython/rlib/rvmprof/dummy.py     Tue Jul 03 21:45:30 2018 +0200
@@ -23,4 +23,4 @@
         pass
 
     def stop_sampling(self):
-        pass
+        return -1
# HG changeset patch
# User Armin Rigo <[email protected]>
# Date 1531903611 -7200
#      Wed Jul 18 10:46:51 2018 +0200
# Node ID 0ee5333ce97ea580ca99c024fec9afd96b7e0db4
# Parent  94d4f08d6056245f7615d019d24d2469e8c3ee6f
rvmprof.dummy is not really working, at least for pypy.  Try to fix it some 
more,
but give up for now.  Instead, robustly detect that vmprof is not supported from
pypyoption and disable the '_vmprof' and 'faulthandler' modules.

diff -r 94d4f08d6056 -r 0ee5333ce97e pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py Tue Jul 17 12:32:16 2018 +0200
+++ b/pypy/config/pypyoption.py Wed Jul 18 10:46:51 2018 +0200
@@ -39,14 +39,10 @@
     "_csv", "_cppyy", "_pypyjson", "_jitlog"
 ])
 
-from rpython.jit.backend import detect_cpu
-try:
-    if detect_cpu.autodetect().startswith('x86'):
-        if not sys.platform.startswith('openbsd'):
-            working_modules.add('_vmprof')
-            working_modules.add('faulthandler')
-except detect_cpu.ProcessorAutodetectError:
-    pass
+import rpython.rlib.rvmprof.cintf
+if rpython.rlib.rvmprof.cintf.IS_SUPPORTED:
+    working_modules.add('_vmprof')
+    working_modules.add('faulthandler')
 
 translation_modules = default_modules.copy()
 translation_modules.update([
@@ -318,3 +314,4 @@
     parser = to_optparse(config) #, useoptions=["translation.*"])
     option, args = parser.parse_args()
     print config
+    print working_modules
diff -r 94d4f08d6056 -r 0ee5333ce97e rpython/rlib/rvmprof/dummy.py
--- a/rpython/rlib/rvmprof/dummy.py     Tue Jul 17 12:32:16 2018 +0200
+++ b/rpython/rlib/rvmprof/dummy.py     Wed Jul 18 10:46:51 2018 +0200
@@ -1,6 +1,7 @@
 from rpython.rlib.objectmodel import specialize
 
 class DummyVMProf(object):
+    is_enabled = False
 
     def __init__(self):
         self._unique_id = 0
diff -r 94d4f08d6056 -r 0ee5333ce97e rpython/rlib/rvmprof/rvmprof.py
--- a/rpython/rlib/rvmprof/rvmprof.py   Tue Jul 17 12:32:16 2018 +0200
+++ b/rpython/rlib/rvmprof/rvmprof.py   Wed Jul 18 10:46:51 2018 +0200
@@ -23,6 +23,7 @@
 VMPROF_GC_TAG = 5
 
 class VMProfError(Exception):
+    msg = ''   # annotation hack
     def __init__(self, msg):
         self.msg = msg
     def __str__(self):
diff -r 94d4f08d6056 -r 0ee5333ce97e rpython/rlib/rvmprof/traceback.py
--- a/rpython/rlib/rvmprof/traceback.py Tue Jul 17 12:32:16 2018 +0200
+++ b/rpython/rlib/rvmprof/traceback.py Wed Jul 18 10:46:51 2018 +0200
@@ -13,6 +13,8 @@
     array_length).  The caller must free array_p.  Not for signal handlers:
     for these, call vmprof_get_traceback() from C code.
     """
+    if not cintf.IS_SUPPORTED:
+        return (None, 0)
     _cintf = rvmprof._get_vmprof().cintf
     size = estimate_number_of_entries * 2 + 4
     stack = cintf.get_rvmprof_stack()
@@ -47,6 +49,8 @@
     'code_obj' may be None if it can't be determined.  'loc' is one
     of the LOC_xxx constants.
     """
+    if not cintf.IS_SUPPORTED:
+        return
     i = 0
     while i < array_length - 1:
         tag = array_p[i]

--- End Message ---
--- Begin Message ---
Source: pypy
Source-Version: 6.0.0+dfsg-2

We believe that the bug you reported is fixed in the latest version of
pypy, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stefano Rivera <[email protected]> (supplier of updated pypy package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 18 Aug 2018 12:18:35 -0700
Source: pypy
Binary: pypy pypy-tk pypy-lib pypy-lib-testsuite pypy-doc pypy-dev
Architecture: source
Version: 6.0.0+dfsg-2
Distribution: unstable
Urgency: medium
Maintainer: Stefano Rivera <[email protected]>
Changed-By: Stefano Rivera <[email protected]>
Description:
 pypy       - fast alternative implementation of Python - PyPy interpreter
 pypy-dev   - header files for PyPy (an alternative Python interpreter)
 pypy-doc   - developer Documentation for PyPy (an alternative Python interpret
 pypy-lib   - standard library for PyPy (an alternative Python interpreter)
 pypy-lib-testsuite - standard library test suite for PyPy (an alternative 
Python inter
 pypy-tk    - Tkinter module for PyPy (an alternative Python interpreter)
Closes: 904076 904521
Changes:
 pypy (6.0.0+dfsg-2) unstable; urgency=medium
 .
   * Add support for hurd-i386 (Closes: #904076), with some patches from
     upstream. Thanks Samuel Thibault.
     - rvmprof-dummy: A fix for rvmprof.dummy
     - avoid-rvmprof-dummy: Disable rvmprof on platforms that won't support it
     - hurd: The main platform support patch.
   * pypy{compile,clean}: Don't attempt to byte-compile (or clean) python
     scripts in /usr/share/doc, when using the -p flag to find all scripts in a
     package. (Closes: #904521)
   * Add temporary cleanup code to pypyclean, removing any byte-compiled files
     that were created due to the above bug.
   * Bump Standards-Version to 4.2.0, no changes needed.
Checksums-Sha1:
 e17b84bc9db76c5857d1a15894443826bfb20805 2226 pypy_6.0.0+dfsg-2.dsc
 749d1886d3127994517ef20e4b0e83c291eef3a5 71780 pypy_6.0.0+dfsg-2.debian.tar.xz
 016154d8f5427e62e835d1e28611acca18e9c4a8 8511 
pypy_6.0.0+dfsg-2_source.buildinfo
Checksums-Sha256:
 51821e2ad61b97323a376de467cc6a26a3cc14da6915a211f753d30b77776eaa 2226 
pypy_6.0.0+dfsg-2.dsc
 ab5eba03d9df95b5de1fb7444efc562d5d1b3d363e50cfff3531acce253769e6 71780 
pypy_6.0.0+dfsg-2.debian.tar.xz
 4f32896bc7489755231ddd1d212d91d109e380efe1927618edb1f5aaced8285a 8511 
pypy_6.0.0+dfsg-2_source.buildinfo
Files:
 f1a62703339bd4d277426d2310212e5d 2226 python optional pypy_6.0.0+dfsg-2.dsc
 4108965a684a1b0ebfcf1b48735183c0 71780 python optional 
pypy_6.0.0+dfsg-2.debian.tar.xz
 c6109c99c7c976760ba15429bacbbd27 8511 python optional 
pypy_6.0.0+dfsg-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQFIBAEBCgAyFiEE/zEtpbjiRmXHk+j/6vGSvKo/D1EFAlt4cSgUHHN0ZWZhbm9y
QGRlYmlhbi5vcmcACgkQ6vGSvKo/D1H0Rgf/dcmHsh1J7YRpF9FUjkSvy7KNpsXT
xj2gvIRDzn6tXESG4xxV/079KNH3O+bS74RHg3+wjqh1wI64oRTBw/1ZPS69p8gl
b3ieYwjoMe08NnqD0nrOdvYMHz3CCl3R8FDY8Cm1Ilrfg9GSiDsRuACtWPGVKHbJ
VE3tdbDKlP4bBgvrePVk8It3Bf/AkPqIxWFdDWEAU4pPwQ51Ja8PjbXWf+v/+W7n
QrYV65M2ADtgH/lhrfpphXYfuTcESb9r+Lp0f7qB7qFginETvkIVZZDDMjLrweSe
lKbiJfGMm0+zmVc8PwJVpzLSSZ8LAmN1C062D4Q2n73hcRpbDk51fGzt0Q==
=41MJ
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to