1. Pypy
  2. Untitled project
  3. pypy

Commits

Ronan Lamy  committed d545cec Merge

Merged in vext01/pypy/better_ftime_detect2 (pull request #201)

On OpenBSD do not pull in libcompat.a as it is about to be removed.

  • Participants
  • Parent commits bb3fa3d, f0031ea
  • Branches default

Comments (0)

Files changed (2)

File rpython/rtyper/module/ll_time.py

View file
                 c_gettimeofday = self.llexternal('gettimeofday',
                                  [self.TIMEVALP, rffi.VOIDP], rffi.INT,
                                   _nowrapper=True, releasegil=False)
+            c_ftime = None # We have gettimeofday(2), so force ftime(3) OFF.
         else:
             c_gettimeofday = None
 
-        if self.HAVE_FTIME:
-            self.configure(CConfigForFTime)
-            c_ftime = self.llexternal(FTIME, [lltype.Ptr(self.TIMEB)],
-                                      lltype.Void,
-                                      _nowrapper=True, releasegil=False)
-        else:
-            c_ftime = None    # to not confuse the flow space
+            # Only look for ftime(3) if gettimeofday(2) was not found.
+            if self.HAVE_FTIME:
+                self.configure(CConfigForFTime)
+                c_ftime = self.llexternal(FTIME, [lltype.Ptr(self.TIMEB)],
+                                          lltype.Void,
+                                          _nowrapper=True, releasegil=False)
+            else:
+                c_ftime = None    # to not confuse the flow space
 
         c_time = self.llexternal('time', [rffi.VOIDP], rffi.TIME_T,
                                  _nowrapper=True, releasegil=False)
                 if rffi.cast(rffi.LONG, errcode) == 0:
                     result = decode_timeval(t)
                 lltype.free(t, flavor='raw')
-            if result != -1:
-                return result
-            if self.HAVE_FTIME:
+                if result != -1:
+                    return result
+            else: # assume using ftime(3)
                 t = lltype.malloc(self.TIMEB, flavor='raw')
                 c_ftime(t)
                 result = (float(intmask(t.c_time)) +

File rpython/translator/platform/openbsd.py

View file
              ] + os.environ.get("CFLAGS", "").split()
 
     def _libs(self, libraries):
-        libraries=set(libraries + ("intl", "iconv", "compat"))
+        libraries=set(libraries + ("intl", "iconv"))
         return ['-l%s' % lib for lib in libraries if lib not in ["crypt", "dl", "rt"]]
 
 class OpenBSD_64(OpenBSD):