diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2002-06-29 17:44:07 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2002-06-29 17:44:07 +0000 |
commit | 0ff270c06277a8cce6f40a103d571f87e3556417 (patch) | |
tree | 34df126257ed53eeb2d20aea06be57bb9d8be142 /sys-devel | |
parent | Mangle .la files slightly so that libtool can find static libraries closes #3890 (diff) | |
download | gentoo-2-0ff270c06277a8cce6f40a103d571f87e3556417.tar.gz gentoo-2-0ff270c06277a8cce6f40a103d571f87e3556417.tar.bz2 gentoo-2-0ff270c06277a8cce6f40a103d571f87e3556417.zip |
atexit fix; remove texinfo
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/gcc/ChangeLog | 9 | ||||
-rw-r--r-- | sys-devel/gcc/files/digest-gcc-2.95.3-r7 | 1 | ||||
-rw-r--r-- | sys-devel/gcc/files/gcc-2.95.3-new-atexit.diff | 342 | ||||
-rw-r--r-- | sys-devel/gcc/gcc-2.95.3-r7.ebuild | 188 |
4 files changed, 539 insertions, 1 deletions
diff --git a/sys-devel/gcc/ChangeLog b/sys-devel/gcc/ChangeLog index aa424584164e..d8019636e0b5 100644 --- a/sys-devel/gcc/ChangeLog +++ b/sys-devel/gcc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-devel/gcc # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.19 2002/06/29 17:20:02 lostlogic Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.20 2002/06/29 17:44:07 azarah Exp $ + +*gcc-2.95.3-r7 (29 Jun 2002) + + 29 Jun 2002; Martin Schlemmer <azarah@gentoo.org> : + Remove texinfo as we have a build again. Fix the atexit() bug, bug #3982. + Also fix bug #3527, which was caused by a stray symlink on downgrading from + gcc-3.x. *gcc-3.1-r7 (29 June 2002) diff --git a/sys-devel/gcc/files/digest-gcc-2.95.3-r7 b/sys-devel/gcc/files/digest-gcc-2.95.3-r7 new file mode 100644 index 000000000000..c6940932e4ef --- /dev/null +++ b/sys-devel/gcc/files/digest-gcc-2.95.3-r7 @@ -0,0 +1 @@ +MD5 f3ad4f32c2296fad758ed051b5ac8e28 gcc-2.95.3.tar.gz 12911721 diff --git a/sys-devel/gcc/files/gcc-2.95.3-new-atexit.diff b/sys-devel/gcc/files/gcc-2.95.3-new-atexit.diff new file mode 100644 index 000000000000..ed734e5766c4 --- /dev/null +++ b/sys-devel/gcc/files/gcc-2.95.3-new-atexit.diff @@ -0,0 +1,342 @@ +diff -NPru gcc-2.95.3-orig/gcc/c-decl.c gcc-2.95.3/gcc/c-decl.c +--- gcc-2.95.3-orig/gcc/c-decl.c Thu Jan 25 08:02:59 2001 ++++ gcc-2.95.3/gcc/c-decl.c Fri Aug 10 13:38:24 2001 +@@ -29,6 +29,7 @@ + + #include "config.h" + #include "system.h" ++#include "rtl.h" + #include "tree.h" + #include "flags.h" + #include "output.h" +@@ -41,6 +42,8 @@ + extern cpp_reader parse_in; + #endif + ++extern void declare_weak PARAMS ((tree)); ++ + /* In grokdeclarator, distinguish syntactic contexts of declarators. */ + enum decl_context + { NORMAL, /* Ordinary declaration */ +@@ -2028,7 +2031,15 @@ + } + + /* Merge the storage class information. */ +- DECL_WEAK (newdecl) |= DECL_WEAK (olddecl); ++ if (!DECL_WEAK (newdecl) && DECL_WEAK (olddecl)) ++ declare_weak (newdecl); ++ if (DECL_WEAK (newdecl) && !DECL_WEAK (olddecl)) ++ declare_weak (olddecl); ++ if (DECL_WEAK (newdecl) && DECL_RTL (newdecl) ++ && GET_CODE (DECL_RTL (newdecl)) == MEM ++ && XEXP (DECL_RTL (newdecl), 0) ++ && GET_CODE (XEXP (DECL_RTL (newdecl), 0)) == SYMBOL_REF) ++ SYMBOL_REF_WEAK (XEXP (DECL_RTL (newdecl), 0)) = 1; + /* For functions, static overrides non-static. */ + if (TREE_CODE (newdecl) == FUNCTION_DECL) + { +diff -NPru gcc-2.95.3-orig/gcc/config/alpha/crtbegin.asm gcc-2.95.3/gcc/config/alpha/crtbegin.asm +--- gcc-2.95.3-orig/gcc/config/alpha/crtbegin.asm Wed Dec 16 15:00:53 1998 ++++ gcc-2.95.3/gcc/config/alpha/crtbegin.asm Fri Aug 10 13:41:41 2001 +@@ -97,6 +97,24 @@ + # Support recursive calls to exit. + $ptr: .quad __DTOR_LIST__ + ++ .global __dso_handle ++ .type __dso_handle,@object ++ .size __dso_handle,8 ++#ifdef SHARED ++.section .data ++ .align 3 ++__dso_handle: ++ .quad __dso_handle ++#else ++.section .bss ++ .align 3 ++__dso_handle: ++ .zero 8 ++#endif ++#ifdef HAVE_GAS_HIDDEN ++ .hidden __dso_handle ++#endif ++ + .text + + .align 3 +diff -NPru gcc-2.95.3-orig/gcc/config/i386/i386.c gcc-2.95.3/gcc/config/i386/i386.c +--- gcc-2.95.3-orig/gcc/config/i386/i386.c Tue Sep 7 02:38:56 1999 ++++ gcc-2.95.3/gcc/config/i386/i386.c Fri Aug 10 13:38:24 2001 +@@ -291,7 +291,7 @@ + + if (ix86_arch_string == 0) + { +- ix86_arch_string = PROCESSOR_PENTIUM_STRING; ++ ix86_arch_string = PROCESSOR_DEFAULT_STRING; + if (ix86_cpu_string == 0) + ix86_cpu_string = PROCESSOR_DEFAULT_STRING; + } +@@ -308,7 +308,7 @@ + if (i == ptt_size) + { + error ("bad value (%s) for -march= switch", ix86_arch_string); +- ix86_arch_string = PROCESSOR_PENTIUM_STRING; ++ ix86_arch_string = PROCESSOR_DEFAULT_STRING; + ix86_arch = PROCESSOR_DEFAULT; + } + +diff -NPru gcc-2.95.3-orig/gcc/config/i386/linux.h gcc-2.95.3/gcc/config/i386/linux.h +--- gcc-2.95.3-orig/gcc/config/i386/linux.h Wed Apr 7 19:32:13 1999 ++++ gcc-2.95.3/gcc/config/i386/linux.h Fri Aug 10 13:38:24 2001 +@@ -234,3 +234,21 @@ + } \ + } while (0) + #endif ++ ++#if defined(__PIC__) && defined (USE_GNULIBC_1) ++/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, ++ __environ and atexit (). We have to make sure they are in the .dynsym ++ section. We accomplish it by making a dummy call here. This ++ code is never reached. */ ++ ++#define CRT_END_INIT_DUMMY \ ++ do \ ++ { \ ++ extern void *___brk_addr; \ ++ extern char **__environ; \ ++ \ ++ ___brk_addr = __environ; \ ++ atexit (0); \ ++ } \ ++ while (0) ++#endif +diff -NPru gcc-2.95.3-orig/gcc/config.in gcc-2.95.3/gcc/config.in +--- gcc-2.95.3-orig/gcc/config.in Fri Mar 16 08:13:48 2001 ++++ gcc-2.95.3/gcc/config.in Fri Aug 10 13:49:47 2001 +@@ -34,6 +34,9 @@ + emitting at the beginning of your section */ + #undef HAVE_GAS_SUBSECTION_ORDERING + ++/* Define if your assember supports .hidden */ ++#undef HAVE_GAS_HIDDEN ++ + /* Define if your assembler uses the old HImode fild and fist notation. */ + #undef HAVE_GAS_FILDS_FISTS + +diff -uNr gcc-2.95.3.orig/gcc/configure gcc-2.95.3/gcc/configure +--- gcc-2.95.3.orig/gcc/configure Sat Mar 17 01:13:48 2001 ++++ gcc-2.95.3/gcc/configure Sat Aug 18 07:18:42 2001 +@@ -1311,7 +1311,7 @@ + fi + + # Find some useful tools +-for ac_prog in gawk mawk nawk awk ++for ac_prog in mawk gawk nawk awk + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +@@ -8229,8 +8229,26 @@ + fi + echo "$ac_t""$gcc_cv_as_subsections" 1>&6 + ++echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6 ++echo "configure:8234: checking assembler hidden support" >&5 ++gcc_cv_as_hidden= ++if test x$gcc_cv_as != x; then ++ # Check if we have .hidden ++ echo " .hidden foobar" > conftest.s ++ echo "foobar:" >> conftest.s ++ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_GAS_HIDDEN 1 ++EOF ++ ++ gcc_cv_as_hidden="yes" ++ fi ++ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 ++fi ++echo "$ac_t""$gcc_cv_as_hidden" 1>&6 ++ + echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 +-echo "configure:8234: checking assembler instructions" >&5 ++echo "configure:8252: checking assembler instructions" >&5 + gcc_cv_as_instructions= + if test x$gcc_cv_as != x; then + set "filds fists" "filds mem; fists mem" +diff -NPru gcc-2.95.3-orig/gcc/configure.in gcc-2.95.3/gcc/configure.in +--- gcc-2.95.3-orig/gcc/configure.in Thu Jan 25 08:03:02 2001 ++++ gcc-2.95.3/gcc/configure.in Fri Aug 10 13:48:30 2001 +@@ -4066,6 +4066,21 @@ + fi + AC_MSG_RESULT($gcc_cv_as_subsections) + ++AC_MSG_CHECKING(assembler hidden support) ++gcc_cv_as_hidden= ++if test x$gcc_cv_as != x; then ++ # Check if we have .hidden ++ echo " .hidden foobar" > conftest.s ++ echo "foobar:" >> conftest.s ++ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then ++ AC_DEFINE(HAVE_GAS_HIDDEN, 1, ++ [Define if your assembler supports .hidden.]) ++ gcc_cv_as_hidden="yes" ++ fi ++ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 ++fi ++AC_MSG_RESULT($gcc_cv_as_hidden) ++ + AC_MSG_CHECKING(assembler instructions) + gcc_cv_as_instructions= + if test x$gcc_cv_as != x; then +diff -NPru gcc-2.95.3-orig/gcc/crtstuff.c gcc-2.95.3/gcc/crtstuff.c +--- gcc-2.95.3-orig/gcc/crtstuff.c Mon Mar 22 18:43:51 1999 ++++ gcc-2.95.3/gcc/crtstuff.c Fri Aug 10 13:45:26 2001 +@@ -55,6 +55,7 @@ + #include "defaults.h" + #include <stddef.h> + #include "frame.h" ++#include "auto-host.h" + + /* We do not want to add the weak attribute to the declarations of these + routines in frame.h because that will cause the definition of these +@@ -135,6 +136,18 @@ + + #ifdef OBJECT_FORMAT_ELF + ++#ifdef HAVE_GAS_HIDDEN ++asm (".hidden\t__dso_handle"); ++#endif ++ ++#ifdef CRTSTUFFS_O ++void *__dso_handle = &__dso_handle; ++#else ++void *__dso_handle = 0; ++#endif ++ ++extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK; ++ + /* Run all the global destructors on exit from the program. */ + + /* Some systems place the number of pointers in the first word of the +@@ -165,6 +178,11 @@ + if (completed) + return; + ++#ifdef CRTSTUFFS_O ++ if (__cxa_finalize) ++ __cxa_finalize (__dso_handle); ++#endif ++ + while (*p) + { + p++; +@@ -379,20 +397,8 @@ + FORCE_INIT_SECTION_ALIGN; + #endif + asm (TEXT_SECTION_ASM_OP); +- +-/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, +- __environ and atexit (). We have to make sure they are in the .dynsym +- section. We accomplish it by making a dummy call here. This +- code is never reached. */ +- +-#if defined(__linux__) && defined(__PIC__) && defined(__i386__) +- { +- extern void *___brk_addr; +- extern char **__environ; +- +- ___brk_addr = __environ; +- atexit (); +- } ++#ifdef CRT_END_INIT_DUMMY ++ CRT_END_INIT_DUMMY; + #endif + } + +diff -NPru gcc-2.95.3-orig/gcc/rtl.h gcc-2.95.3/gcc/rtl.h +--- gcc-2.95.3-orig/gcc/rtl.h Thu Jan 25 08:03:22 2001 ++++ gcc-2.95.3/gcc/rtl.h Fri Aug 10 13:38:24 2001 +@@ -661,6 +661,8 @@ + /* 1 means a SYMBOL_REF has been the library function in emit_library_call. */ + #define SYMBOL_REF_USED(RTX) ((RTX)->used) + ++#define SYMBOL_REF_WEAK(RTX) ((RTX)->integrated) ++ + /* For an INLINE_HEADER rtx, FIRST_FUNCTION_INSN is the first insn + of the function that is not involved in copying parameters to + pseudo-registers. FIRST_PARM_INSN is the very first insn of +diff -NPru gcc-2.95.3-orig/gcc/rtlanal.c gcc-2.95.3/gcc/rtlanal.c +--- gcc-2.95.3-orig/gcc/rtlanal.c Thu Jan 25 08:03:22 2001 ++++ gcc-2.95.3/gcc/rtlanal.c Fri Aug 10 13:38:24 2001 +@@ -136,6 +136,8 @@ + switch (code) + { + case SYMBOL_REF: ++ return SYMBOL_REF_WEAK (x); ++ + case LABEL_REF: + /* SYMBOL_REF is problematic due to the possible presence of + a #pragma weak, but to say that loads from symbols can trap is +diff -NPru gcc-2.95.3-orig/gcc/varasm.c gcc-2.95.3/gcc/varasm.c +--- gcc-2.95.3-orig/gcc/varasm.c Mon Feb 19 08:02:02 2001 ++++ gcc-2.95.3/gcc/varasm.c Fri Aug 10 13:38:24 2001 +@@ -118,6 +118,8 @@ + struct rtx_const; + struct pool_constant; + ++void declare_weak PROTO ((tree)); ++ + static const char *strip_reg_name PROTO((const char *)); + static int contains_pointers_p PROTO((tree)); + static void decode_addr_const PROTO((tree, struct addr_const *)); +@@ -143,6 +145,7 @@ + static void output_after_function_constants PROTO((void)); + static void output_constructor PROTO((tree, int)); + static void remove_from_pending_weak_list PROTO ((char *)); ++static int is_on_pending_weak_list PROTO ((char *)); + #ifdef ASM_OUTPUT_BSS + static void asm_output_bss PROTO((FILE *, tree, char *, int, int)); + #endif +@@ -755,6 +758,9 @@ + DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), + gen_rtx_SYMBOL_REF (Pmode, name)); + MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl); ++ if (is_on_pending_weak_list (name)) ++ declare_weak (decl); ++ SYMBOL_REF_WEAK (XEXP (DECL_RTL (decl), 0)) = DECL_WEAK (decl); + + /* If this variable is to be treated as volatile, show its + tree node has side effects. If it has side effects, either +@@ -4341,8 +4347,6 @@ + { + if (! TREE_PUBLIC (decl)) + error_with_decl (decl, "weak declaration of `%s' must be public"); +- else if (TREE_ASM_WRITTEN (decl)) +- error_with_decl (decl, "weak declaration of `%s' must precede definition"); + else if (SUPPORTS_WEAK) + DECL_WEAK (decl) = 1; + #ifdef HANDLE_PRAGMA_WEAK +@@ -4394,6 +4398,24 @@ + } + } + #endif ++} ++ ++static int ++is_on_pending_weak_list (name) ++ char * name; ++{ ++#ifdef HANDLE_PRAGMA_WEAK ++ if (HANDLE_PRAGMA_WEAK) ++ { ++ struct weak_syms *t; ++ for (t = weak_decls; t; t = t->next) ++ { ++ if (t->name && strcmp (name, t->name) == 0) ++ return 1; ++ } ++ } ++#endif ++ return 0; + } + + void diff --git a/sys-devel/gcc/gcc-2.95.3-r7.ebuild b/sys-devel/gcc/gcc-2.95.3-r7.ebuild new file mode 100644 index 000000000000..7331d774c954 --- /dev/null +++ b/sys-devel/gcc/gcc-2.95.3-r7.ebuild @@ -0,0 +1,188 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-2.95.3-r7.ebuild,v 1.1 2002/06/29 17:44:07 azarah Exp $ + +TV=4.0 +SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/${P}/${P}.tar.gz" +# ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-${TV}.tar.gz +# ftp://ftp.ibiblio.org/pub/linux/distributions/gentoo/distfiles/texinfo-${TV}.tar.gz" + +S=${WORKDIR}/${P} +LOC=/usr +DESCRIPTION="Modern GCC C/C++ compiler and an included, upgraded version of texinfo to boot" +HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" + +DEPEND="virtual/glibc" +RDEPEND="virtual/glibc" +if [ -z "`use build`" ] +then + DEPEND="${DEPEND} nls? ( sys-devel/gettext ) + >=sys-libs/ncurses-5.2-r2 + >=sys-apps/texinfo-4.2-r1" + + RDEPEND="${RDEPEND} >=sys-libs/ncurses-5.2-r2" +fi + +#PROVIDE="sys-apps/texinfo" + + +src_unpack() { + unpack ${P}.tar.gz + + cd ${S} + + libtoolize --copy --force &> ${T}/foo-out + + # This new patch for the atexit problem occured with glibc-2.2.3 should + # work with glibc-2.2.4. This closes bug #3982. + # + # Azarah - 29 Jun 2002 + # + # http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2001/08/0476.html + patch -l -p1 < ${FILESDIR}/${P}-new-atexit.diff || die + + # Now we integrate texinfo-${TV} into gcc. It comes with texinfo-3.12. +# cd ${S} +# tar xzf ${DISTDIR}/texinfo-${TV}.tar.gz || die +# cp -a ${S}/texinfo-4.0/* ${S}/texinfo +# cd ${S}/texinfo +# if [ "`use build`" ] +# then +# patch -p0 < ${FILESDIR}/texinfo-${TV}-no-ncurses-gentoo.diff || die +# touch * +# fi +} + +src_compile() { + local myconf="" + if [ -z "`use build`" ] + then + myconf="${myconf} --enable-shared" + else + myconf="${myconf} --enable-languages=c" + fi + if [ -z "`use nls`" ] || [ "`use build`" ] + then + myconf="${myconf} --disable-nls" + else + myconf="${myconf} --enable-nls --without-included-gettext" + fi + + # gcc does not like optimization + + export CFLAGS="${CFLAGS/-O?/}" + export CXXFLAGS="${CXXFLAGS/-O?/}" + + ${S}/configure --prefix=${LOC} \ + --mandir=${LOC}/share/man \ + --infodir=${LOC}/share/info \ + --enable-version-specific-runtime-libs \ + --host=${CHOST} \ + --build=${CHOST} \ + --target=${CHOST} \ + --enable-threads \ + --with-local-prefix=${LOC}/local \ + ${myconf} || die + + if [ -z "`use static`" ] + then + emake bootstrap-lean || die + else + emake LDFLAGS=-static bootstrap || die + fi +} + +src_install() { + make install \ + prefix=${D}${LOC} \ + mandir=${D}${LOC}/share/man \ + infodir=${D}${LOC}/share/info || die + + # binutils libiberty.a and we want to use that version + # closes bug #2262 + rm -f ${D}/usr/lib/libiberty.a + + [ -e ${D}/usr/bin/gcc ] || die "gcc not found in ${D}" + + FULLPATH=${D}${LOC}/lib/gcc-lib/${CHOST}/${PV} + cd ${FULLPATH} + dodir /lib + dosym /usr/bin/cpp /lib/cpp + dosym gcc /usr/bin/cc + dodir /etc/env.d + echo "LDPATH=${LOC}/lib/gcc-lib/${CHOST}/${PV}" > \ + ${D}/etc/env.d/05gcc + + cd ${S} + if [ -z "`use build`" ] + then + #do a full texinfo-${TV} install + +# cd ${S}/texinfo +# make DESTDIR=${D} infodir=${D}/usr/share/info install || die +# exeinto /usr/sbin +# doexe ${FILESDIR}/mkinfodir +# +# cd ${D}/usr/share/info +# mv texinfo texinfo.info +# for i in texinfo-* +# do +# mv ${i} texinfo.info-${i#texinfo-*} +# done +# +# cd ${S}/texinfo +# docinto texinfo +# dodoc AUTHORS ChangeLog COPYING INTRODUCTION NEWS README TODO +# docinto texinfo/info +# dodoc info/README +# docinto texinfo/makeinfo +# dodoc makeinfo/README + + # end texinfo 4.0; begin more gcc stuff + + cd ${S} + docinto / + dodoc COPYING COPYING.LIB README* FAQ MAINTAINERS + docinto html + dodoc faq.html + docinto gcc + cd ${S}/gcc + dodoc BUGS ChangeLog* COPYING* FSFChangeLog* LANGUAGES NEWS PROBLEMS README* SERVICE TESTS.FLUNK + cd ${S}/libchill + docinto libchill + dodoc ChangeLog + cd ${S}/libf2c + docinto libf2c + dodoc ChangeLog changes.netlib README TODO + cd ${S}/libio + docinto libio + dodoc ChangeLog NEWS README + cd dbz + docinto libio/dbz + dodoc README + cd ../stdio + docinto libio/stdio + dodoc ChangeLog* + cd ${S}/libobjc + docinto libobjc + dodoc ChangeLog README* THREADS* + cd ${S}/libstdc++ + docinto libstdc++ + dodoc ChangeLog NEWS + else + rm -rf ${D}/usr/share/{man,info} + # do a minimal texinfo install (build image) +# cd ${S}/texinfo +# dobin makeinfo/makeinfo util/{install-info,texi2dvi,texindex} + fi +} + +pkg_preinst() { + # downgrading from gcc-3.x will leave this symlink, so + # remove it. resolves bug #3527 + if [ -L ${ROOT}/usr/bin/${CHOST}-g++ ] + then + rm -f ${ROOT}/usr/bin/${CHOST}-g++ + fi +} + |