aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-24 14:18:18 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-24 14:18:18 -0700
commita81fb89a445ae0dca286c861d8d51f705533df0d (patch)
treea8b2ae9b656b482c822fbdf75f0f16c1d43945a7 /com32
parent3ac4d898c0dee05c6e2d00e4ecbf208dbd4915e8 (diff)
downloadsyslinux-a81fb89a445ae0dca286c861d8d51f705533df0d.tar.gz
syslinux-a81fb89a445ae0dca286c861d8d51f705533df0d.tar.xz
syslinux-a81fb89a445ae0dca286c861d8d51f705533df0d.zip
Fix building on a 64-bit system without a 32-bit system installedsyslinux-3.52-pre10syslinux-3.52
A bunch of glibc header files were bogusly included. We should not depend on having a 32-bit glibc installed, since we don't use it.
Diffstat (limited to 'com32')
-rw-r--r--com32/include/alloca.h12
-rw-r--r--com32/include/endian.h15
-rw-r--r--com32/include/klibc/endian.h38
-rw-r--r--com32/include/setjmp.h27
-rw-r--r--com32/include/sys/time.h6
-rw-r--r--com32/include/time.h6
-rw-r--r--com32/libutil/crypt-md5.c2
-rw-r--r--com32/modules/mboot.c1
8 files changed, 80 insertions, 27 deletions
diff --git a/com32/include/alloca.h b/com32/include/alloca.h
new file mode 100644
index 00000000..91ef4c0d
--- /dev/null
+++ b/com32/include/alloca.h
@@ -0,0 +1,12 @@
+/*
+ * alloca.h
+ *
+ * Just call the builtin alloca() function
+ */
+
+#ifndef _ALLOCA_H
+#define _ALLOCA_H
+
+#define alloca(size) __builtin_alloca(size)
+
+#endif /* _ALLOCA_H */
diff --git a/com32/include/endian.h b/com32/include/endian.h
new file mode 100644
index 00000000..a6cd6d9b
--- /dev/null
+++ b/com32/include/endian.h
@@ -0,0 +1,15 @@
+/*
+ * endian.h
+ */
+
+#ifndef _ENDIAN_H
+#define _ENDIAN_H
+
+#include <klibc/endian.h>
+
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#define BIG_ENDIAN __BIG_ENDIAN
+#define PDP_ENDIAN __PDP_ENDIAN
+#define BYTE_ORDER __BYTE_ORDER
+
+#endif /* _ENDIAN_H */
diff --git a/com32/include/klibc/endian.h b/com32/include/klibc/endian.h
new file mode 100644
index 00000000..7537a47e
--- /dev/null
+++ b/com32/include/klibc/endian.h
@@ -0,0 +1,38 @@
+/*
+ * klibc/endian.h
+ *
+ * Like <endian.h>, but export only double-underscore symbols
+ */
+
+#ifndef _KLIBC_ENDIAN_H
+#define _KLIBC_ENDIAN_H
+
+#define __LITTLE_ENDIAN /* we're on i386, littleendian */
+
+/* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
+ __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
+ defined with __BYTE_ORDER defining which is actually used... */
+
+#if defined(__LITTLE_ENDIAN)
+# undef __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#elif defined(__BIG_ENDIAN)
+# undef __BIG_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __BIG_ENDIAN
+#elif defined(__PDP_ENDIAN)
+# undef __PDP_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __PDP_ENDIAN
+#else
+# error "Unknown byte order!"
+#endif
+
+#endif /* _KLIBC_ENDIAN_H */
diff --git a/com32/include/setjmp.h b/com32/include/setjmp.h
index b504eb6d..11b18fbd 100644
--- a/com32/include/setjmp.h
+++ b/com32/include/setjmp.h
@@ -8,36 +8,15 @@
#include <klibc/extern.h>
#include <klibc/compiler.h>
#include <stddef.h>
-#include <signal.h>
#include <klibc/archsetjmp.h>
__extern int setjmp(jmp_buf);
__extern __noreturn longjmp(jmp_buf, int);
-/*
- Whose bright idea was it to add unrelated functionality to just about
- the only function in the standard C library (setjmp) which cannot be
- wrapped by an ordinary function wrapper? Anyway, the damage is done,
- and therefore, this wrapper *must* be inline. However, gcc will
- complain if this is an inline function for unknown reason, and
- therefore sigsetjmp() needs to be a macro.
-*/
-
-struct __sigjmp_buf {
- jmp_buf __jmpbuf;
- sigset_t __sigs;
-};
-
-typedef struct __sigjmp_buf sigjmp_buf[1];
-
-#define sigsetjmp(__env, __save) \
-({ \
- struct __sigjmp_buf *__e = (__env); \
- sigprocmask(0, NULL, &__e->__sigs); \
- setjmp(__e->__jmpbuf); \
-})
+typedef jmp_buf sigjmp_buf;
-__extern __noreturn siglongjmp(sigjmp_buf, int);
+#define sigsetjmp(__env, __save) setjmp(__env)
+#define siglongjmp(__env, __val) longjmp(__env, __val)
#endif /* _SETJMP_H */
diff --git a/com32/include/sys/time.h b/com32/include/sys/time.h
new file mode 100644
index 00000000..c5bff0da
--- /dev/null
+++ b/com32/include/sys/time.h
@@ -0,0 +1,6 @@
+#ifndef _SYS_TIME_H
+#define _SYS_TIME_H
+
+/* empty */
+
+#endif
diff --git a/com32/include/time.h b/com32/include/time.h
index e69de29b..259386a6 100644
--- a/com32/include/time.h
+++ b/com32/include/time.h
@@ -0,0 +1,6 @@
+#ifndef _TIME_H
+#define _TIME_H
+
+/* empty */
+
+#endif
diff --git a/com32/libutil/crypt-md5.c b/com32/libutil/crypt-md5.c
index 7804e4d5..c5034432 100644
--- a/com32/libutil/crypt-md5.c
+++ b/com32/libutil/crypt-md5.c
@@ -32,8 +32,6 @@
* UNIX password
*/
-#include "crypt.h"
-
static char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
diff --git a/com32/modules/mboot.c b/com32/modules/mboot.c
index 23638b4f..d1657ea1 100644
--- a/com32/modules/mboot.c
+++ b/com32/modules/mboot.c
@@ -30,7 +30,6 @@
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
-#include <malloc.h>
#include <consoles.h>
#include <zlib.h>
#include <com32.h>