From a38527720bb6ec4c408d0fe2cce56002390565b5 Mon Sep 17 00:00:00 2001 From: asac Date: Fri, 2 Feb 2007 14:09:13 +0100 Subject: [PATCH] bz366844-mozilla-configure-in-patch-to-workaround-gcc-visibility-bug * mozilla/configure.in: patch to workaround gcc visibility bug Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=366844 Attachment: https://bugzilla.mozilla.org/attachment.cgi?id=251463 --- configure.in | 41 ++++++++++++++++++++++++++++++++++------- 1 files changed, 34 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 78d07a0..cc007b5 100644 --- a/configure.in +++ b/configure.in @@ -2518,7 +2518,7 @@ if test "$GNU_CC"; then EOF ac_cv_visibility_hidden=no if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then - if grep '\.hidden.*foo' conftest.s >/dev/null; then + if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then ac_cv_visibility_hidden=yes fi fi @@ -2534,7 +2534,7 @@ EOF EOF ac_cv_visibility_default=no if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then - if ! grep '\.hidden.*foo' conftest.s >/dev/null; then + if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then ac_cv_visibility_default=yes fi fi @@ -2553,8 +2553,8 @@ EOF EOF ac_cv_visibility_pragma=no if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then - if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then - if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then + if egrep '\.(hidden|extern_private).*foo_hidden' conftest.s >/dev/null; then + if ! egrep '\.(hidden|extern_private).*foo_default' conftest.s > /dev/null; then ac_cv_visibility_pragma=yes fi fi @@ -2562,6 +2562,28 @@ EOF rm -f conftest.[cs] ]) if test "$ac_cv_visibility_pragma" = "yes"; then + AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), + ac_cv_have_visibility_class_bug, + [cat > conftest.c < /dev/null 2>&1 ; then + ac_cv_have_visibility_class_bug=yes + else + if test `grep -c "@PLT" conftest.S` = 0; then + ac_cv_have_visibility_class_bug=yes + fi + fi + rm -rf conftest.{c,S} + ]) + AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), ac_cv_have_visibility_builtin_bug, [cat > conftest.c </dev/null 2>&1; then + if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then ac_cv_have_visibility_builtin_bug=yes + else + if test `grep -c "@PLT" conftest.S` = 0; then + ac_cv_visibility_builtin_bug=yes + fi fi - rm -f conftest.{c,so} + rm -f conftest.{c,S} ]) - if test "$ac_cv_have_visibility_builtin_bug" = "no"; then + if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ + "$ac_cv_have_visibility_class_bug" = "no"; then VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' WRAP_SYSTEM_INCLUDES=1 else -- 1.4.4.4