From nobody  Tue Sep 29 14:08:10 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id OAA10961;
          Tue, 29 Sep 1998 14:08:10 -0700 (PDT)
          (envelope-from nobody)
Message-Id: <199809292108.OAA10961@hub.freebsd.org>
Date: Tue, 29 Sep 1998 14:08:10 -0700 (PDT)
From: taoka@infonets.hiroshima-u.ac.jp
To: freebsd-gnats-submit@freebsd.org
Subject: ELF patch for editors/xemacs (XEmacs-19.16)
X-Send-Pr-Version: www-1.0

>Number:         8096
>Category:       ports
>Synopsis:       ELF patch for editors/xemacs (XEmacs-19.16)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 29 14:10:01 PDT 1998
>Closed-Date:    Wed Sep 30 12:49:25 PDT 1998
>Last-Modified:  Wed Sep 30 12:49:51 PDT 1998
>Originator:     Satoshi Taoka
>Release:        FreeBSD 3.0-19980921-BETA
>Organization:
Hiroshima Univ. in Japan
>Environment:
>Description:
This is a ELF patch for editors/xemacs (XEmacs 19.16).

This is slightly different from the patch of PR (ports/8092)
for XEmacs 20.4.
# See ports/8092.
This has no next line:

+#define LINKER "$(CC) -nostdlib"

Because, on XEmacs 19, we cannot build by error of make command.

>How-To-Repeat:

>Fix:
[the new patch file patch-ah]

diff -ru orig/s/freebsd.h src/s/freebsd.h
--- orig/s/freebsd.h	Mon Oct 13 07:05:45 1997
+++ src/s/freebsd.h	Wed Sep 30 05:06:28 1998
@@ -53,6 +53,19 @@
 /* freebsd has POSIX-style pgrp behavior. */
 #define GETPGRP_NO_ARG
 
+#ifdef __ELF__ /* since from 3.0-CURRENT(maybe 19980831 or later) */
+#ifndef NOT_C_CODE
+#include <stddef.h>
+#endif
+#define LD_SWITCH_SYSTEM
+#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
+#define UNEXEC unexelf.o
+#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+#undef LIB_GCC
+#define LIB_GCC
+
+#else /* not __ELF__ */
+
 #ifndef NO_SHARED_LIBS
 #define LD_SWITCH_SYSTEM -e start -dc -dp
 #define HAVE_TEXT_START		/* No need to define `start_of_text'. */
@@ -73,6 +86,8 @@
 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
 #endif /* __FreeBSD__ */
 #endif /* NO_SHARED_LIBS */
+
+#endif /* not __ELF__ */
 
 #define HAVE_GETLOADAVG
 #define NO_TERMIO
diff -ru orig/unexelf.c src/unexelf.c
--- orig/unexelf.c	Wed Dec 18 12:38:00 1996
+++ src/unexelf.c	Wed Sep 30 04:14:34 1998
@@ -845,7 +845,9 @@
 
       for (; symp < symendp; symp ++)
 	if (strcmp ((char *) (symnames + symp->st_name), "_end") == 0
-	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0)
+	    || strcmp ((char *) (symnames + symp->st_name), "end") == 0
+	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0
+	    || strcmp ((char *) (symnames + symp->st_name), "edata") == 0)
 	  memcpy (&symp->st_value, &new_bss_addr, sizeof (new_bss_addr));
     }
 

>Release-Note:
>Audit-Trail:

From: TAOKA Satoshi <taoka@infonets.hiroshima-u.ac.jp>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: ports/8096: ELF patch for editors/xemacs (XEmacs-19.16)
Date: Wed, 30 Sep 1998 16:37:19 +0900

 > 
 > diff -ru orig/s/freebsd.h src/s/freebsd.h
 > --- orig/s/freebsd.h	Mon Oct 13 07:05:45 1997
 > +++ src/s/freebsd.h	Wed Sep 30 05:06:28 1998
 
 
 I think that we cannot build under aout in 3.0-current by the above
 patch. I seem that the next patch is OK under both ELF and aout.
 
 [patch-ah]
 
 diff -ru orig/s/freebsd.h src/s/freebsd.h
 --- orig/s/freebsd.h	Mon Oct 13 07:05:45 1997
 +++ src/s/freebsd.h	Wed Sep 30 12:08:58 1998
 @@ -53,10 +53,27 @@
  /* freebsd has POSIX-style pgrp behavior. */
  #define GETPGRP_NO_ARG
  
 +#ifdef __ELF__ /* since from 3.0-CURRENT(maybe 19980831 or later) */
 +#ifndef NOT_C_CODE
 +#include <stddef.h>
 +#endif
 +#define LD_SWITCH_SYSTEM
 +#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
 +#define UNEXEC unexelf.o
 +#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
 +#undef LIB_GCC
 +#define LIB_GCC
 +
 +#else /* not __ELF__ */
 +
  #ifndef NO_SHARED_LIBS
  #define LD_SWITCH_SYSTEM -e start -dc -dp
  #define HAVE_TEXT_START		/* No need to define `start_of_text'. */
 +#if __FreeBSD_version >= 300002
 +#define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
 +#else /* __FreeBSD_version < 300002 */
  #define START_FILES pre-crt0.o /usr/lib/crt0.o
 +#endif /* __FreeBSD_version < 300002 */
  #define UNEXEC unexfreebsd.o
  #define RUN_TIME_REMAP
  
 @@ -73,6 +90,8 @@
  #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
  #endif /* __FreeBSD__ */
  #endif /* NO_SHARED_LIBS */
 +
 +#endif /* not __ELF__ */
  
  #define HAVE_GETLOADAVG
  #define NO_TERMIO
 diff -ru orig/unexelf.c src/unexelf.c
 --- orig/unexelf.c	Wed Dec 18 12:38:00 1996
 +++ src/unexelf.c	Wed Sep 30 04:14:34 1998
 @@ -845,7 +845,9 @@
  
        for (; symp < symendp; symp ++)
  	if (strcmp ((char *) (symnames + symp->st_name), "_end") == 0
 -	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0)
 +	    || strcmp ((char *) (symnames + symp->st_name), "end") == 0
 +	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0
 +	    || strcmp ((char *) (symnames + symp->st_name), "edata") == 0)
  	  memcpy (&symp->st_value, &new_bss_addr, sizeof (new_bss_addr));
      }
  
State-Changed-From-To: open->closed 
State-Changed-By: gj 
State-Changed-When: Wed Sep 30 12:49:25 PDT 1998 
State-Changed-Why:  
patch committed, thanks ! 
>Unformatted:
