From: Nozomu Ando <nand@mac.com>
Subject: Re: Cannot bootstrap on NetBSD/cobalt
Date: Wed, 22 Mar 2006 12:03:03 +0900 [thread overview]
Message-ID: <86odzzchaw.fsf@panel.jk.homeunix.org> (raw)
In-Reply-To: <863bhiegeq.fsf@panel.jk.homeunix.org> (Nozomu Ando's message of "Thu, 16 Mar 2006 21:13:33 +0900")
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 <han@mijncomputer.nl> says this
is necessary, otherwise Emacs dumps core on elf systems. */
next prev parent reply other threads:[~2006-03-22 3:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-06 8:18 Cannot bootstrap on NetBSD/cobalt Kenichi Handa
2006-03-07 9:36 ` Nozomu Ando
2006-03-08 4:00 ` Nozomu Ando
2006-03-16 12:13 ` Nozomu Ando
2006-03-22 3:03 ` Nozomu Ando [this message]
2006-03-25 16:33 ` Nozomu Ando
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86odzzchaw.fsf@panel.jk.homeunix.org \
--to=nand@mac.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).