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.
27 #define LANGUAGE_ASSEMBLY
31 #if defined LISP_FEATURE_X86
33 #define LDSO_STUBIFY(fct) \
35 .globl ldso_stub__ ## fct ; \
36 .type ldso_stub__ ## fct,@function ; \
37 ldso_stub__ ## fct: ; \
40 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
42 #elif ((defined LISP_FEATURE_OSF1) && (defined LISP_FEATURE_ALPHA))
43 /* osf1 has ancient cpp that doesn't do ## */
44 #define LDSO_STUBIFY(fct) \
45 .globl ldso_stub__/**/fct ; \
46 ldso_stub__/**/fct: ; \
51 #elif ((defined LISP_FEATURE_LINUX) && (defined LISP_FEATURE_ALPHA))
52 /* but there's no reason we need to put up with that on modern (Linux) OSes */
53 #define LDSO_STUBIFY(fct) \
54 .globl ldso_stub__ ## fct ; \
55 .type ldso_stub__ ## fct,@function ; \
56 ldso_stub__ ## fct: ; \
59 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
61 #elif defined LISP_FEATURE_PPC
62 #define LDSO_STUBIFY(fct) \
63 .globl ldso_stub__ ## fct ; \
64 .type ldso_stub__ ## fct,@function ; \
65 ldso_stub__ ## fct: ; \
68 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
70 #elif defined LISP_FEATURE_SPARC
72 /* This is an attempt to follow DB's hint of sbcl-devel
73 * 2001-09-18. -- CSR */
74 #define LDSO_STUBIFY(fct) \
75 .globl ldso_stub__ ## fct ; \
76 .type ldso_stub__ ## fct,@function ; \
77 ldso_stub__ ## fct: ; \
78 sethi %hi(fct),%g1 ; \
79 jmpl %g1+%lo(fct),%g0 ; \
80 nop /* delay slot*/ ; \
82 .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ;
85 #error unsupported CPU architecture
96 LDSO_STUBIFY(cfgetispeed)
97 LDSO_STUBIFY(cfgetospeed)
98 LDSO_STUBIFY(cfsetispeed)
99 LDSO_STUBIFY(cfsetospeed)
103 LDSO_STUBIFY(closedir)
104 LDSO_STUBIFY(connect)
107 LDSO_STUBIFY(dlclose)
108 LDSO_STUBIFY(dlerror)
122 LDSO_STUBIFY(ftruncate)
124 LDSO_STUBIFY(getdtablesize)
125 LDSO_STUBIFY(getegid)
128 LDSO_STUBIFY(gethostbyaddr)
129 LDSO_STUBIFY(gethostbyname)
130 LDSO_STUBIFY(gethostname)
131 LDSO_STUBIFY(getitimer)
132 LDSO_STUBIFY(getpagesize)
133 LDSO_STUBIFY(getpeername)
134 LDSO_STUBIFY(getpgrp)
136 LDSO_STUBIFY(getppid)
137 LDSO_STUBIFY(getrusage)
138 LDSO_STUBIFY(getsockname)
139 LDSO_STUBIFY(gettimeofday)
152 LDSO_STUBIFY(memmove)
155 LDSO_STUBIFY(opendir)
159 LDSO_STUBIFY(readdir)
160 LDSO_STUBIFY(readlink)
166 LDSO_STUBIFY(setitimer)
167 LDSO_STUBIFY(setpgrp)
169 LDSO_STUBIFY(sigsetmask)
174 LDSO_STUBIFY(strerror)
176 LDSO_STUBIFY(symlink)
179 LDSO_STUBIFY(tcdrain)
181 LDSO_STUBIFY(tcflush)
182 LDSO_STUBIFY(tcgetattr)
183 LDSO_STUBIFY(tcsendbreak)
184 LDSO_STUBIFY(tcsetattr)
185 LDSO_STUBIFY(truncate)
186 LDSO_STUBIFY(ttyname)
194 * These aren't needed on the X86 because they're microcoded into the
195 * FPU, so the Lisp VOPs can implement them directly without having to
198 * Note: There might be some other functions in this category as well.
199 * E.g. I notice tanh() and acos() in the list above.. -- WHN 2001-06-07
201 #if !defined __i386__
213 LDSO_STUBIFY(ieee_get_fp_control)
214 LDSO_STUBIFY(ieee_set_fp_control)