[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-devel
Subject:    [Sbcl-devel] patch for build newest sbcl on old linux box
From:       SANO Masatoshi <snmsts () gmail ! com>
Date:       2023-01-24 12:29:31
Message-ID: CAH6JMphRVG=Ox=wkK9O_UtKw-b+fGG1f5Pqp6au-D0Q5Ur-SwA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi I had a chance to try building sbcl on old linux box with new gcc.
Needed to care some symbols.

[Attachment #5 (text/html)]

<div dir="ltr">Hi I had a chance to try building sbcl on old linux box with new \
gcc.<div>Needed to care some symbols.</div><div><br></div></div>

--0000000000009516b105f301abe2--


["0001-build-on-linux-glib2.5-gcc5.2.0.patch" (application/octet-stream)]

diff --git a/src/code/unix.lisp b/src/code/unix.lisp
index 91dfbcd66..55bd470b3 100644
--- a/src/code/unix.lisp
+++ b/src/code/unix.lisp
@@ -1021,7 +1021,10 @@ the UNIX epoch (January 1st 1970.)"
           ;; By scaling down we end up with far less resolution than clock-realtime
           ;; offers, and COARSE is about twice as fast, so use that, but only for linux.
           ;; BSD has something similar.
-          (clock-gettime #+linux clock-monotonic-coarse #-linux clock-monotonic)
+          (clock-gettime #+linux #.(if (boundp 'clock-monotonic-coarse)
+                                       clock-monotonic-coarse
+                                       clock-monotonic)
+                         #-linux clock-monotonic)
 
         #+64-bit ;; I know that my math is valid for 64-bit.
         (declare (optimize (sb-c::type-check 0)))
diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c
index b2075f19f..2e426a7cd 100644
--- a/src/runtime/linux-os.c
+++ b/src/runtime/linux-os.c
@@ -58,6 +58,10 @@ int personality (unsigned long);
 #define ADDR_NO_RANDOMIZE 0x0040000
 #else
 #include <sys/personality.h>
+#if defined(LISP_FEATURE_X86_64) && !defined(ADDR_NO_RANDOMIZE)
+/* definition isn't available on old version of glibc on x86_64 */
+#define ADDR_NO_RANDOMIZE 0x0040000
+#endif
 #endif
 
 #ifdef LISP_FEATURE_SB_FUTEX
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index 8c6619d9f..c4a923bea 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -616,7 +616,7 @@ initialize_lisp(int argc, char *argv[], char *envp[])
 #endif
 #ifdef LISP_FEATURE_UNIX
     clock_gettime(
-#ifdef LISP_FEATURE_LINUX
+#if defined(CLOCK_MONOTONIC_COARSE) && defined(LISP_FEATURE_LINUX)
         CLOCK_MONOTONIC_COARSE
 #else
         CLOCK_MONOTONIC
diff --git a/src/runtime/thread.c b/src/runtime/thread.c
index 948ee42ca..568923b03 100644
--- a/src/runtime/thread.c
+++ b/src/runtime/thread.c
@@ -540,9 +540,11 @@ void* new_thread_trampoline(void* arg)
          *  restricted to 16 characters, including the terminating null byte ('\0').
          *  The pthread_setname_np() function can fail with the following error:
          *  ERANGE The length of the string ... exceeds the allowed limit." */
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)
         if (vector_len(VECTOR(name)) <= 15)
             pthread_setname_np(pthread_self(), (char*)VECTOR(name)->data);
 #endif
+#endif
 #ifdef LISP_FEATURE_NETBSD
         /* This constant is an upper bound on the length including the NUL.
          * Exceeding it will fail the call. It happens to be 32.
diff --git a/tools-for-build/grovel-headers.c b/tools-for-build/grovel-headers.c
index 1fc1fa002..31cd4caa9 100644
--- a/tools-for-build/grovel-headers.c
+++ b/tools-for-build/grovel-headers.c
@@ -353,12 +353,18 @@ main(int argc, char __attribute__((unused)) *argv[])
 #ifdef CLOCK_REALTIME_ALARM
     defconstant("clock-realtime-alarm", CLOCK_REALTIME_ALARM);
 #endif
+#ifdef CLOCK_REALTIME_COARSE
     defconstant("clock-realtime-coarse", CLOCK_REALTIME_COARSE);
+#endif
 #ifdef CLOCK_TAI
     defconstant("clock-tai", CLOCK_TAI); // International Atomic Time.
 #endif
+#ifdef CLOCK_MONOTONIC_COARSE
     defconstant("clock-monotonic-coarse", CLOCK_MONOTONIC_COARSE);
+#endif
+#ifdef CLOCK_MONOTONIC_RAW
     defconstant("clock-monotonic-raw", CLOCK_MONOTONIC_RAW);
+#endif
 #ifdef CLOCK_BOOTTIME
     defconstant("clock-boottime", CLOCK_BOOTTIME);
 #endif




_______________________________________________
Sbcl-devel mailing list
Sbcl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic