From: H.J. Lu Date: Tue, 31 Mar 2015 10:58:15 +0000 (-0700) Subject: Remove --with-zlib from ld X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f24173ebf754866d4a1881a28dc2c07062c119d7;p=binutils-gdb.git Remove --with-zlib from ld This patch removes --with-zlib from ld. ld/ * configure.ac (AM_ZLIB): Removed. * Makefile.in: Regenerated. * config.in: Likewise. * configure: Likewise. ld/testsuite/ * ld-bootstrap/bootstrap.exp (extralibs): Add -lz. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 3a5edf28902..7b280142c7b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2015-03-31 H.J. Lu + + * configure.ac (AM_ZLIB): Removed. + * Makefile.in: Regenerated. + * config.in: Likewise. + * configure: Likewise. + 2015-03-24 Marcus Shawcroft * emultempl/aarch64elf.em (_aarch64_add_stub_section): Set section diff --git a/ld/Makefile.in b/ld/Makefile.in index 3236d7e95da..97fc3fa320f 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -68,7 +68,6 @@ DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \ $(srcdir)/../ylwrap $(ld_TEXINFOS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/zlib.m4 \ $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ diff --git a/ld/config.in b/ld/config.in index ad015fe1a16..a9a37e0dc50 100644 --- a/ld/config.in +++ b/ld/config.in @@ -148,9 +148,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H -/* Define to 1 if you have the header file. */ -#undef HAVE_ZLIB_H - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR diff --git a/ld/configure b/ld/configure index 7af2626d5bc..4a312dfabf8 100755 --- a/ld/configure +++ b/ld/configure @@ -789,7 +789,6 @@ enable_werror enable_build_warnings enable_nls enable_initfini_array -with_zlib ' ac_precious_vars='build_alias host_alias @@ -1455,7 +1454,6 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-lib-path=dir1:dir2... set default LIB_PATH --with-sysroot=DIR Search for usr/lib et al within DIR. - --with-zlib include zlib support (auto/yes/no) default=auto Some influential environment variables: CC C compiler command @@ -11712,7 +11710,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11715 "configure" +#line 11713 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11818,7 +11816,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11821 "configure" +#line 11819 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16936,93 +16934,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -# Link in zlib if we can. This is needed only for the bootstrap tests -# right now, since those tests use libbfd, which depends on zlib. - - # See if the user specified whether he wants zlib support or not. - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; -else - with_zlib=auto -fi - - - if test "$with_zlib" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5 -$as_echo_n "checking for library containing zlibVersion... " >&6; } -if test "${ac_cv_search_zlibVersion+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char zlibVersion (); -int -main () -{ -return zlibVersion (); - ; - return 0; -} -_ACEOF -for ac_lib in '' z; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_zlibVersion=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_zlibVersion+set}" = set; then : - break -fi -done -if test "${ac_cv_search_zlibVersion+set}" = set; then : - -else - ac_cv_search_zlibVersion=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5 -$as_echo "$ac_cv_search_zlibVersion" >&6; } -ac_res=$ac_cv_search_zlibVersion -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - for ac_header in zlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZLIB_H 1 -_ACEOF - -fi - -done - -fi - - if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then - as_fn_error "zlib (libz) library was explicitly requested but not found" "$LINENO" 5 - fi - fi - - # When converting linker scripts into strings for use in emulation # files, use astring.sed if the compiler supports ANSI string # concatenation, or ostring.sed otherwise. This is to support the diff --git a/ld/configure.ac b/ld/configure.ac index e926c03dbfc..a885b7b2038 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -239,10 +239,6 @@ BFD_BINARY_FOPEN AC_CHECK_DECLS([strstr, free, sbrk, getenv, environ]) -# Link in zlib if we can. This is needed only for the bootstrap tests -# right now, since those tests use libbfd, which depends on zlib. -AM_ZLIB - # When converting linker scripts into strings for use in emulation # files, use astring.sed if the compiler supports ANSI string # concatenation, or ostring.sed otherwise. This is to support the diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index ff9ba666204..47bb489a1fc 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-31 H.J. Lu + + * ld-bootstrap/bootstrap.exp (extralibs): Add -lz. + 2015-03-30 H.J. Lu PR ld/18169 diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp index fe8031dcd18..3b6eb84dcc6 100644 --- a/ld/testsuite/ld-bootstrap/bootstrap.exp +++ b/ld/testsuite/ld-bootstrap/bootstrap.exp @@ -120,6 +120,13 @@ foreach flags $test_flags { } } + # Check if the system's zlib library is used. + if {[file exists ../zlib/Makefile ]} then { + set extralibs "$extralibs -L../zlib -lz" + } else { + set extralibs "$extralibs -lz" + } + # Plugin support requires linking with libdl. if { $plugins == "yes" } { if { ![istarget "*-*-freebsd*"]} {