From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1S7OSt-0001BG-9S for ptxdist@pengutronix.de; Tue, 13 Mar 2012 10:56:23 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1S7OSt-0008LR-8P for ptxdist@pengutronix.de; Tue, 13 Mar 2012 10:56:23 +0100 Date: Tue, 13 Mar 2012 10:56:23 +0100 From: Michael Olbrich Message-ID: <20120313095623.GH29221@pengutronix.de> References: <1331587504-16721-1-git-send-email-linux@bohmer.net> <1331587504-16721-2-git-send-email-linux@bohmer.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1331587504-16721-2-git-send-email-linux@bohmer.net> Subject: Re: [ptxdist] [PATCH 2/5] [x86_64] Add some support for multilib detection in the toolchain Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Mon, Mar 12, 2012 at 10:25:01PM +0100, Remy Bohmer wrote: > For Sourcery Codebench toolchains the 'gcc -print-file-name' only returns > the proper sysroot directory when the proper architecture flags are > provided via '-m64 -march=' flags. These flags are provided via the > ptxdist platformconfig PTXCONF_TARGET_EXTRA_CFLAGS setting. > These flags therefore also need to be passed to GCC here. > > Signed-off-by: Remy Bohmer > --- > scripts/install_copy_toolchain.sh | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh > index 8a67698..48d65d7 100755 > --- a/scripts/install_copy_toolchain.sh > +++ b/scripts/install_copy_toolchain.sh > @@ -50,12 +50,13 @@ ptxd_abs2rel() { > # out: $lib_path > # > ptxd_get_lib_path() { > - local lib lib_dir lib_path > + local lib lib_dir lib_path extra_cflags > > lib="${1}" > + extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}") I think ptxd_get_ptxconf should work here. And I think you should use PTXCONF_TARGET_EXTRA_CFLAGS and PTXCONF_TARGET_EXTRA_CPPFLAGS. > > # ask the compiler for the lib > - lib_path="$(${CC} -print-file-name=${lib})" > + lib_path="$(${CC} ${extra_cflags} -print-file-name=${lib})" > if test "${lib_path}" = "${lib}"; then > echo "install_copy_toolchain_lib: ${lib} not found" >&2 > return 1 > @@ -77,9 +78,10 @@ ptxd_get_lib_path() { > # > ptxd_get_dl() { > local dl > + extra_cflags=$(source ${PTXDIST_PLATFORMCONFIG} && echo "${PTXCONF_TARGET_EXTRA_CFLAGS}") dito. Michael > > dl="$(echo 'int main(void){return 0;}' | \ > - ${CC} -x c -o /dev/null -v - 2>&1 | \ > + ${CC} ${extra_cflags} -x c -o /dev/null -v - 2>&1 | \ > sed -n -e 's/.* -dynamic-linker \([^ ]*\).*/\1/p')" > > echo "${dl##*/}" > -- > 1.7.5.4 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de