Edd Barrett avatar Edd Barrett committed f0031ea

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

And more generally, if you have gettimeofday(2) you will not need ftime(3).

Comments (0)

Files changed (2)

rpython/rtyper/module/ll_time.py

                 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)) +

rpython/translator/platform/openbsd.py

              ] + 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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.