emacs-pretest-bug
[Top][All Lists]
Advanced

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

NetBSD ld option


From: 山本和彦
Subject: NetBSD ld option
Date: Fri, 11 Jul 2003 15:06:01 +0900 (JST)

Hello,

Emacs 21.x can be complied on NetBSD 1.6.x but it cannot be complied
on NetBSD 1.6T (current) due to two changes.

1) The new linker requires "-Wl,-z,nocombreloc"

        http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=20660

   Note that this option does not break the old linker (1.6.x).

2) "crti.o" is necessary before "crtbegin.o" and
   "crtn.o" is necessary after "crtbend.o".

        http://mail-index.netbsd.org/current-users/2003/06/07/0010.html

   I attached a patch to resolve this. However, this patch is too much
   dependent on NetBSD so this patch should not be merged. I attached
   this just for calorification. To tell wether or not "crti.o" and
   "crtn.o" exist, I think "cc -dumpspecs" might help.

--Kazu

---
In GNU Emacs 21.3.50.1 (i386-unknown-netbsdelf1.6T, X toolkit, Xaw3d scroll 
bars)
 of 2003-07-07 on caster.iij.ad.jp
configured using `configure '--without-xim' '--prefix=/usr/local/emacs21' 
'CFLAGS=-I/usr/pkg/include' 'CPPFLAGS=-I/usr/pkg/include -L/usr/pkg/lib' 
'LDFLAGS=-Wl,-z,nocombreloc -R/usr/pkg/lib -L/usr/pkg/lib -R/usr/X11R6/lib 
-L/usr/X11R6/lib''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: ja_JP.eucJP
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: japanese-iso-8bit
  default-enable-multibyte-characters: t

Recent input:
C-u C-z m ESC x r e p o SPC r SPC e m a SPC b SPC 
<return>

Recent messages:
For information about the GNU Project and its goals, type C-h C-p.
Loading mew (source)...done
Loading cl-macs...done
Loading edebug...done
Loading ~/.mew.local...done
Setting up Mew world...
Updating status...done
Setting up Mew world...done
Making completion list...
Loading emacsbug...done
---

Index: configure
===================================================================
RCS file: /cvsroot/emacs/emacs/configure,v
retrieving revision 1.113
diff -c -r1.113 configure
*** configure   29 Jun 2003 12:05:01 -0000      1.113
--- configure   11 Jul 2003 05:48:14 -0000
***************
*** 18230,18235 ****
--- 18230,18251 ----
  
  
  
+ # NETBSD: NetBSD's newer run-time linker fix.
+ if test $opsys = netbsd; then
+   if test -f /usr/lib/crti.o; then
+     cat >> confdefs.h <<\EOF
+ #define HAVE_NETBSD_CRTI 1
+ EOF
+ 
+   fi
+   if test -f /usr/lib/crtn.o; then
+     cat >> confdefs.h <<\EOF
+ #define HAVE_NETBSD_CRTN 1
+ EOF
+ 
+   fi
+ fi
+ 
  # Set up the CFLAGS for real compilation, so we can substitute it.
  CFLAGS="$REAL_CFLAGS"
  CPPFLAGS="$REAL_CPPFLAGS"
Index: configure.in
===================================================================
RCS file: /cvsroot/emacs/emacs/configure.in,v
retrieving revision 1.341
diff -c -r1.341 configure.in
*** configure.in        29 Jun 2003 12:01:08 -0000      1.341
--- configure.in        11 Jul 2003 05:48:16 -0000
***************
*** 2528,2533 ****
--- 2528,2543 ----
  
  dnl Fixme: Use AC_FUNC_MEMCMP since memcmp is used.  (Needs libobj 
replacement.)
  
+ # NETBSD: NetBSD's newer run-time linker fix.
+ if $opsys = netbsd; then
+   if test -f /usr/lib/crti.o; then
+     AC_DEFINE(HAVE_NETBSD_CRTI)
+   fi
+   if test -f /usr/lib/crtn.o; then
+     AC_DEFINE(HAVE_NETBSD_CRTN)
+   fi
+ fi
+ 
  # Set up the CFLAGS for real compilation, so we can substitute it.
  CFLAGS="$REAL_CFLAGS"
  CPPFLAGS="$REAL_CPPFLAGS"
Index: src/config.in
===================================================================
RCS file: /cvsroot/emacs/emacs/src/config.in,v
retrieving revision 1.188
diff -c -r1.188 config.in
*** src/config.in       26 Jun 2003 21:08:13 -0000      1.188
--- src/config.in       11 Jul 2003 05:48:18 -0000
***************
*** 863,868 ****
--- 863,872 ----
  #define INLINE
  #endif
  
+ /* must before config_opsysfile */
+ #undef HAVE_NETBSD_CRTN
+ #undef HAVE_NETBSD_CRTI
+ 
  /* Include the os and machine dependent files.  */
  #include config_opsysfile
  #include config_machfile
Index: src/s/netbsd.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/s/netbsd.h,v
retrieving revision 1.37
diff -c -r1.37 netbsd.h
*** src/s/netbsd.h      4 Feb 2003 14:03:18 -0000       1.37
--- src/s/netbsd.h      11 Jul 2003 05:48:18 -0000
***************
*** 60,68 ****
--- 60,76 ----
  #endif /* not NO_SHARED_LIBS and not ELF */
  
  #if !defined (NO_SHARED_LIBS) && defined (__ELF__)
+ #if defined(HAVE_NETBSD_CRTI)
+ #define START_FILES pre-crt0.o /usr/lib/crt0.o /usr/lib/crti.o 
/usr/lib/crtbegin.o
+ #else
  #define START_FILES pre-crt0.o /usr/lib/crt0.o /usr/lib/crtbegin.o
+ #endif
  #define UNEXEC unexelf.o
+ #if defined(HAVE_NETBSD_CRTN)
+ #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+ #else
  #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o
+ #endif
  #undef LIB_GCC
  #define LIB_GCC
  #endif
---




reply via email to

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