From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7460 invoked by alias); 10 Feb 2012 11:53:42 -0000 Received: (qmail 7333 invoked by uid 22791); 10 Feb 2012 11:53:38 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bar.sig21.net (HELO bar.sig21.net) (80.81.252.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Feb 2012 11:53:15 +0000 Received: from p5099b351.dip0.t-ipconnect.de ([80.153.179.81] helo=zzz.local) by bar.sig21.net with esmtpsa (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.69) (envelope-from ) id 1Rvp2N-00008h-7Q; Fri, 10 Feb 2012 12:53:13 +0100 Received: from js by zzz.local with local (Exim 4.77) (envelope-from ) id 1Rvp2M-0004ai-MW; Fri, 10 Feb 2012 12:53:10 +0100 Date: Fri, 10 Feb 2012 11:53:00 -0000 From: Johannes Stezenbach To: crossgcc@sourceware.org Cc: "Yann E. MORIN" Subject: [PATCH] Add zlib in case host's version is too old. Message-ID: <20120210115310.GC26179@sig21.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-21-Score: -2.9 (--) X-Spam-21-Report: No, score=-2.9 required=8.0 tests=ALL_TRUSTED=-1,BAYES_00=-1.9 autolearn=ham X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00067.txt.bz2 zlib is used by both binutils and gdb and the build fails on hosts which have a really old zlib version. (gcc has its own zlib included) Signed-off-by: Johannes Stezenbach diff -r e0d70cf2b396 -r cc5137ade317 config/companion_libs.in --- a/config/companion_libs.in Thu Feb 09 13:09:08 2012 +0100 +++ b/config/companion_libs.in Fri Feb 10 12:14:16 2012 +0100 @@ -94,6 +94,19 @@ source "config/companion_libs/libelf.in" endif +config ZLIB + bool + prompt "zlib" + help + While gcc comes with its own zlib version, both binutils + and gdb use the zlib provided by the build host, which is + usually OK. Select this if the zlib on the build host is + really, really old. + +config ZLIB_VERSION + string + default "1.2.5" + config FOO bool diff -r e0d70cf2b396 -r cc5137ade317 scripts/build/binutils/binutils.sh --- a/scripts/build/binutils/binutils.sh Thu Feb 09 13:09:08 2012 +0100 +++ b/scripts/build/binutils/binutils.sh Fri Feb 10 12:14:16 2012 +0100 @@ -74,6 +74,7 @@ CT_DoExecLog CFG \ CFLAGS="${CT_CFLAGS_FOR_HOST}" \ CXXFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CPPFLAGS="-I${CT_COMPLIBS_DIR}/include" \ "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ @@ -86,9 +87,11 @@ "${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}" if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then - extra_make_flags+=("LDFLAGS=-static -all-static") + extra_make_flags+=("LDFLAGS=-static -all-static -L${CT_COMPLIBS_DIR}/lib") CT_DoLog EXTRA "Prepare binutils for static build" CT_DoExecLog ALL make ${JOBSFLAGS} configure-host + else + extra_make_flags+=("LDFLAGS=-L${CT_COMPLIBS_DIR}/lib") fi CT_DoLog EXTRA "Building binutils" diff -r e0d70cf2b396 -r cc5137ade317 scripts/build/companion_libs/zlib.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/build/companion_libs/zlib.sh Fri Feb 10 12:14:16 2012 +0100 @@ -0,0 +1,45 @@ +# Build script for zlib + +do_zlib_get() { :; } +do_zlib_extract() { :; } +do_zlib() { :; } + +if [ "${CT_ZLIB}" = "y" ]; then + +do_zlib_get() { + CT_GetFile "zlib-${CT_ZLIB_VERSION}" http://zlib.net/ +} + +do_zlib_extract() { + CT_Extract "zlib-${CT_ZLIB_VERSION}" + CT_Patch "zlib" "${CT_ZLIB_VERSION}" +} + +do_zlib() { + CT_DoStep INFO "Installing zlib" + mkdir -p "${CT_BUILD_DIR}/build-zlib" + CT_Pushd "${CT_BUILD_DIR}/build-zlib" + + CT_DoLog EXTRA "Configuring zlib" + + # zlib has non-standard configure which only works in the src tree + CT_DoExecLog ALL \ + cp -al ${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/* . + + CT_DoExecLog CFG \ + CC="${CT_HOST}-gcc" \ + AR="${CT_HOST}-ar" \ + "./configure" --prefix="${CT_COMPLIBS_DIR}" --static + + CT_DoLog EXTRA "Building zlib" + CT_DoExecLog ALL make + + CT_DoLog EXTRA "Installing zlib" + CT_DoExecLog ALL cp libz.a ${CT_COMPLIBS_DIR}/lib/ + CT_DoExecLog ALL cp zlib.h zconf.h ${CT_COMPLIBS_DIR}/include/ + + CT_Popd + CT_EndStep +} + +fi # CT_ZLIB diff -r e0d70cf2b396 -r cc5137ade317 scripts/build/debug/300-gdb.sh --- a/scripts/build/debug/300-gdb.sh Thu Feb 09 13:09:08 2012 +0100 +++ b/scripts/build/debug/300-gdb.sh Fri Feb 10 12:14:16 2012 +0100 @@ -143,6 +143,8 @@ CT_DoExecLog CFG \ CC="${CC_for_gdb}" \ LD="${LD_for_gdb}" \ + CPPFLAGS="-I${CT_COMPLIBS_DIR}/include" \ + LDFLAGS="-L${CT_COMPLIBS_DIR}/lib" \ "${gdb_cross_configure}" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ diff -r e0d70cf2b396 -r cc5137ade317 scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Thu Feb 09 13:09:08 2012 +0100 +++ b/scripts/crosstool-NG.sh.in Fri Feb 10 12:14:16 2012 +0100 @@ -121,6 +121,7 @@ . "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/libelf.sh" +. "${CT_LIB_DIR}/scripts/build/companion_libs/zlib.sh" . "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh" . "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh" . "${CT_LIB_DIR}/scripts/build/binutils/sstrip.sh" @@ -531,6 +532,7 @@ do_cloog_get do_mpc_get do_libelf_get + do_zlib_get do_binutils_get do_elf2flt_get do_sstrip_get @@ -561,6 +563,7 @@ do_cloog_extract do_mpc_extract do_libelf_extract + do_zlib_extract do_binutils_extract do_elf2flt_extract do_sstrip_extract diff -r e0d70cf2b396 -r cc5137ade317 scripts/showSamples.sh --- a/scripts/showSamples.sh Thu Feb 09 13:09:08 2012 +0100 +++ b/scripts/showSamples.sh Fri Feb 10 12:14:16 2012 +0100 @@ -75,6 +75,7 @@ [ -z "${CT_CLOOG}" -a -z "${CT_CLOOG_TARGET}" ] || printf " cloog-ppl-%s" "${CT_CLOOG_VERSION}" [ -z "${CT_MPC}" -a -z "${CT_MPC_TARGET}" ] || printf " mpc-%s" "${CT_MPC_VERSION}" [ -z "${CT_LIBELF}" -a -z "${CT_LIBELF_TARGET}" ] || printf " libelf-%s" "${CT_LIBELF_VERSION}" + [ -z "${CT_ZLIB}" ] || printf " zlib-%s" "${CT_ZLIB_VERSION}" [ -z "${complibs}" ] || printf "\n" printf " %-*s : %s\n" ${t_width} "binutils" "binutils-${CT_BINUTILS_VERSION}" printf " %-*s : %s" ${t_width} "C compiler" "${CT_CC}-${CT_CC_VERSION} (C" diff -r e0d70cf2b396 -r cc5137ade317 steps.mk --- a/steps.mk Thu Feb 09 13:09:08 2012 +0100 +++ b/steps.mk Fri Feb 10 12:14:16 2012 +0100 @@ -23,6 +23,7 @@ cloog \ mpc \ libelf \ + zlib \ binutils \ elf2flt \ sstrip \ -- For unsubscribe information see http://sourceware.org/lists.html#faq