Re: [parisc-linux] glibc is broken because of gcc
seb@frankengul.org a écrit :
On Tue, Jun 12, 2007 at 10:48:06AM +0200, seb@frankengul.org wrote:
The gcc-4.1 4.1.2-8 builds the package ok.
The gcc-4.1 4.1.2-11 is ko.
Seb
Problem logged on debian bug #428509.
Seb
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Here is the reduced diff. I removed anything that is unrelated to hppa,
C or anything.
The diff is between -7 and -12.
The diff is mere 300 lines long.
The problem lies here.
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/configure gcc-4.1-4.1.2-12/src/configure
--- gcc-4.1-4.1.2-7/src/configure 2007-06-12 22:08:36.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/configure 2006-11-21 18:48:36.000000000 +0100
@@ -16,8 +16,6 @@
ac_help="$ac_help
--enable-libssp Builds libssp directory"
ac_help="$ac_help
- --enable-libffi Builds libffi directory"
-ac_help="$ac_help
--with-mpfr-dir=PATH Specify source directory for MPFR library"
ac_help="$ac_help
--with-mpfr=PATH Specify directory for installed MPFR library"
@@ -1109,20 +1107,6 @@
noconfigdirs="$noconfigdirs target-libssp"
fi
-# Check whether --enable-libffi or --disable-libffi was given.
-if test "${enable_libffi+set}" = set; then
- enableval="$enable_libffi"
- ENABLE_LIBFFI=$enableval
-else
- ENABLE_LIBFFI=yes
-fi
-
-if test "${ENABLE_LIBFFI}" != "yes" ; then
- noconfigdirs="$noconfigdirs target-libffi"
-else
- libgcj="`echo $libgcj | sed 's/target-libffi *//'`"
-fi
-
# Save it here so that, even in case of --enable-libgcj, if the Java
# front-end isn't enabled, we still get libgcj disabled.
libgcj_saved=$libgcj
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/configure.in gcc-4.1-4.1.2-12/src/configure.in
--- gcc-4.1-4.1.2-7/src/configure.in 2007-06-12 22:08:36.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/configure.in 2006-11-21 18:48:36.000000000 +0100
@@ -315,16 +315,6 @@
noconfigdirs="$noconfigdirs target-libssp"
fi
-AC_ARG_ENABLE(libffi,
-[ --enable-libffi Builds libffi directory],
-ENABLE_LIBFFI=$enableval,
-ENABLE_LIBFFI=yes)
-if test "${ENABLE_LIBFFI}" != "yes" ; then
- noconfigdirs="$noconfigdirs target-libffi"
-else
- libgcj="`echo $libgcj | sed 's/target-libffi *//'`"
-fi
-
# Save it here so that, even in case of --enable-libgcj, if the Java
# front-end isn't enabled, we still get libgcj disabled.
libgcj_saved=$libgcj
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/cgraphunit.c gcc-4.1-4.1.2-12/src/gcc/cgraphunit.c
--- gcc-4.1-4.1.2-7/src/gcc/cgraphunit.c 2007-01-05 20:44:10.000000000 +0100
+++ gcc-4.1-4.1.2-12/src/gcc/cgraphunit.c 2007-06-12 22:13:19.000000000 +0200
@@ -1330,8 +1330,6 @@
return;
}
- process_pending_assemble_externals ();
-
/* Frontend may output common variables after the unit has been finalized.
It is safe to deal with them here as they are always zero initialized. */
cgraph_varpool_analyze_pending_decls ();
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/combine.c gcc-4.1-4.1.2-12/src/gcc/combine.c
--- gcc-4.1-4.1.2-7/src/gcc/combine.c 2007-01-21 23:34:57.000000000 +0100
+++ gcc-4.1-4.1.2-12/src/gcc/combine.c 2007-06-12 22:12:56.000000000 +0200
@@ -5443,11 +5443,11 @@
SUBST(SET_SRC (x), op0);
src = SET_SRC (x);
}
- else
- {
/* Otherwise, update the COMPARE if needed. */
- SUBST (XEXP (src, 0), op0);
- SUBST (XEXP (src, 1), op1);
+ else if (XEXP (src, 0) != op0 || XEXP (src, 1) != op1)
+ {
+ SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1));
+ src = SET_SRC (x);
}
}
else
--- gcc-4.1-4.1.2-7/src/gcc/config/elfos.h 2006-08-01 00:08:47.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/config/elfos.h 2007-06-12 22:13:19.000000000 +0200
@@ -494,3 +494,13 @@
fprintf ((FILE), "\"\n"); \
} \
while (0)
+
+/* A C statement (sans semicolon) to output to the stdio stream STREAM
+ any text necessary for declaring the name of an external symbol
+ named NAME whch is referenced in this compilation but not defined.
+ It is needed to properly support non-default visibility. */
+
+#ifndef ASM_OUTPUT_EXTERNAL
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+ default_elf_asm_output_external (FILE, DECL, NAME)
+#endif
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/config/t-libc-ok gcc-4.1-4.1.2-12/src/gcc/config/t-libc-ok
--- gcc-4.1-4.1.2-7/src/gcc/config/t-libc-ok 2002-11-26 23:47:18.000000000 +0100
+++ gcc-4.1-4.1.2-12/src/gcc/config/t-libc-ok 2007-06-12 22:13:19.000000000 +0200
@@ -1 +1 @@
-CRTSTUFF_T_CFLAGS_S=-fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/config/t-netbsd gcc-4.1-4.1.2-12/src/gcc/config/t-netbsd
--- gcc-4.1-4.1.2-7/src/gcc/config/t-netbsd 2003-09-23 20:56:00.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/config/t-netbsd 2007-06-12 22:13:19.000000000 +0200
@@ -1,2 +1,2 @@
# Always build crtstuff with PIC.
-CRTSTUFF_T_CFLAGS = -fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/config/t-svr4 gcc-4.1-4.1.2-12/src/gcc/config/t-svr4
--- gcc-4.1-4.1.2-7/src/gcc/config/t-svr4 2001-11-15 14:05:54.000000000 +0100
+++ gcc-4.1-4.1.2-12/src/gcc/config/t-svr4 2007-06-12 22:13:19.000000000 +0200
@@ -4,7 +4,7 @@
# we will be doing that, we just always use -fPIC when compiling the
# routines in crtstuff.c. Likewise for libgcc2.c.
-CRTSTUFF_T_CFLAGS = -fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
TARGET_LIBGCC2_CFLAGS = -fPIC
# See all the declarations.
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/Makefile.in gcc-4.1-4.1.2-12/src/gcc/Makefile.in
--- gcc-4.1-4.1.2-7/src/gcc/Makefile.in 2007-06-12 22:09:40.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/Makefile.in 2007-06-12 22:14:00.000000000 +0200
@@ -130,7 +130,7 @@
# Selection of languages to be made.
CONFIG_LANGUAGES = @all_languages@
-LANGUAGES = c proto gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
+LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
# Selection of languages to be made during stage1 build.
BOOT_LANGUAGES = c @all_boot_languages@
@@ -3042,7 +3042,7 @@
coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -Wno-error \
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
$(DRIVER_DEFINES) \
$(srcdir)/protoize.c $(OUTPUT_OPTION))
@@ -3050,7 +3050,7 @@
$(SYSTEM_H) coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
- $(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) -Wno-error \
+ $(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
$(DRIVER_DEFINES) \
$(srcdir)/protoize.c $(OUTPUT_OPTION))
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/output.h gcc-4.1-4.1.2-12/src/gcc/output.h
--- gcc-4.1-4.1.2-7/src/gcc/output.h 2005-10-26 09:03:30.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/output.h 2007-06-12 22:13:19.000000000 +0200
@@ -274,9 +274,9 @@
initial value (that will be done by the caller). */
extern void assemble_variable (tree, int, int, int);
-/* Output something to declare an external symbol to the assembler.
- (Most assemblers don't need this, so we normally output nothing.)
- Do nothing if DECL is not external. */
+/* Queue for outputing something to declare an external symbol to the
+ assembler. (Most assemblers don't need this, so we normally output
+ nothing.) Do nothing if DECL is not external. */
extern void assemble_external (tree);
/* Assemble code to leave SIZE bytes of zeros. */
@@ -586,6 +586,10 @@
extern void file_end_indicate_exec_stack (void);
extern bool default_valid_pointer_mode (enum machine_mode);
+extern void default_elf_asm_output_external (FILE *file, tree,
+ const char *);
+extern int maybe_assemble_visibility (tree);
+
extern int default_address_cost (rtx);
/* dbxout helper functions */
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/toplev.c gcc-4.1-4.1.2-12/src/gcc/toplev.c
--- gcc-4.1-4.1.2-7/src/gcc/toplev.c 2006-08-03 13:33:49.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/toplev.c 2007-06-12 22:13:19.000000000 +0200
@@ -1033,9 +1033,7 @@
dw2_output_indirect_constants ();
- /* Flush any pending external directives. cgraph did this for
- assemble_external calls from the front end, but the RTL
- expander can also generate them. */
+ /* Flush any pending external directives. */
process_pending_assemble_externals ();
/* Attach a special .ident directive to the end of the file to identify
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/tree-vrp.c gcc-4.1-4.1.2-12/src/gcc/tree-vrp.c
--- gcc-4.1-4.1.2-7/src/gcc/tree-vrp.c 2007-06-12 22:08:01.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/tree-vrp.c 2007-06-12 22:12:54.000000000 +0200
@@ -1517,13 +1517,20 @@
if (code == NEGATE_EXPR
&& !TYPE_UNSIGNED (TREE_TYPE (expr)))
{
- /* NEGATE_EXPR flips the range around. */
- min = (vr0.max == TYPE_MAX_VALUE (TREE_TYPE (expr)) && !flag_wrapv)
+ /* NEGATE_EXPR flips the range around. We need to treat
+ TYPE_MIN_VALUE specially dependent on wrapping, range type
+ and if it was used as minimum or maximum value:
+ -~[MIN, MIN] == ~[MIN, MIN]
+ -[MIN, 0] == [0, MAX] for -fno-wrapv
+ -[MIN, 0] == [0, MIN] for -fwrapv (will be set to varying later) */
+ min = vr0.max == TYPE_MIN_VALUE (TREE_TYPE (expr))
? TYPE_MIN_VALUE (TREE_TYPE (expr))
: fold_unary_to_constant (code, TREE_TYPE (expr), vr0.max);
- max = (vr0.min == TYPE_MIN_VALUE (TREE_TYPE (expr)) && !flag_wrapv)
- ? TYPE_MAX_VALUE (TREE_TYPE (expr))
+ max = vr0.min == TYPE_MIN_VALUE (TREE_TYPE (expr))
+ ? (vr0.type == VR_ANTI_RANGE || flag_wrapv
+ ? TYPE_MIN_VALUE (TREE_TYPE (expr))
+ : TYPE_MAX_VALUE (TREE_TYPE (expr)))
: fold_unary_to_constant (code, TREE_TYPE (expr), vr0.min);
}
else if (code == ABS_EXPR
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/varasm.c gcc-4.1-4.1.2-12/src/gcc/varasm.c
--- gcc-4.1-4.1.2-7/src/gcc/varasm.c 2006-10-16 11:58:48.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/varasm.c 2007-06-12 22:13:19.000000000 +0200
@@ -126,7 +126,6 @@
static unsigned min_align (unsigned, unsigned);
static void output_constructor (tree, unsigned HOST_WIDE_INT, unsigned int);
static void globalize_decl (tree);
-static void maybe_assemble_visibility (tree);
static int in_named_entry_eq (const void *, const void *);
static hashval_t in_named_entry_hash (const void *);
static void initialize_cold_section_name (void);
@@ -1935,11 +1934,10 @@
if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
return;
- if (flag_unit_at_a_time)
+ /* We want to output external symbols at very last to check if they
+ are references or not. */
pending_assemble_externals = tree_cons (0, decl,
pending_assemble_externals);
- else
- assemble_external_real (decl);
#endif
}
@@ -4970,13 +4968,18 @@
/* A helper function to call assemble_visibility when needed for a decl. */
-static void
+int
maybe_assemble_visibility (tree decl)
{
enum symbol_visibility vis = DECL_VISIBILITY (decl);
if (vis != VISIBILITY_DEFAULT)
+ {
targetm.asm_out.visibility (decl, vis);
+ return 1;
+ }
+ else
+ return 0;
}
/* Returns 1 if the target configuration supports defining public symbols
@@ -5752,4 +5755,19 @@
named_section_flags (".note.GNU-stack", flags);
}
+/* Emit text to declare externally defined symbols. It is needed to
+ properly support non-default visibility. */
+void
+default_elf_asm_output_external (FILE *file ATTRIBUTE_UNUSED,
+ tree decl,
+ const char *name ATTRIBUTE_UNUSED)
+{
+ /* We output the name if and only if TREE_SYMBOL_REFERENCED is
+ set in order to avoid putting out names that are never really
+ used. */
+ if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
+ && targetm.binds_local_p (decl))
+ maybe_assemble_visibility (decl);
+}
+
#include "gt-varasm.h"
diff -r -u -b -B -w gcc-4.1-4.1.2-7/src/gcc/version.c gcc-4.1-4.1.2-12/src/gcc/version.c
--- gcc-4.1-4.1.2-7/src/gcc/version.c 2007-06-12 22:09:41.000000000 +0200
+++ gcc-4.1-4.1.2-12/src/gcc/version.c 2007-06-12 22:14:07.000000000 +0200
@@ -8,7 +8,7 @@
in parentheses. You may also wish to include a number indicating
the revision of your modified compiler. */
-#define VERSUFFIX " (Debian 4.1.2-7)"
+#define VERSUFFIX " (Debian 4.1.2-12)"
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
Reply to: