2 * stubs for C-linkage library functions which we need to refer to
5 * (But note this is only the Linux version, as per the FIXME
6 * note in the BSD version in undefineds.h.)
8 * These stubs exist for the benefit of Lisp code that needs to refer
9 * to foreign symbols when dlsym() is not available (i.e. when dumping
10 * cold-sbcl.core, when we may be running in a host that's not SBCL,
11 * or on platforms that don't have it at all). If the runtime is
12 * dynamically linked, library functions won't be linked into it, so
13 * the map file won't show them. So, we need a bunch of stubs that
18 * This software is part of the SBCL system. See the README file for
21 * This software is derived from the CMU CL system, which was
22 * written at Carnegie Mellon University and released into the
23 * public domain. The software is in the public domain and is
24 * provided with absolutely no warranty. See the COPYING and CREDITS
25 * files for more information.
30 #if defined LISP_FEATURE_X86
32 #define LDSO_STUBIFY(fct) \
34 .globl ldso_stub__ ## fct ; \
35 .type ldso_stub__ ## fct,@function ; \
36 ldso_stub__ ## fct: ; \
39 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
41 #elif ((defined LISP_FEATURE_OSF1) && (defined LISP_FEATURE_ALPHA))
42 /* osf1 has ancient cpp that doesn't do ## */
43 #define LDSO_STUBIFY(fct) \
44 .globl ldso_stub__/**/fct ; \
45 ldso_stub__/**/fct: ; \
50 #elif ((defined LISP_FEATURE_LINUX) && (defined LISP_FEATURE_ALPHA))
51 /* but there's no reason we need to put up with that on modern (Linux) OSes */
52 #define LDSO_STUBIFY(fct) \
53 .globl ldso_stub__ ## fct ; \
54 .type ldso_stub__ ## fct,@function ; \
55 ldso_stub__ ## fct: ; \
58 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
60 #elif defined LISP_FEATURE_PPC
61 #define LDSO_STUBIFY(fct) \
62 .globl ldso_stub__ ## fct ; \
63 .type ldso_stub__ ## fct,@function ; \
64 ldso_stub__ ## fct: ; \
67 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
69 #elif defined LISP_FEATURE_SPARC
71 /* This is an attempt to follow DB's hint of sbcl-devel
72 * 2001-09-18. -- CSR */
73 #define LDSO_STUBIFY(fct) \
74 .globl ldso_stub__ ## fct ; \
75 .type ldso_stub__ ## fct,@function ; \
76 ldso_stub__ ## fct: ; \
77 sethi %hi(fct),%g1 ; \
78 jmpl %g1+%lo(fct),%g0 ; \
79 nop /* delay slot*/ ; \
81 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
84 #error unsupported CPU architecture
95 LDSO_STUBIFY(cfgetispeed)
96 LDSO_STUBIFY(cfgetospeed)
97 LDSO_STUBIFY(cfsetispeed)
98 LDSO_STUBIFY(cfsetospeed)
102 LDSO_STUBIFY(closedir)
103 LDSO_STUBIFY(connect)
106 LDSO_STUBIFY(dlclose)
107 LDSO_STUBIFY(dlerror)
121 LDSO_STUBIFY(ftruncate)
123 LDSO_STUBIFY(getdtablesize)
124 LDSO_STUBIFY(getegid)
127 LDSO_STUBIFY(gethostbyaddr)
128 LDSO_STUBIFY(gethostbyname)
129 LDSO_STUBIFY(gethostname)
130 LDSO_STUBIFY(getitimer)
131 LDSO_STUBIFY(getpagesize)
132 LDSO_STUBIFY(getpeername)
133 LDSO_STUBIFY(getpgrp)
135 LDSO_STUBIFY(getppid)
136 LDSO_STUBIFY(getrusage)
137 LDSO_STUBIFY(getsockname)
138 LDSO_STUBIFY(gettimeofday)
151 LDSO_STUBIFY(memmove)
154 LDSO_STUBIFY(opendir)
158 LDSO_STUBIFY(readdir)
159 LDSO_STUBIFY(readlink)
165 LDSO_STUBIFY(setitimer)
166 LDSO_STUBIFY(setpgrp)
168 LDSO_STUBIFY(sigsetmask)
173 LDSO_STUBIFY(strerror)
175 LDSO_STUBIFY(symlink)
178 LDSO_STUBIFY(tcdrain)
180 LDSO_STUBIFY(tcflush)
181 LDSO_STUBIFY(tcgetattr)
182 LDSO_STUBIFY(tcsendbreak)
183 LDSO_STUBIFY(tcsetattr)
184 LDSO_STUBIFY(truncate)
185 LDSO_STUBIFY(ttyname)
193 * These aren't needed on the X86 because they're microcoded into the
194 * FPU, so the Lisp VOPs can implement them directly without having to
197 * Note: There might be some other functions in this category as well.
198 * E.g. I notice tanh() and acos() in the list above.. -- WHN 2001-06-07
200 #if !defined __i386__
212 LDSO_STUBIFY(ieee_get_fp_control)
213 LDSO_STUBIFY(ieee_set_fp_control)