Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2003 23:53:00 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 31770 for review
Message-ID:  <200305240653.h4O6r0pm031337@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31770

Change 31770 by peter@peter_hammer on 2003/05/23 23:52:13

	This is wrong, but it cant be helped while we persist with libgcc.a.
	
	libstdc references the dwarf2 unwind code, which gets pulled in from
	libgcc.a and is non-PIC.  This Is Very Bad(TM), because there are
	now potentially two copies of the unwinder.  It also causes a fatal
	error at build time on amd64.  I'm pretty sure it is also responsible
	for some of the bogusness on the other platforms where we have TEXTREL
	relocations as a result.
	
	We really need the libgcc.so with the correct --version-script, since
	that is the official way to solve the problem.

Affected files ...

.. //depot/projects/hammer/gnu/lib/libgcc/Makefile#4 edit
.. //depot/projects/hammer/gnu/lib/libstdc++/Makefile#6 edit
.. //depot/projects/hammer/share/mk/bsd.libnames.mk#9 edit

Differences ...

==== //depot/projects/hammer/gnu/lib/libgcc/Makefile#4 (text+ko) ====

@@ -10,6 +10,7 @@
 LIB=	gcc
 .endif
 
+INSTALL_PIC_ARCHIVE=	YES
 #SHLIB_MAJOR=	1
 
 #

==== //depot/projects/hammer/gnu/lib/libstdc++/Makefile#6 (text+ko) ====

@@ -18,8 +18,8 @@
 CXXFLAGS+=	-fno-implicit-templates -ffunction-sections -fdata-sections -Wno-deprecated
 #LDFLAGS+=	-Wl,-version-info,4:0:0 -Wl,--version-script=${SRCDIR}/src/linker.map
 
-LDADD+=		-lm
-DPADD+=		${LIBM}
+LDADD+=		-lgcc_pic -lm
+DPADD+=		${LIBGCC_PIC} ${LIBM}
 
 # libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
 SRCS+=	globals.cc limits.cc basic_file_stdio.cc complex_io.cc ios.cc \

==== //depot/projects/hammer/share/mk/bsd.libnames.mk#9 (text+ko) ====

@@ -38,6 +38,7 @@
 LIBFTPIO?=	${DESTDIR}${LIBDIR}/libftpio.a
 LIBG2C?=	${DESTDIR}${LIBDIR}/libg2c.a
 LIBGCC?=	${DESTDIR}${LIBDIR}/libgcc.a
+LIBGCC_PIC?=	${DESTDIR}${LIBDIR}/libgcc_pic.a
 LIBGEOM?=	${DESTDIR}${LIBDIR}/libgeom.a
 LIBGNUREGEX?=	${DESTDIR}${LIBDIR}/libgnuregex.a
 LIBGSSAPI?=	${DESTDIR}${LIBDIR}/libgssapi.a	# XXX in secure dist, not base



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