Subject: port-hpcmips/26679: emacs21 in pkgsrc does not build on hpcmips; fix attached
To: None <>
From: None <>
List: netbsd-bugs
Date: 08/16/2004 00:52:27
>Number:         26679
>Category:       port-hpcmips
>Synopsis:       emacs21 in pkgsrc does not build on hpcmips; fix attached
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-hpcmips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 16 03:19:00 UTC 2004
>Originator:     Chris Danis
>Release:        1.6.2
NetBSD z50 1.6.2 NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 20:21:38 UTC 2004 hpcmips
Emacs 21.3nb4 does not build from source in the current pkgsrc tree on hpcmips.  The problem seems to be that temacs does not have a .note.netbsd.ident section linked into it at all, and as such, is not recognized as a NetBSD ELF file (gives a "cannot execute binary file" error).
Attempt to make pkgsrc/editors/emacs on NetBSD 1.6.2 (and pkgsrc.tar.gz from two days ago) on an IBM Workpad z50 (hpcmips).

If more information is needed, feel free to contact me.
Modify pkgsrc/editors/emacs/work/emacs-21.3/src/

I believe that this patch will work:
--- /tmp/      Mon Aug 16 02:07:19 2004
+++ ./emacs-21.3/src/        Mon Aug 16 02:08:02 2004
@@ -221,7 +221,7 @@
 #define START_FILES pre-crt0.o /usr/local/lib/gcc-crt0.o
 #else /* ! defined (COFF_ENCAPSULATE) */
-#define START_FILES pre-crt0.o /lib/crt0.o
+#define START_FILES pre-crt0.o /lib/crtbegin.o /lib/crt0.o /lib/crtend.o
 #endif /* ! defined (COFF_ENCAPSULATE) */
 #else /* ! defined (NO_REMAP) */
 #define START_FILES ecrt0.o

The end result must be that START_FILES in the output Makefile includes crtbegin.o and crtend.o, which will include the NetBSD ident section.  This worked on my z50.