1 |
commit: 98b0d2bb15128cc2054b4785e0f52b7f872380f3 |
2 |
Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 10 15:50:33 2017 +0000 |
4 |
Commit: José María Alonso <nimiux <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 10 15:50:33 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=98b0d2bb |
7 |
|
8 |
dev-lisp/clisp: Adds glibc cfree and bdb patch |
9 |
|
10 |
dev-lisp/clisp/clisp-2.49.60.ebuild | 1 + |
11 |
.../clisp-2.49.60-after_glibc_cfree_bdb.patch | 207 +++++++++++++++++++++ |
12 |
2 files changed, 208 insertions(+) |
13 |
|
14 |
diff --git a/dev-lisp/clisp/clisp-2.49.60.ebuild b/dev-lisp/clisp/clisp-2.49.60.ebuild |
15 |
index a8206d6f..76834662 100644 |
16 |
--- a/dev-lisp/clisp/clisp-2.49.60.ebuild |
17 |
+++ b/dev-lisp/clisp/clisp-2.49.60.ebuild |
18 |
@@ -58,6 +58,7 @@ src_prepare() { |
19 |
if use alpha || use ia64; then |
20 |
sed -i -e 's/-O2//g' src/makemake.in || die |
21 |
fi |
22 |
+ eapply "${FILESDIR}"/"${P}"-after_glibc_cfree_bdb.patch |
23 |
eapply_user |
24 |
} |
25 |
|
26 |
|
27 |
diff --git a/dev-lisp/clisp/files/clisp-2.49.60-after_glibc_cfree_bdb.patch b/dev-lisp/clisp/files/clisp-2.49.60-after_glibc_cfree_bdb.patch |
28 |
new file mode 100644 |
29 |
index 00000000..3ab075ba |
30 |
--- /dev/null |
31 |
+++ b/dev-lisp/clisp/files/clisp-2.49.60-after_glibc_cfree_bdb.patch |
32 |
@@ -0,0 +1,207 @@ |
33 |
+diff --git a/modules/berkeley-db/bdb.c b/modules/berkeley-db/bdb.c |
34 |
+index a266d41..942652a 100644 |
35 |
+--- a/modules/berkeley-db/bdb.c |
36 |
++++ b/modules/berkeley-db/bdb.c |
37 |
+@@ -2216,7 +2216,13 @@ DEFUN(BDB:DB-COMPACT, db &key TRANSACTION :START STOP FREE FILL TIMEOUT \ |
38 |
+ c_data.compact_timeout = timeout; |
39 |
+ c_data.compact_pages = pages; |
40 |
+ SYSCALL(db->compact,(db,txn,pstart,pstop,&c_data,flags,&end)); |
41 |
+- pushSTACK(uint32_to_I(c_data.compact_empty_buckets)); |
42 |
++ /* ==== |
43 |
++ * compact_empty_buckets is in bdb-5.3 as part of output stats |
44 |
++ * however this version use bdb-4.8 which does not have it |
45 |
++ * ==== |
46 |
++ * |
47 |
++ * pushSTACK(uint32_to_I(c_data.compact_empty_buckets)); |
48 |
++ * */ |
49 |
+ pushSTACK(uint32_to_I(c_data.compact_pages_free)); |
50 |
+ pushSTACK(uint32_to_I(c_data.compact_pages_examine)); |
51 |
+ pushSTACK(uint32_to_I(c_data.compact_levels)); |
52 |
+diff --git a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp |
53 |
+index c960753..2993990 100644 |
54 |
+--- a/modules/bindings/glibc/linux.lisp |
55 |
++++ b/modules/bindings/glibc/linux.lisp |
56 |
+@@ -1,7 +1,7 @@ |
57 |
+ ;; Foreign functions provided by the Linux C library version 6, |
58 |
+ ;; i.e. the GNU C library version 2.0.7. |
59 |
+ ;; Bruno Haible 10.4.1998, 19.4.1998 |
60 |
+-;; Sam Steingold 2002-2008, 2011 |
61 |
++;; Sam Steingold 2002-2008, 2011, 2013, 2016-2017 |
62 |
+ |
63 |
+ ;; NB: quite a few functions here have more portable counterparts in POSIX |
64 |
+ |
65 |
+@@ -649,7 +649,6 @@ |
66 |
+ (def-call-out calloc (:arguments (nmemb size_t) (size size_t)) |
67 |
+ (:return-type c-pointer)) |
68 |
+ (def-call-out free (:arguments (ptr c-pointer)) (:return-type nil)) |
69 |
+-(def-call-out cfree (:arguments (ptr c-pointer)) (:return-type nil)) |
70 |
+ (def-call-out valloc (:arguments (size size_t)) (:return-type c-pointer)) |
71 |
+ |
72 |
+ (def-call-out abort (:arguments) (:return-type nil)) |
73 |
+@@ -687,9 +686,8 @@ |
74 |
+ (def-call-out system? (:arguments (null c-string)) |
75 |
+ (:return-type boolean) (:name "system")) |
76 |
+ |
77 |
+-; You can uncomment this if your compiler sets __USE_GNU |
78 |
+-; (def-call-out canonicalize_file_name (:arguments (name c-string)) |
79 |
+-; (:return-type c-string :malloc-free)) |
80 |
++(def-call-out canonicalize_file_name (:arguments (name c-string)) |
81 |
++ (:return-type c-string :malloc-free) (:guard "defined(__USE_GNU)")) |
82 |
+ |
83 |
+ (def-call-out realpath |
84 |
+ (:arguments (name c-string) |
85 |
+@@ -1041,9 +1039,8 @@ |
86 |
+ (def-call-out access (:arguments (name c-string) (type int)) |
87 |
+ (:return-type int)) |
88 |
+ |
89 |
+-; You can uncomment this if your compiler sets __USE_GNU |
90 |
+-; (def-call-out euidaccess (:arguments (name c-string) (type int)) |
91 |
+-; (:return-type int)) |
92 |
++(def-call-out euidaccess (:arguments (name c-string) (type int)) |
93 |
++ (:return-type int) (:guard "defined(__USE_GNU)")) |
94 |
+ |
95 |
+ (defconstant SEEK_SET 0) |
96 |
+ (defconstant SEEK_CUR 1) |
97 |
+@@ -1094,9 +1091,8 @@ |
98 |
+ ;(def-call-out getcwd (:arguments (buf c-string :out) (size size_t)) ; ?? |
99 |
+ ; (:return-type c-string)) |
100 |
+ |
101 |
+-; You can uncomment this if your compiler sets __USE_GNU |
102 |
+-; (def-call-out get_current_dir_name (:arguments) |
103 |
+-; (:return-type c-string :malloc-free)) |
104 |
++(def-call-out get_current_dir_name (:arguments) |
105 |
++ (:return-type c-string :malloc-free) (:guard "defined(__USE_GNU)")) |
106 |
+ |
107 |
+ ;(def-call-out getwd (:arguments (buf c-string :out)) ; ?? |
108 |
+ ; (:return-type c-string)) |
109 |
+@@ -1324,8 +1320,8 @@ |
110 |
+ ; (:arguments (size int) (list (c-ptr (c-array gid_t ??)) :out)) ; ?? |
111 |
+ ; (:return-type int)) |
112 |
+ |
113 |
+-; You can uncomment this if your compiler sets __USE_GNU |
114 |
+-; (def-call-out group_member (:arguments (gid gid_t)) (:return-type boolean)) |
115 |
++(def-call-out group_member (:arguments (gid gid_t)) (:return-type boolean) |
116 |
++ (:guard "defined(__USE_GNU)")) |
117 |
+ (def-call-out setuid (:arguments (uid uid_t)) (:return-type int)) |
118 |
+ (def-call-out setreuid (:arguments (ruid uid_t) (euid uid_t)) |
119 |
+ (:return-type int)) |
120 |
+@@ -1822,8 +1818,8 @@ |
121 |
+ (:return-type c-string :malloc-free)) |
122 |
+ (def-call-out ungetc (:arguments (c int) (fp FILE)) |
123 |
+ (:return-type int)) |
124 |
+-; You can uncomment this if your compiler sets __USE_GNU |
125 |
+-; (def-call-out fcloseall (:arguments) (:return-type int)) |
126 |
++(def-call-out fcloseall (:arguments) (:return-type int) |
127 |
++ (:guard "defined(__USE_GNU)")) |
128 |
+ (def-call-out fdopen (:arguments (fildes int) (mode c-string)) |
129 |
+ (:return-type c-pointer)) |
130 |
+ (def-call-out fileno (:arguments (fp FILE)) (:return-type int)) |
131 |
+@@ -1901,11 +1897,11 @@ typedef __off64_t clisp_dirent_off_t; |
132 |
+ (:return-type (c-ptr-null dirent))) |
133 |
+ (def-call-out readdir64 (:arguments (dirp c-pointer)) |
134 |
+ (:return-type (c-ptr-null dirent64))) |
135 |
+-(def-call-out readdir_r |
136 |
++(def-call-out readdir_r ; deprecated |
137 |
+ (:arguments (dirp c-pointer) (entry (c-ptr dirent) :out :alloca) |
138 |
+ (result (c-ptr (c-ptr dirent)) :out :alloca)) ; ?? |
139 |
+ (:return-type int)) |
140 |
+-(def-call-out readdir64_r |
141 |
++(def-call-out readdir64_r ; deprecated |
142 |
+ (:arguments (dirp c-pointer) (entry (c-ptr dirent64) :out :alloca) |
143 |
+ (result (c-ptr (c-ptr dirent64)) :out :alloca)) ; ?? |
144 |
+ (:return-type int)) |
145 |
+diff --git a/modules/bindings/glibc/test.tst b/modules/bindings/glibc/test.tst |
146 |
+index f807389..b2c1222 100644 |
147 |
+--- a/modules/bindings/glibc/test.tst |
148 |
++++ b/modules/bindings/glibc/test.tst |
149 |
+@@ -5,6 +5,16 @@ |
150 |
+ (progn (require "linux") T) T |
151 |
+ (listp (show (multiple-value-list (ext:module-info "linux" t)) :pretty t)) T |
152 |
+ |
153 |
++(stringp (show (linux:get-domain-name))) T |
154 |
++(stringp (show (linux:get-host-name))) T |
155 |
++ |
156 |
++;; usually __USE_GNU is defined, so this should work: |
157 |
++(let* ((d (linux:get_current_dir_name)) |
158 |
++ (c (linux:canonicalize_file_name (concatenate 'string d "/.")))) |
159 |
++ (or (string= d c) |
160 |
++ (list :cur-dir d :canonical c))) |
161 |
++T |
162 |
++ |
163 |
+ (defparameter *d* (show (linux:opendir "."))) *D* |
164 |
+ (linux:dirent64-d_name (show (linux:readdir64 *d*))) "." |
165 |
+ (linux:dirent64-d_name (show (linux:readdir64 *d*))) ".." |
166 |
+diff --git a/src/foreign1.lisp b/src/foreign1.lisp |
167 |
+index 26a3ba5..0e43de7 100644 |
168 |
+--- a/src/foreign1.lisp |
169 |
++++ b/src/foreign1.lisp |
170 |
+@@ -1,6 +1,6 @@ |
171 |
+ ;;; Foreign function interface for CLISP |
172 |
+ ;;; Bruno Haible 19.2.1995 |
173 |
+-;;; Sam Steingold 1998-2010 |
174 |
++;;; Sam Steingold 1998-2010, 2017 |
175 |
+ |
176 |
+ #+UNICODE |
177 |
+ (progn |
178 |
+@@ -805,14 +805,17 @@ |
179 |
+ c-name (to-c-string c-name) (third variable) (first variable)) |
180 |
+ (when *foreign-guard* (format *coutput-stream* "# endif~%")))) |
181 |
+ (dolist (function *function-list*) |
182 |
+- (let ((c-name (first function))) |
183 |
+- (when *foreign-guard* |
184 |
+- (format *coutput-stream* "# if defined(HAVE_~A)~%" |
185 |
+- (string-upcase c-name))) |
186 |
++ (let ((c-name (first function)) |
187 |
++ (guard (fourth function))) |
188 |
++ (when guard |
189 |
++ (format *coutput-stream* "# if ~A~%" |
190 |
++ (if (eq guard t) |
191 |
++ (format nil "defined(HAVE_~A)" (string-upcase c-name)) |
192 |
++ guard))) |
193 |
+ (format *coutput-stream* |
194 |
+ " register_foreign_function((void*)&~A,~A,~D);~%" |
195 |
+ c-name (to-c-string c-name) (svref (second function) 3)) |
196 |
+- (when *foreign-guard* (format *coutput-stream* "# endif~%")))) |
197 |
++ (when guard (format *coutput-stream* "# endif~%")))) |
198 |
+ (maphash (lambda (type fun-vec) |
199 |
+ (declare (ignore type)) |
200 |
+ (let ((c-name (to-c-name (car fun-vec)))) |
201 |
+@@ -1083,7 +1086,7 @@ |
202 |
+ (defmacro DEF-CALL-OUT (&whole whole-form name &rest options) |
203 |
+ (setq name (check-symbol name (first whole-form))) |
204 |
+ (let* ((alist |
205 |
+- (parse-options options '(:name :arguments :return-type :language |
206 |
++ (parse-options options '(:name :arguments :return-type :language :guard |
207 |
+ :built-in :library :version :documentation) |
208 |
+ whole-form)) |
209 |
+ (def (gensym "DEF-CALL-OUT-")) |
210 |
+@@ -1095,6 +1098,7 @@ |
211 |
+ (version (second (assoc :version alist))) |
212 |
+ (c-name (foreign-name name (assoc :name alist))) |
213 |
+ (built-in (second (assoc :built-in alist))) |
214 |
++ (guard (get-assoc :guard alist '*foreign-guard*)) |
215 |
+ ;; Maximize sharing in .fas file, reuse options |
216 |
+ ;; parse-c-function ignores unknown options, e.g. :name |
217 |
+ (ctype `(PARSE-C-FUNCTION ',options ',whole-form))) |
218 |
+@@ -1102,7 +1106,7 @@ |
219 |
+ ',c-name ,ctype ',properties ,library ,version NIL))) |
220 |
+ (EXT:COMPILER-LET ((,def ,ctype)) |
221 |
+ (EVAL-WHEN (COMPILE) |
222 |
+- (UNLESS ,LIBRARY (NOTE-C-FUN ',c-name ,def ',built-in))) |
223 |
++ (UNLESS ,LIBRARY (NOTE-C-FUN ',c-name ,def ',built-in ,guard))) |
224 |
+ (SYSTEM::EVAL-WHEN-COMPILE |
225 |
+ (SYSTEM::C-DEFUN ',name (C-TYPE-TO-SIGNATURE ,ctype)))) |
226 |
+ (WHEN ,def ; found library function |
227 |
+@@ -1110,10 +1114,10 @@ |
228 |
+ (SYSTEM::%PUTD ',name ,def)) |
229 |
+ ',name))) |
230 |
+ |
231 |
+-(defun note-c-fun (c-name ctype built-in) ; not ABI, compile-time only |
232 |
++(defun note-c-fun (c-name ctype built-in guard) ; not ABI, compile-time only |
233 |
+ (when (system::prepare-coutput-file) |
234 |
+ (prepare-module) |
235 |
+- (push (list c-name ctype built-in) |
236 |
++ (push (list c-name ctype built-in guard) |
237 |
+ *function-list*))) |
238 |
+ |
239 |
+ (defun count-inarguments (arg-vector) |