From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#1043: emacs does not compile when using uClibc Date: Sun, 28 Sep 2008 00:15:42 -0700 (PDT) Message-ID: <200809280715.m8S7Fg1f020280@mothra.ics.uci.edu> Reply-To: Dan Nicolaescu , 1043@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222587029 3823 80.91.229.12 (28 Sep 2008 07:30:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Sep 2008 07:30:29 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 28 09:31:27 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KjqkV-0003vO-5X for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 09:31:23 +0200 Original-Received: from localhost ([127.0.0.1]:44054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjqjS-0006rs-Ht for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 03:30:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjqjO-0006re-Me for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:30:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjqjO-0006r2-2M for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:30:14 -0400 Original-Received: from [199.232.76.173] (port=58547 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjqjN-0006qt-V7 for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:30:13 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:51600) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjqjN-0003x5-GB for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:30:13 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KjqjL-0005k9-Jz for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:30:11 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8S7TsQb032749; Sun, 28 Sep 2008 00:29:55 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8S7P4Bg031664; Sun, 28 Sep 2008 00:25:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 28 Sep 2008 07:25:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1043 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122258616030312 (code B ref -1); Sun, 28 Sep 2008 07:25:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 28 Sep 2008 07:16:00 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8S7Fvnl030306 for ; Sun, 28 Sep 2008 00:15:58 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjqVY-0002K8-Vi for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:15:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjqVY-0002Jw-Fh for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:15:56 -0400 Original-Received: from [199.232.76.173] (port=45521 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjqVY-0002Jt-96 for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:15:56 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:50818) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjqVX-0002tj-PW for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:15:56 -0400 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KjqVW-00058X-NJ for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 03:15:55 -0400 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by barrelv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m8S7Fhph016381 for ; Sun, 28 Sep 2008 00:15:47 -0700 (PDT) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id m8S7Fg1f020280; Sun, 28 Sep 2008 00:15:42 -0700 (PDT) Original-Lines: 61 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: m8S7Fhph016381 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=0.714, required 5, autolearn=disabled, ALL_TRUSTED -1.44, FRT_BELOW2 2.15) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by mx20.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Sun, 28 Sep 2008 03:30:14 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20845 Archived-At: 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 #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 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 _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. */