AC_LANG_POP([C++])])
AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=])
-if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
+if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
AC_MSG_ERROR([you must configure in a separate build directory])
fi
AC_SUBST(add_on_subdirs)
-###
-### I put this here to prevent those annoying emails from people who cannot
-### read and try to compile glibc on unsupported platforms. --drepper
###
### By using the undocumented --enable-hacker-mode option for configure
### one can skip this test to make the configuration not fail for unsupported
*-linux* | *-gnu*)
;;
*)
- echo "*** The GNU C library is currently not available for this platform."
- echo "*** So far nobody cared to port it and if there is no volunteer it"
- echo "*** might never happen. So, if you have interest to see glibc on"
- echo "*** this platform visit"
- echo "*** http://www.gnu.org/software/libc/porting.html"
- echo "*** and join the group of porters"
- exit 1
+ AC_MSG_ERROR([
+*** The GNU C library is currently unavailable for this platform.
+*** If you are interested in seeing glibc on this platform visit
+*** the "How to submit a new port" in the wiki:
+*** https://sourceware.org/glibc/wiki/#Development
+*** and join the community!])
;;
esac
fi
AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
fi
-AC_CACHE_CHECK(for .protected and .hidden assembler directive,
- libc_cv_asm_protected_directive, [dnl
-cat > conftest.s <<EOF
-.protected foo
-foo:
-.hidden bar
-bar:
-EOF
-if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
- libc_cv_asm_protected_directive=yes
-else
- AC_MSG_ERROR(assembler support for symbol visibility is required)
-fi
-rm -f conftest*])
-
-if test $libc_cv_asm_protected_directive = yes; then
- AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
- libc_cv_visibility_attribute,
- [cat > conftest.c <<EOF
- int foo __attribute__ ((visibility ("hidden"))) = 1;
- int bar __attribute__ ((visibility ("protected"))) = 1;
-EOF
- libc_cv_visibility_attribute=no
- if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
- if grep '\.hidden.*foo' conftest.s >/dev/null; then
- if grep '\.protected.*bar' conftest.s >/dev/null; then
- libc_cv_visibility_attribute=yes
- fi
- fi
- fi
- rm -f conftest.{c,s}
- ])
- if test $libc_cv_visibility_attribute != yes; then
- AC_MSG_ERROR(compiler support for visibility attribute is required)
- fi
-fi
-
-if test $libc_cv_visibility_attribute = yes; then
- AC_CACHE_CHECK(linker support for protected data symbol,
- libc_cv_protected_data,
- [cat > conftest.c <<EOF
- int bar __attribute__ ((visibility ("protected"))) = 1;
+AC_CACHE_CHECK(linker support for protected data symbol,
+ libc_cv_protected_data,
+ [cat > conftest.c <<EOF
+ int bar __attribute__ ((visibility ("protected"))) = 1;
EOF
- libc_cv_protected_data=no
- if AC_TRY_COMMAND(${CC-cc} -nostdlib -nostartfiles -fPIC -shared conftest.c -o conftest.so); then
- cat > conftest.c <<EOF
- extern int bar;
- int main (void) { return bar; }
+ libc_cv_protected_data=no
+ if AC_TRY_COMMAND(${CC-cc} -nostdlib -nostartfiles -fPIC -shared conftest.c -o conftest.so); then
+ cat > conftest.c <<EOF
+ extern int bar;
+ int main (void) { return bar; }
EOF
- if AC_TRY_COMMAND(${CC-cc} -nostdlib -nostartfiles conftest.c -o conftest conftest.so); then
- libc_cv_protected_data=yes
- fi
+ if AC_TRY_COMMAND(${CC-cc} -nostdlib -nostartfiles conftest.c -o conftest conftest.so); then
+ libc_cv_protected_data=yes
fi
- rm -f conftest.*
- ])
-else
- libc_cv_protected_data=no
-fi
+ fi
+ rm -f conftest.*
+ ])
AC_SUBST(libc_cv_protected_data)
-if test $libc_cv_visibility_attribute = yes; then
- AC_CACHE_CHECK(for broken __attribute__((visibility())),
- libc_cv_broken_visibility_attribute,
- [cat > conftest.c <<EOF
- int foo (int x);
- int bar (int x) __asm__ ("foo") __attribute__ ((visibility ("hidden")));
- int bar (int x) { return x; }
-EOF
- libc_cv_broken_visibility_attribute=yes
- if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
-changequote(,)dnl
- if grep '\.hidden[ _]foo' conftest.s >/dev/null; then
-changequote([,])dnl
- libc_cv_broken_visibility_attribute=no
- fi
- fi
- rm -f conftest.c conftest.s
- ])
- if test $libc_cv_broken_visibility_attribute = yes; then
- AC_MSG_ERROR(working compiler support for visibility attribute is required)
- fi
-fi
-
AC_CACHE_CHECK(for broken __attribute__((alias())),
libc_cv_broken_alias_attribute,
[cat > conftest.c <<EOF
AC_MSG_ERROR(working alias attribute support required)
fi
-if test $libc_cv_visibility_attribute = yes; then
- AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
- libc_cv_have_sdata_section,
- [echo "int i;" > conftest.c
- libc_cv_have_sdata_section=no
- if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
- | grep '\.sdata' >/dev/null; then
- libc_cv_have_sdata_section=yes
- fi
- rm -f conftest.c conftest.so
- ])
- if test $libc_cv_have_sdata_section = yes; then
- AC_DEFINE(HAVE_SDATA_SECTION)
- fi
-fi
-
-AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
- libc_cv_initfini_array, [dnl
-LIBC_TRY_LINK_STATIC([
-int foo (void) { return 1; }
-int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
-],
- [if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
- libc_cv_initfini_array=yes
- else
- libc_cv_initfini_array=no
- fi],
- [libc_cv_initfini_array=no])
-])
-if test $libc_cv_initfini_array != yes; then
- AC_MSG_ERROR([Need linker with .init_array/.fini_array support.])
+AC_CACHE_CHECK(whether to put _rtld_local into .sdata section,
+ libc_cv_have_sdata_section,
+ [echo "int i;" > conftest.c
+ libc_cv_have_sdata_section=no
+ if ${CC-cc} $LDFLAGS -fPIC -shared -Wl,--verbose conftest.c -o conftest.so 2>&1 \
+ | grep '\.sdata' >/dev/null; then
+ libc_cv_have_sdata_section=yes
+ fi
+ rm -f conftest.c conftest.so
+ ])
+if test $libc_cv_have_sdata_section = yes; then
+ AC_DEFINE(HAVE_SDATA_SECTION)
fi
AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
fi
-LIBC_LINKER_FEATURE([-z nodelete], [-Wl,--enable-new-dtags,-z,nodelete],
- [libc_cv_z_nodelete=yes],
- [AC_MSG_ERROR(linker with -z nodelete support required)])
-
-LIBC_LINKER_FEATURE([-z nodlopen], [-Wl,--enable-new-dtags,-z,nodlopen],
- [libc_cv_z_nodlopen=yes],
- [AC_MSG_ERROR(linker with -z nodlopen support required)])
-
-LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst],
- [libc_cv_z_initfirst=yes],
- [AC_MSG_ERROR(linker with -z initfirst support required)])
-
ASFLAGS_config=
AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
libc_cv_as_noexecstack, [dnl
use_default_link=$libc_cv_use_default_link
fi
+AC_CACHE_CHECK(for GLOB_DAT reloc,
+ libc_cv_has_glob_dat, [dnl
+cat > conftest.c <<EOF
+extern int mumble;
+int foo (void) { return mumble; }
+EOF
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -fPIC -shared -o conftest.so conftest.c
+ -nostdlib -nostartfiles
+ 1>&AS_MESSAGE_LOG_FD])
+then
+dnl look for GLOB_DAT relocation.
+ if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
+ libc_cv_has_glob_dat=yes
+ else
+ libc_cv_has_glob_dat=no
+ fi
+else
+ libc_cv_has_glob_dat=no
+fi
+rm -f conftest*])
+AC_SUBST(libc_cv_has_glob_dat)
+
AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
if libc_cv_output_format=`
${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
AC_DEFINE(HAVE_SECTION_QUOTES)
fi
-AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
-cat > conftest.c <<\EOF
-_start () {}
-int __eh_pc;
-__throw () {}
-EOF
-dnl No \ in command here because it ends up inside ''.
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]); then
- libc_cv_ld_no_whole_archive=yes
-else
- libc_cv_ld_no_whole_archive=no
-fi
-rm -f conftest*])
-if test $libc_cv_ld_no_whole_archive = no; then
- AC_MSG_ERROR([support for --no-whole-archive is needed])
-fi
-
AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
cat > conftest.c <<\EOF
void zero (void *x)
AC_SUBST(libc_cv_slibdir)
AC_SUBST(libc_cv_rtlddir)
-AC_SUBST(libc_cv_localedir)
+AC_SUBST(libc_cv_complocaledir)
AC_SUBST(libc_cv_sysconfdir)
AC_SUBST(libc_cv_localstatedir)
AC_SUBST(libc_cv_rootsbindir)