Subject: Emacs 19.22 with NetBSD shared libraries
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Charles Hannum <mycroft@duality.gnu.ai.mit.edu>
List: current-users
Date: 12/11/1993 01:11:48
Here is my new set of patches. (It appears all of my previous set for
19.17 has been incorporated into the release.) For some reason, the
resulting executable is not pleased with `strip', but `strip -x' works
and is almost as good, so I've not bothered to look into it.
Note: I've only tested this on a 68k, not an i386, and not with X.
Your milage may vary. B-)
Also note that this relies on the new a.out.h I checked in today, with
some more SunOS-like macros. Check your nightly SUP tomorrow for the
new version.
Shar and enjoy.
*** sysdep.c~ Fri Nov 26 05:39:10 1993
--- sysdep.c Fri Dec 10 23:42:16 1993
***************
*** 1698,1703 ****
--- 1698,1705 ----
#endif /* VMS */
+ /* unexsunos4.c does not need these. */
+ #if !defined(__NetBSD__) && !defined(sun)
/* Note that VMS compiler won't accept defined (CANNOT_DUMP). */
#ifndef CANNOT_DUMP
#define NEED_STARTS
***************
*** 1706,1711 ****
--- 1708,1714 ----
#ifndef SYSTEM_MALLOC
#ifndef NEED_STARTS
#define NEED_STARTS
+ #endif
#endif
#endif
*** unexsunos4.c~ Sat Sep 11 21:21:35 1993
--- unexsunos4.c Sat Dec 11 00:43:10 1993
***************
*** 63,69 ****
char *new_name, *a_name;
unsigned bndry, bss_start, entry;
{
- char buf[PAGSIZ];
int fd, new;
char *old;
struct exec ohdr; /* Allocate on the stack, not needed in the next life */
--- 63,68 ----
***************
*** 93,99 ****
exit (1);
}
! old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (old == (char *)-1)
{
fprintf (stderr, "%s: ", a_name);
--- 92,98 ----
exit (1);
}
! old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0);
if (old == (char *)-1)
{
fprintf (stderr, "%s: ", a_name);
*** s/netbsd.h~ Fri Sep 10 01:02:45 1993
--- s/netbsd.h Fri Dec 10 23:29:36 1993
***************
*** 16,24 ****
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
- #define A_TEXT_OFFSET(x) (sizeof (struct exec))
- #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
-
#define HAVE_SETSID
#define LIBS_DEBUG
--- 16,21 ----
***************
*** 28,30 ****
--- 25,33 ----
/* For mem-limits.h. */
#define BSD4_2
+
+ /* Use SunOS-style unexec for dynamic linking. */
+ #define START_FILES pre-crt0.o /usr/lib/crt0.o
+ #define UNEXEC unexsunos4.o
+ #define RUN_TIME_REMAP
+ #define LINKER ld -X -Bdynamic
------------------------------------------------------------------------------