emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot bootstrap on NetBSD/cobalt


From: Nozomu Ando
Subject: Re: Cannot bootstrap on NetBSD/cobalt
Date: Wed, 22 Mar 2006 12:03:03 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

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__)
 /* address@hidden 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 <address@hidden> says this
     is necessary,  otherwise Emacs dumps core on elf systems.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]