Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Dec 1999 01:31:37 +0900
From:      Motoyuki Konno <motoyuki@snipe.rim.or.jp>
To:        current@freebsd.org
Subject:   make -DWANT_AOUT world is broken on -current
Message-ID:  <199912051631.BAA56201@sakura.snipe.rim.or.jp>

next in thread | raw e-mail | index | archive | help
Hi,

For a week or so, AOUT library of -current is broken.
"make -DWANT_AOUT world" fails at the following point:
-------- log starts here --------
--------------------------------------------------------------
>>> Building legacy libraries
--------------------------------------------------------------
[snip]
cd /usr/src/lib/libncurses;  /usr/obj/usr/src/tmp/usr/bin/make -DWORLD \
  -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED cleandepend;  \
  /usr/obj/usr/src/tmp/usr/bin/make -DWORLD -DNOINFO -DNOMAN -DNOPIC \
  -DNOPROFILE -DNOSHARED all;  /usr/obj/usr/src/tmp/usr/bin/make -DWORLD \
  -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED -B install cleandir obj
[snip]
cc -o make_keys -O2 -m486 -pipe -I. -I/usr/src/lib/libncurses \
  -I/usr/src/lib/libncurses/../../contrib/ncurses/ncurses \
  -I/usr/src/lib/libncurses/../../contrib/ncurses/include -Wall \
  -DFREEBSD_NATIVE -DNDEBUG -DHAVE_CONFIG_H -DTERMIOS \
  -I/usr/obj/aout/usr/src/tmp/usr/include \
  /usr/src/lib/libncurses/../../contrib/ncurses/ncurses/tinfo/make_keys.c
__main.o: Undefined symbol `___do_global_ctors' referenced from text segment
*** Error code 1
--------  log ends here ---------

This error occurs because ___do_global_ctors does not exists in libgcc.a.
So, I think the following patch will be needed for -current.

-------- patch begins here --------
--- contrib/gcc/libgcc2.c.old	Wed Oct 27 18:45:47 1999
+++ contrib/gcc/libgcc2.c	Mon Dec  6 00:50:25 1999
@@ -2853,7 +2853,7 @@
 }
 #endif
 
-#ifndef HAS_INIT_SECTION
+#if !defined (HAS_INIT_SECTION) || !defined (OBJECT_FORMAT_ELF)
 /* Run all the global constructors on entry to the program.  */
 
 #ifndef ON_EXIT
@@ -2917,7 +2917,7 @@
    must be in the bss/common section.
 
    Long term no port should use those extensions.  But many still do.  */
-#if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
+#if (!defined(INIT_SECTION_ASM_OP) || !defined(OBJECT_FORMAT_ELF)) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
 #if defined (ASM_OUTPUT_CONSTRUCTOR) || defined (USE_COLLECT2)
 func_ptr __CTOR_LIST__[2] = {0, 0};
 func_ptr __DTOR_LIST__[2] = {0, 0};
--- contrib/gcc/config/i386/freebsd.h.old	Sat Oct 16 05:56:19 1999
+++ contrib/gcc/config/i386/freebsd.h	Mon Dec  6 00:38:30 1999
@@ -557,3 +557,8 @@
    the EGCS crtstuff.c is overcome, we will switch to the non-sjlj-exceptions 
    type exception machanism.  */
 #define DWARF2_UNWIND_INFO 0
+
+/* to assist building libgcc2.c */
+#ifndef __ELF__
+#undef OBJECT_FORMAT_ELF
+#endif

--------  patch ends here  --------


Since -mno-486 option of gcc is deleted, the following patch also needed
for "make -DWANT_AOUT world".

-------- patch begins here --------
--- sys/i386/boot/biosboot/Makefile.old	Mon Dec  6 01:27:59 1999
+++ sys/i386/boot/biosboot/Makefile	Sat Aug 28 09:43:09 1999
@@ -8,7 +8,7 @@
 
 BINMODE=	444
 CFLAGS=		-O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-		-m386 \
+		-mno-486 \
 		-DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
 CFLAGS+=	-DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
 CFLAGS+=	-DDO_BAD144
--- sys/i386/boot/cdboot/Makefile.old	Sat Aug 28 09:43:16 1999
+++ sys/i386/boot/cdboot/Makefile	Mon Dec  6 01:28:17 1999
@@ -10,7 +10,7 @@
 
 BINMODE=	444
 CFLAGS=		-O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-		-mno-486 \
+		-m386 \
 		-DDO_BAD144 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
 CFLAGS+=	-DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
 CFLAGS+=	-I${.CURDIR}/../biosboot
--------  patch ends here --------

--
------------------------------------------------------------------------
Motoyuki Konno                  mkonno@res.yamanashi-med.ac.jp   (Univ)
                                motoyuki@snipe.rim.or.jp         (Home)
                                motoyuki@FreeBSD.ORG  (FreeBSD Project)
Yamanashi Medical University    http://www.freebsd.org/~motoyuki/ (WWW)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912051631.BAA56201>