From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nozomu Ando Newsgroups: gmane.emacs.devel Subject: Re: Cannot bootstrap on NetBSD/cobalt Date: Wed, 22 Mar 2006 12:03:03 +0900 Message-ID: <86odzzchaw.fsf@panel.jk.homeunix.org> References: <86k6b6wq88.fsf@panel.jk.homeunix.org> <86irqppovk.fsf@panel.jk.homeunix.org> <863bhiegeq.fsf@panel.jk.homeunix.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143482529 31192 80.91.229.2 (27 Mar 2006 18:02:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2006 18:02:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 27 20:01:59 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FNw29-0006J5-J8 for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2006 20:01:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNw29-0003Nh-7d for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2006 13:01:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FLtdG-0005hP-7m for emacs-devel@gnu.org; Tue, 21 Mar 2006 22:03:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FLtdD-0005hC-QU for emacs-devel@gnu.org; Tue, 21 Mar 2006 22:03:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FLtdD-0005h9-KR for emacs-devel@gnu.org; Tue, 21 Mar 2006 22:03:31 -0500 Original-Received: from [17.250.248.86] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FLtdI-0005v4-1j for emacs-devel@gnu.org; Tue, 21 Mar 2006 22:03:36 -0500 Original-Received: from mac.com (smtpin04-en2 [10.13.10.149]) by smtpout.mac.com (Xserve/8.12.11/smtpout04/MantshX 4.0) with ESMTP id k2M33IZG010295 for ; Tue, 21 Mar 2006 19:03:18 -0800 (PST) Original-Received: from panel.jk.homeunix.org (khp059134236077.ppp-bb.dion.ne.jp [59.134.236.77]) (authenticated bits=0) by mac.com (Xserve/smtpin04/MantshX 4.0) with ESMTP id k2M337WI007384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 21 Mar 2006 19:03:16 -0800 (PST) Original-To: emacs-devel@gnu.org In-Reply-To: <863bhiegeq.fsf@panel.jk.homeunix.org> (Nozomu Ando's message of "Thu, 16 Mar 2006 21:13:33 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52095 Archived-At: On OpenBSD-2.8/pmax (on gxemul MIPS instruction level simulator), I have successfully run emacs with X11 dinamic-link libraries, with attached patch and then: configure CPPFLAGS='-D__ELF__' && make problems I encountered: * cpp do not define __ELF__. I worked around by configure option: ../configure CPPFLAGS='-D__ELF__' * I did not care OpenBSD enough in my previous patch * configure did not recognized OpenBSD/pmax (mips-unknown-openbsd) * BROKEN_NOCOMBRELOC problem (emacs/X11 crashes without BROKEN_NOCOMBRELOC) * OpenBSD-2.8 do not have libncurses (libtermcap cause crash, so I used libotermcap) * OpenBSD-2.8 do not have /usr/lib/crtbegin.o * I cannot understand about -Z option for linker defined in src/s/openbsd.h, which is refused by ld. I don't test on this other than OpenBSD-2.8/pmax, so this may break other systems. (I do not expect this patch will be committed as-is, so I don't write ChangeLog entry.) --- Nozomu Ando Index: configure =================================================================== RCS file: /cvsroot/emacs/emacs/configure,v retrieving revision 1.167 diff -u -r1.167 configure --- configure 3 Mar 2006 11:32:03 -0000 1.167 +++ configure 22 Mar 2006 02:21:50 -0000 @@ -1754,11 +1754,19 @@ ## OpenBSD ports *-*-openbsd* ) opsys=openbsd + if test -f /usr/lib/crtbegin.o; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CRTBEGIN +_ACEOF + + fi case "${canonical}" in alpha*-*-openbsd*) machine=alpha ;; i386-*-openbsd*) machine=intel386 ;; m68k-*-openbsd*) machine=hp9000s300 ;; mipsel-*-openbsd*) machine=pmax ;; + mips-*-openbsd*) machine=pmax ;; ns32k-*-openbsd*) machine=ns32000 ;; sparc-*-openbsd*) machine=sparc ;; vax-*-openbsd*) machine=vax ;; Index: src/m/mips.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/m/mips.h,v retrieving revision 1.28 diff -u -r1.28 mips.h --- src/m/mips.h 18 Mar 2006 14:52:19 -0000 1.28 +++ src/m/mips.h 22 Mar 2006 02:21:51 -0000 @@ -112,10 +112,10 @@ /* This machine requires completely different unexec code which lives in a separate file. Specify the file name. */ -#if !defined(__linux__) && !defined(__NetBSD__) +#if !defined(__linux__) && !defined(__NetBSD__) && !defined(__OpenBSD__) #undef UNEXEC #define UNEXEC unexmips.o -#endif /* not __linux__ && not __NetBSD__ */ +#endif /* not __linux__ && not __NetBSD__ && not __OpenBSD__ */ /* Describe layout of the address space in an executing process. */ Index: src/m/pmax.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/m/pmax.h,v retrieving revision 1.24 diff -u -r1.24 pmax.h --- src/m/pmax.h 18 Mar 2006 14:52:40 -0000 1.24 +++ src/m/pmax.h 22 Mar 2006 02:21:51 -0000 @@ -13,7 +13,7 @@ #ifndef __MIPSEB__ #undef WORDS_BIG_ENDIAN #endif -#if defined (__NetBSD__) +#if defined (__NetBSD__) || defined (__OpenBSD__) #define BROKEN_NOCOMBRELOC #else #undef LIB_STANDARD @@ -28,7 +28,7 @@ #ifdef MACH #define START_FILES pre-crt0.o /usr/lib/crt0.o #else -#if !defined (__NetBSD__) +#if !defined (__NetBSD__) && !defined (__OpenBSD__) /* This line starts being needed with ultrix 4.0. */ /* You must delete it for version 3.1. */ #define START_FILES pre-crt0.o /usr/lib/cmplrs/cc/crt0.o @@ -51,7 +51,7 @@ #endif /* Override what mips.h says about this. */ -#if !defined (__NetBSD__) +#if !defined (__NetBSD__) && !defined (__OpenBSD__) #undef LINKER #endif @@ -62,7 +62,7 @@ #define BROKEN_O_NONBLOCK #endif -#ifndef __NetBSD__ +#if !defined (__NetBSD__) && !defined (__OpenBSD__) /* mcc@timessqr.gc.cuny.edu says this makes Emacs work with DECnet. */ #ifdef HAVE_LIBDNET #define LIBS_MACHINE -ldnet Index: src/s/openbsd.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/s/openbsd.h,v retrieving revision 1.6 diff -u -r1.6 openbsd.h --- src/s/openbsd.h 21 Mar 2005 17:33:04 -0000 1.6 +++ src/s/openbsd.h 22 Mar 2006 02:21:52 -0000 @@ -14,12 +14,23 @@ is necessary. Otherwise Emacs dumps core when run -nw. */ #undef LIBS_TERMCAP +#ifdef HAVE_LIBNCURSES #define TERMINFO #define LIBS_TERMCAP -lncurses +#else +#define LIBS_TERMCAP -lotermcap +#endif + +#if !defined (NO_SHARED_LIBS) && defined (__ELF__) && !defined (HAVE_CRTBEGIN) +#undef START_FILES +#define START_FILES pre-crt0.o /usr/lib/crt0.o +#undef LIB_STANDARD +#define LIB_STANDARD -lgcc -lc -lgcc +#endif #undef LD_SWITCH_SYSTEM_TEMACS #undef LD_SWITCH_SYSTEM -#ifdef __ELF__ +#if defined (__ELF__) && 0 /* -Z option is not recognized by gcc/binutils */ /* Han Boetes says this is necessary, otherwise Emacs dumps core on elf systems. */