From: Dan Nicolaescu <dann@ics.uci.edu>
To: bug-gnu-emacs@gnu.org
Subject: bug#1043: emacs does not compile when using uClibc
Date: Sun, 28 Sep 2008 00:15:42 -0700 (PDT) [thread overview]
Message-ID: <200809280715.m8S7Fg1f020280@mothra.ics.uci.edu> (raw)
uClibc is an alternative libc, emacs does not work on such systems at
the moment.
The patch bellow fixes this. Not sure if this is a bug fix, or it's
adding a new feature, so just record it here in case it's the latter.
Index: src/gmalloc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/gmalloc.c,v
retrieving revision 1.28
diff -u -3 -p -r1.28 gmalloc.c
--- src/gmalloc.c 23 May 2008 04:39:57 -0000 1.28
+++ src/gmalloc.c 28 Sep 2008 07:08:54 -0000
@@ -1706,17 +1706,17 @@ MA 02110-1301, USA. */
#include <malloc.h>
#endif
-#ifndef __GNU_LIBRARY__
+/* uClibc defines __GNU_LIBRARY__, but it is not completely
+ compatible. */
+#if !defined(__GNU_LIBRARY__) || defined(__UCLIBC__)
#define __sbrk sbrk
-#endif
-
-#ifdef __GNU_LIBRARY__
+#else /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */
/* It is best not to declare this and cast its result on foreign operating
systems with potentially hostile include files. */
#include <stddef.h>
extern __ptr_t __sbrk PP ((ptrdiff_t increment));
-#endif
+#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */
#ifndef NULL
#define NULL 0
Index: src/s/gnu-linux.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/s/gnu-linux.h,v
retrieving revision 1.113
diff -u -3 -p -r1.113 gnu-linux.h
--- src/s/gnu-linux.h 2 Aug 2008 16:19:03 -0000 1.113
+++ src/s/gnu-linux.h 28 Sep 2008 07:08:54 -0000
@@ -156,11 +156,15 @@ along with GNU Emacs. If not, see <http
/* new C libio names */
#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
-#else /* !_IO_STDIO_H */
+#elif defined (__UCLIBC__)
+/* using the uClibc library */
+#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
+ ((FILE)->__bufpos - (FILE)->__bufstart)
+#else /* !_IO_STDIO_H && ! __UCLIBC__ */
/* old C++ iostream names */
#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
((FILE)->_pptr - (FILE)->_pbase)
-#endif /* !_IO_STDIO_H */
+#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
#endif /* emacs */
/* Ask GCC where to find libgcc.a. */
next reply other threads:[~2008-09-28 7:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-28 7:15 Dan Nicolaescu [this message]
2008-10-01 13:27 ` bug#1043: emacs does not compile when using uClibc Stefan Monnier
2008-10-02 1:01 ` Richard M. Stallman
2008-10-02 12:42 ` Stefan Monnier
2008-10-03 4:17 ` Richard M. Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809280715.m8S7Fg1f020280@mothra.ics.uci.edu \
--to=dann@ics.uci.edu \
--cc=1043@emacsbugs.donarmstrong.com \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.