unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Cannot bootstrap on NetBSD/cobalt
@ 2006-03-06  8:18 Kenichi Handa
  2006-03-07  9:36 ` Nozomu Ando
  0 siblings, 1 reply; 6+ messages in thread
From: Kenichi Handa @ 2006-03-06  8:18 UTC (permalink / raw)
  Cc: nakaji

I got this bug report (translated by me from the original
Japanese).  As I don't have NetBSD nor mips machine, I can't
work on it.

---
Kenichi Handa
handa@m17n.org

----------------------------------------------------------------------
When we build Emacs on "Cobalt Cache RaQ2" with
NetBSD/cobalt or on hpcmips with NetBSD-3.99.11 (no X11),
temacs can't be build correctly.

/usr/lib/crt{i,begin,end,n}.o are not linked with temacs.
It seems the culprit is that START_FILES and LIB_STANDARD
defined in src/s/netbsd.h are overridden by src/m/mips.h and
src/m/pmax.h.

With the attached patch, it is confirmed that the Emacs
built on hpcmips/NetBSD at least starts up.  But, the patch
may cause a problem for the other OS (especially OpenBSD and
older NetBSD).

Index: src/m/mips.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/m/mips.h,v
retrieving revision 1.27
diff -u -r1.27 mips.h
--- src/m/mips.h	6 Feb 2006 15:23:23 -0000	1.27
+++ src/m/mips.h	6 Mar 2006 00:50:32 -0000
@@ -112,7 +112,7 @@
 /* This machine requires completely different unexec code
    which lives in a separate file.  Specify the file name.  */
 
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__NetBSD__)
 #undef UNEXEC
 #define UNEXEC unexmips.o
 #endif /* not __linux__ */
@@ -142,14 +142,6 @@
 #if defined (__NetBSD__) || defined (__OpenBSD__)
 #else  /* bsd with elf */
 #define LINKER /bsd43/bin/ld
-#endif /* bsd with elf */
-#else /* not BSD_SYSTEM */
-
-#if defined(__GNUC__) && defined(_ABIN32)
-#define LIBS_MACHINE
-#else
-#define LIBS_MACHINE -lmld
-#endif
 
 #define LD_SWITCH_MACHINE -D 800000 -g3
 #define START_FILES pre-crt0.o /usr/lib/crt1.o
@@ -159,6 +151,15 @@
 #define C_SWITCH_MACHINE -I/usr/include/bsd
 #define C_DEBUG_SWITCH -O -g3
 
+#endif /* bsd with elf */
+#else /* not BSD_SYSTEM */
+
+#if defined(__GNUC__) && defined(_ABIN32)
+#define LIBS_MACHINE
+#else
+#define LIBS_MACHINE -lmld
+#endif
+
 #endif /* not BSD_SYSTEM */
 #endif /* not NEWSOS5 && not __linux__ */
 \f
Index: src/m/pmax.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/m/pmax.h,v
retrieving revision 1.23
diff -u -r1.23 pmax.h
--- src/m/pmax.h	1 Sep 2003 15:45:58 -0000	1.23
+++ src/m/pmax.h	6 Mar 2006 00:50:32 -0000
@@ -13,29 +13,24 @@
 #ifndef __MIPSEB__
 #undef WORDS_BIG_ENDIAN
 #endif
+#if !defined (__NetBSD__)
 #undef LIB_STANDARD
 #undef START_FILES
+#endif
 #undef COFF
 #undef TERMINFO
 #define MAIL_USE_FLOCK
 #define HAVE_UNION_WAIT
 
-
 #ifdef MACH
 #define START_FILES pre-crt0.o /usr/lib/crt0.o
 #else
+#if !defined (__NetBSD__)
 /* 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
 #endif
-
-#if defined (__NetBSD__) || defined (__OpenBSD__)
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib/crt0.o
-#undef RUN_TIME_REMAP
-#undef UNEXEC
-#define UNEXEC unexelf.o
-#endif /* NetBSD || OpenBSD */
+#endif
 
 /* Supposedly the following will overcome a kernel bug.  */
 #undef LD_SWITCH_MACHINE

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cannot bootstrap on NetBSD/cobalt
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Nozomu Ando @ 2006-03-07  9:36 UTC (permalink / raw)
  Cc: nakaji, emacs-devel



Kenichi Handa <handa@m17n.org> writes:

> I got this bug report (translated by me from the original
> Japanese).  As I don't have NetBSD nor mips machine, I can't
> work on it.
>
> ---
> Kenichi Handa
> handa@m17n.org
>
> ----------------------------------------------------------------------
> When we build Emacs on "Cobalt Cache RaQ2" with
> NetBSD/cobalt or on hpcmips with NetBSD-3.99.11 (no X11),
> temacs can't be build correctly.
>
> /usr/lib/crt{i,begin,end,n}.o are not linked with temacs.
> It seems the culprit is that START_FILES and LIB_STANDARD
> defined in src/s/netbsd.h are overridden by src/m/mips.h and
> src/m/pmax.h.
>
> With the attached patch, it is confirmed that the Emacs
> built on hpcmips/NetBSD at least starts up.  But, the patch
> may cause a problem for the other OS (especially OpenBSD and
> older NetBSD).

Even when building with this patch, we cannot execute emacs with X11
dynamic link libraries. (crash in XtCreateWidget at startup,
as reported by NAKAJI-san in 
http://www.m17n.org/mlarchive/mule-ja/200603/msg00035.html)

But it seems OK for me when linked with X11 static libraries.

---
Nozomu Ando

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cannot bootstrap on NetBSD/cobalt
  2006-03-07  9:36 ` Nozomu Ando
@ 2006-03-08  4:00   ` Nozomu Ando
  2006-03-16 12:13     ` Nozomu Ando
  0 siblings, 1 reply; 6+ messages in thread
From: Nozomu Ando @ 2006-03-08  4:00 UTC (permalink / raw)
  Cc: nakaji

Nozomu Ando <nand@mac.com> writes:
> Even when building with this patch, we cannot execute emacs with X11
> dynamic link libraries. (crash in XtCreateWidget at startup,
> as reported by NAKAJI-san in 
> http://www.m17n.org/mlarchive/mule-ja/200603/msg00035.html)
>
> But it seems OK for me when linked with X11 static libraries.


I think I found a problem.

On NetBSD-3.99.15/i386 (whose emacs with X11 works fine),
objdump -h temacs shows:

temacs:     file format elf32-i386
	: (snip)
  5 .rel.data     00000010  0804c598  0804c598  00004598  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .rel.got      00000040  0804c5a8  0804c5a8  000045a8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .rel.bss      00000080  0804c5e8  0804c5e8  000045e8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rel.plt      00000e80  0804c668  0804c668  00004668  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
	: (snip)

However, on NetBSD-3.99.15/hpcmips (whose emacs with X11 crashes at
startup), objdump -h temacs shows:

temacs:     file format elf32-tradlittlemips
	: (snip)
  7 .rel.dyn      00000318  004328c0  004328c0  000328c0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
	: (snip)

(FYI: ld version is 2.16.1)

It seems that ld for elf32-tradlittlemips igonores "-z nocombreloc"
option or there are some restrictions of binutils around MIPS elf.

And unexelf.c cannot unexec correctly without "-z nocombreloc" with
X11 dynamic-link libraries, because "undo relocations" at
unexelf.c:1221 does not work.


Is there any MIPS elf platform whose emacs works fine with X11
dynamic-link library?  What is the difference with NetBSD?

Best regards,
---
Nozomu Ando

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cannot bootstrap on NetBSD/cobalt
  2006-03-08  4:00   ` Nozomu Ando
@ 2006-03-16 12:13     ` Nozomu Ando
  2006-03-22  3:03       ` Nozomu Ando
  2006-03-25 16:33       ` Nozomu Ando
  0 siblings, 2 replies; 6+ messages in thread
From: Nozomu Ando @ 2006-03-16 12:13 UTC (permalink / raw)
  Cc: nakaji

Nozomu Ando <nand@mac.com> writes:
> It seems that ld for elf32-tradlittlemips igonores "-z nocombreloc"
> option or there are some restrictions of binutils around MIPS elf.
>
> And unexelf.c cannot unexec correctly without "-z nocombreloc" with
> X11 dynamic-link libraries, because "undo relocations" at
> unexelf.c:1221 does not work.

The attached patch is for the two issue previously reported:

 * We cannot build GNU Emacs CVS HEAD on NetBSD on MIPS processor.
 * We cannot execute emacs with X11-related dinamic-link libraries.

For the latter issue, I wrote some code for unexelf.c so that
temacs can unexec without "-z nocombreloc" linker option
(if unexelf.c compiled with -DBROKEN_NOCOMBRELOC).

NAKAJI-san and I tested this patch on several platform:
 NetBSD-3.0 release on hpcmips (MIPS little endian)
 NetBSD-3.99.11 (binutils 2.15) on NetBSD/hpcmips
 NetBSD-3.99.7 (binutils 2.15) on NetBSD/newsmips (MIPS big endian)

Thanks,
---
Nozomu Ando

P.S.
We found also another problem on NetBSD-current with binutils 2.16.1.
Its start address of the data segment is changed.
We have a workaround for this, but I am not sure what is correct fix.

---
Index: src/unexelf.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/unexelf.c,v
retrieving revision 1.61
diff -u -c -r1.61 unexelf.c
*** src/unexelf.c	6 Feb 2006 15:23:21 -0000	1.61
--- src/unexelf.c	9 Mar 2006 15:18:19 -0000
***************
*** 433,438 ****
--- 433,441 ----
  #if __sgi
  #include <syms.h> /* for HDRR declaration */
  #endif /* __sgi */
+ #ifdef BROKEN_NOCOMBRELOC
+ #include <assert.h>
+ #endif
  
  #ifndef MAP_ANON
  #ifdef MAP_ANONYMOUS
***************
*** 687,692 ****
--- 690,698 ----
    int old_mdebug_index;
    struct stat stat_buf;
    int old_file_size;
+ #ifdef BROKEN_NOCOMBRELOC
+   int unreloc_sections[10], n_unreloc_sections;
+ #endif
  
    /* Open the old file, allocate a buffer of the right size, and read
       in the file contents.  */
***************
*** 1218,1223 ****
--- 1224,1230 ----
  
    /* This loop seeks out relocation sections for the data section, so
       that it can undo relocations performed by the runtime linker.  */
+ #ifndef BROKEN_NOCOMBRELOC
    for (n = new_file_h->e_shnum - 1; n; n--)
      {
        ElfW(Shdr) section = NEW_SECTION_H (n);
***************
*** 1272,1277 ****
--- 1279,1359 ----
  	  break;
  	}
      }
+ #else /* BROKEN_NOCOMBRELOC */
+   for (n = 1, n_unreloc_sections = 0; n < new_file_h->e_shnum; n++)
+     if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data")
+ 	|| !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata")
+ 	|| !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".lit4")
+ 	|| !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".lit8")
+ #ifdef IRIX6_5			/* see above */
+ 	|| !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".got")
+ #endif
+ 	|| !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata1")
+ 	|| !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1"))
+       {
+ 	assert (n_unreloc_sections
+ 		< (sizeof (unreloc_sections) / sizeof (unreloc_sections[0])));
+ 	unreloc_sections[n_unreloc_sections++] = n;
+ #ifdef DEBUG
+ 	fprintf (stderr, "section %d: %s\n", n,
+ 		 old_section_names + NEW_SECTION_H (n).sh_name);
+ #endif
+       }
+ 
+   for (n = new_file_h->e_shnum - 1; n; n--)
+     {
+       ElfW(Shdr) section = NEW_SECTION_H (n);
+       caddr_t reloc, end;
+       ElfW(Addr) addr, offset;
+       int target;
+ 
+       switch (section.sh_type)
+ 	{
+ 	default:
+ 	  break;
+ 	case SHT_REL:
+ 	case SHT_RELA:
+ 	  /* This code handles two different size structs, but there should
+ 	     be no harm in that provided that r_offset is always the first
+ 	     member.  */
+ 	  for (reloc = old_base + section.sh_offset,
+ 		 end = reloc + section.sh_size;
+ 	       reloc < end;
+ 	       reloc += section.sh_entsize)
+ 	    {
+ 	      addr = ((ElfW(Rel) *) reloc)->r_offset;
+ #ifdef __alpha__
+ 	      /* The Alpha ELF binutils currently have a bug that
+ 		 sometimes results in relocs that contain all
+ 		 zeroes.  Work around this for now...  */
+ 	      if (addr == 0)
+ 		continue;
+ #endif
+ 	      for (nn = 0; nn < n_unreloc_sections; nn++)
+ 		{
+ 		  target = unreloc_sections[nn];
+ 		  if (NEW_SECTION_H (target).sh_addr <= addr
+ 		      && addr < (NEW_SECTION_H (target).sh_addr +
+ 				 NEW_SECTION_H (target).sh_size))
+ 		    {
+ 		      offset = (NEW_SECTION_H (target).sh_addr -
+ 				NEW_SECTION_H (target).sh_offset);
+ 		      memcpy (new_base + addr - offset,
+ 			      old_base + addr - offset,
+ 			      sizeof (ElfW(Addr)));
+ #ifdef DEBUG
+ 		      fprintf (stderr, "unrelocate: [%08lx] <= %08lx\n",
+ 			       (long) addr,
+ 			       (long) *((long *) (new_base + addr - offset)));
+ #endif
+ 		      break;
+ 		    }
+ 		}
+ 	    }
+ 	  break;
+ 	}
+     }
+ #endif	/* BROKEN_NOCOMBRELOC */
  
    /* Write out new_file, and free the buffers.  */
  
Index: src/m/mips.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/m/mips.h,v
retrieving revision 1.27
diff -u -c -r1.27 mips.h
*** src/m/mips.h	6 Feb 2006 15:23:23 -0000	1.27
--- src/m/mips.h	9 Mar 2006 15:18:19 -0000
***************
*** 112,118 ****
  /* This machine requires completely different unexec code
     which lives in a separate file.  Specify the file name.  */
  
! #ifndef __linux__
  #undef UNEXEC
  #define UNEXEC unexmips.o
  #endif /* not __linux__ */
--- 112,118 ----
  /* This machine requires completely different unexec code
     which lives in a separate file.  Specify the file name.  */
  
! #if !defined(__linux__) && !defined(__NetBSD__)
  #undef UNEXEC
  #define UNEXEC unexmips.o
  #endif /* not __linux__ */
***************
*** 142,155 ****
  #if defined (__NetBSD__) || defined (__OpenBSD__)
  #else  /* bsd with elf */
  #define LINKER /bsd43/bin/ld
- #endif /* bsd with elf */
- #else /* not BSD_SYSTEM */
- 
- #if defined(__GNUC__) && defined(_ABIN32)
- #define LIBS_MACHINE
- #else
- #define LIBS_MACHINE -lmld
- #endif
  
  #define LD_SWITCH_MACHINE -D 800000 -g3
  #define START_FILES pre-crt0.o /usr/lib/crt1.o
--- 142,147 ----
***************
*** 159,164 ****
--- 151,165 ----
  #define C_SWITCH_MACHINE -I/usr/include/bsd
  #define C_DEBUG_SWITCH -O -g3
  
+ #endif /* bsd with elf */
+ #else /* not BSD_SYSTEM */
+ 
+ #if defined(__GNUC__) && defined(_ABIN32)
+ #define LIBS_MACHINE
+ #else
+ #define LIBS_MACHINE -lmld
+ #endif
+ 
  #endif /* not BSD_SYSTEM */
  #endif /* not NEWSOS5 && not __linux__ */
  \f
Index: src/m/pmax.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/m/pmax.h,v
retrieving revision 1.23
diff -u -c -r1.23 pmax.h
*** src/m/pmax.h	1 Sep 2003 15:45:58 -0000	1.23
--- src/m/pmax.h	9 Mar 2006 15:18:19 -0000
***************
*** 13,20 ****
--- 13,24 ----
  #ifndef __MIPSEB__
  #undef WORDS_BIG_ENDIAN
  #endif
+ #if defined (__NetBSD__)
+ #define BROKEN_NOCOMBRELOC
+ #else
  #undef LIB_STANDARD
  #undef START_FILES
+ #endif
  #undef COFF
  #undef TERMINFO
  #define MAIL_USE_FLOCK
***************
*** 24,41 ****
  #ifdef MACH
  #define START_FILES pre-crt0.o /usr/lib/crt0.o
  #else
  /* 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
  #endif
! 
! #if defined (__NetBSD__) || defined (__OpenBSD__)
! #undef START_FILES
! #define START_FILES pre-crt0.o /usr/lib/crt0.o
! #undef RUN_TIME_REMAP
! #undef UNEXEC
! #define UNEXEC unexelf.o
! #endif /* NetBSD || OpenBSD */
  
  /* Supposedly the following will overcome a kernel bug.  */
  #undef LD_SWITCH_MACHINE
--- 28,39 ----
  #ifdef MACH
  #define START_FILES pre-crt0.o /usr/lib/crt0.o
  #else
+ #if !defined (__NetBSD__)
  /* 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
  #endif
! #endif
  
  /* Supposedly the following will overcome a kernel bug.  */
  #undef LD_SWITCH_MACHINE

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cannot bootstrap on NetBSD/cobalt
  2006-03-16 12:13     ` Nozomu Ando
@ 2006-03-22  3:03       ` Nozomu Ando
  2006-03-25 16:33       ` Nozomu Ando
  1 sibling, 0 replies; 6+ messages in thread
From: Nozomu Ando @ 2006-03-22  3:03 UTC (permalink / raw)



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.  */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cannot bootstrap on NetBSD/cobalt
  2006-03-16 12:13     ` Nozomu Ando
  2006-03-22  3:03       ` Nozomu Ando
@ 2006-03-25 16:33       ` Nozomu Ando
  1 sibling, 0 replies; 6+ messages in thread
From: Nozomu Ando @ 2006-03-25 16:33 UTC (permalink / raw)
  Cc: nand


This is continuation of my previous message, which seems not to be
delivered (yet), but archived:
http://lists.gnu.org/archive/html/emacs-devel/2006-03/msg00914.html

Today I have installed OpenBSD-3.8/macppc on my spear machine, and
found that the diff for src/s/openbsd.h of the above message is simply
wrong.  But I have no idea about what is the right code.

FYI:
 "-Z" linker option seems to be related to Writable XOR Executable
feature of the OpenBSD, which is introduced since OpenBSD-3.3 or
OpenBSD-3.4.

 They say OpenBSD/pmax has been discontinued after OpenBSD-2.7.

 Emacs CVS HEAD cannot be build on OpenBSD-3.8/macppc (configure fails).


Nozomu Ando

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-03-25 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-03-25 16:33       ` Nozomu Ando

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).