From: Remy Bohmer <linux@bohmer.net>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 2/5 v2] [x86_64] Add some support for multilib detection in the toolchain
Date: Tue, 13 Mar 2012 22:32:15 +0100 [thread overview]
Message-ID: <1331674338-1757-2-git-send-email-linux@bohmer.net> (raw)
In-Reply-To: <1331674338-1757-1-git-send-email-linux@bohmer.net>
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 <linux@bohmer.net>
---
v2: Reworked review comments from Michael Olbrich
scripts/install_copy_toolchain.sh | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
index 8a67698..726cc61 100755
--- a/scripts/install_copy_toolchain.sh
+++ b/scripts/install_copy_toolchain.sh
@@ -50,12 +50,14 @@ 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_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
+ extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
# ask the compiler for the lib
- lib_path="$(${CC} -print-file-name=${lib})"
+ lib_path="$(${CC} ${extra_cppflags} ${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 +79,11 @@ ptxd_get_lib_path() {
#
ptxd_get_dl() {
local dl
+ extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
+ extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
dl="$(echo 'int main(void){return 0;}' | \
- ${CC} -x c -o /dev/null -v - 2>&1 | \
+ ${CC} ${extra_cppflags} ${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
next prev parent reply other threads:[~2012-03-13 21:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 21:32 [ptxdist] [PATCH 1/5 v2] [rt-tests] Use CFLAGS specified by ptxdist platformconfig Remy Bohmer
2012-03-13 21:32 ` Remy Bohmer [this message]
2012-03-13 21:32 ` [ptxdist] [PATCH 3/5 v2] [busybox] Pass extra platform CFLAGS to busybox make Remy Bohmer
2012-03-14 10:42 ` Michael Olbrich
2012-03-14 10:45 ` Michael Olbrich
2012-03-14 11:38 ` Remy Bohmer
2012-03-13 21:32 ` [ptxdist] [PATCH 4/5 v2] [x86_64, glibc] on multilib do not put all dynamic linkers in /lib Remy Bohmer
2012-03-13 21:32 ` [ptxdist] [PATCH 5/5 v2] [x86_64, glibc] Link /usr/lib/libdl.so is not needed and wrong on x86_64 Remy Bohmer
2012-03-15 10:31 ` [ptxdist] [PATCH 1/5 v2] [rt-tests] Use CFLAGS specified by ptxdist platformconfig Michael Olbrich
2012-03-15 11:52 ` Remy Bohmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331674338-1757-2-git-send-email-linux@bohmer.net \
--to=linux@bohmer.net \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox