From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH 3/9 v2] [x86_64, multilib] Remove all hardcoded paths from glibc.make
Date: Fri, 23 Mar 2012 08:42:26 +0100 [thread overview]
Message-ID: <20120323074226.GA20731@pengutronix.de> (raw)
In-Reply-To: <1332191692-20833-3-git-send-email-linux@bohmer.net>
On Mon, Mar 19, 2012 at 10:14:46PM +0100, Remy Bohmer wrote:
> These hardcoded paths do not work for a multilib environment where
> libraries are typically installed in /lib64 for x86-64 instead of /lib
> All correct paths can be found by interrogating the compiler toolchain
> for the location of these files.
Can't you use $(CROSS_LIB_DIR) here? I'd like to avoid larger changes to
install_copy_toolchain.sh. This depends a lot on the toolchain and is
rather difficult to test.
Michael
> Signed-off-by: Remy Bohmer <linux@bohmer.net>
> ---
> v2: no changes since v1
>
> rules/glibc.make | 23 +++++++++++------------
> rules/post/install.make | 18 ++++++------------
> scripts/install_copy_toolchain.sh | 20 +++++++++++++-------
> 3 files changed, 30 insertions(+), 31 deletions(-)
>
> diff --git a/rules/glibc.make b/rules/glibc.make
> index 2de7a13..0d110ef 100644
> --- a/rules/glibc.make
> +++ b/rules/glibc.make
> @@ -104,33 +104,32 @@ ifdef PTXCONF_GLIBC_NSL
> endif
>
> ifdef PTXCONF_GLIBC_GCONF_BASE
> - @$(call install_copy, glibc, 0, 0, 0755, /usr/lib/gconv)
> - @$(call install_copy_toolchain_lib, glibc, gconv/gconv-modules, /usr/lib/gconv, n)
> + @$(call install_copy_toolchain_lib, glibc, gconv/gconv-modules, n)
> endif
>
> ifdef PTXCONF_GLIBC_GCONV_DEF
> - @$(call install_copy_toolchain_lib, glibc, gconv/ISO8859-1.so, /usr/lib/gconv)
> - @$(call install_copy_toolchain_lib, glibc, gconv/ISO8859-15.so, /usr/lib/gconv)
> + @$(call install_copy_toolchain_lib, glibc, gconv/ISO8859-1.so)
> + @$(call install_copy_toolchain_lib, glibc, gconv/ISO8859-15.so)
> endif
>
> ifdef PTXCONF_GLIBC_GCONV_UTF
> - @$(call install_copy_toolchain_lib, glibc, gconv/UNICODE.so, /usr/lib/gconv)
> - @$(call install_copy_toolchain_lib, glibc, gconv/UTF-16.so, /usr/lib/gconv)
> - @$(call install_copy_toolchain_lib, glibc, gconv/UTF-32.so, /usr/lib/gconv)
> - @$(call install_copy_toolchain_lib, glibc, gconv/UTF-7.so, /usr/lib/gconv)
> + @$(call install_copy_toolchain_lib, glibc, gconv/UNICODE.so)
> + @$(call install_copy_toolchain_lib, glibc, gconv/UTF-16.so)
> + @$(call install_copy_toolchain_lib, glibc, gconv/UTF-32.so)
> + @$(call install_copy_toolchain_lib, glibc, gconv/UTF-7.so)
> endif
>
> ifdef PTXCONF_GLIBC_GCONV_ZH
> - @$(call install_copy_toolchain_lib, glibc, gconv/GBBIG5.so, /usr/lib/gconv)
> - @$(call install_copy_toolchain_lib, glibc, gconv/GB18030.so, /usr/lib/gconv)
> + @$(call install_copy_toolchain_lib, glibc, gconv/GBBIG5.so)
> + @$(call install_copy_toolchain_lib, glibc, gconv/GB18030.so)
> endif
>
> ifdef PTXCONF_GLIBC_I18N_BIN_LOCALE
> - @$(call install_copy_toolchain_usr, glibc, bin/locale)
> + @$(call install_copy_toolchain_lib, glibc, bin/locale)
> endif
>
> ifdef PTXCONF_GLIBC_I18N_BIN_LOCALEDEF
> - @$(call install_copy_toolchain_usr, glibc, bin/localedef)
> + @$(call install_copy_toolchain_lib, glibc, bin/localedef)
> endif
>
> ifdef PTXCONF_GLIBC_I18N_RAWDATA
> diff --git a/rules/post/install.make b/rules/post/install.make
> index 190ec28..cfc73a4 100644
> --- a/rules/post/install.make
> +++ b/rules/post/install.make
> @@ -300,18 +300,15 @@ install_script_replace = \
> #
> # $1: xpkg label
> # $2: source
> -# $3: destination
> -# $4: strip (y|n) default is to strip
> +# $3: strip (y|n) default is to strip
> #
> install_copy_toolchain_lib = \
> XPKG=$(subst _,-,$(strip $(1))); \
> LIB="$(strip $2)"; \
> - DST="$(strip $3)"; \
> - STRIP="$(strip $4)"; \
> - test "$${DST}" != "" && DST="-d $${DST}"; \
> + STRIP="$(strip $3)"; \
> $(call install_check, install_copy_toolchain_lib); \
> ${CROSS_ENV_CC} $(CROSS_ENV_STRIP) PKGDIR="$(PKGDIR)" \
> - $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -l "$${LIB}" $${DST} -s "$${STRIP}"
> + $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -l "$${LIB}" -s "$${STRIP}"
>
> #
> # install_copy_toolchain_dl
> @@ -331,18 +328,15 @@ install_copy_toolchain_dl = \
> #
> # $1: xpkg label
> # $2: source
> -# $3: destination
> -# $4: strip (y|n) default is to strip
> +# $3: strip (y|n) default is to strip
> #
> install_copy_toolchain_usr = \
> XPKG=$(subst _,-,$(strip $(1))); \
> LIB="$(strip $2)"; \
> - DST="$(strip $3)"; \
> - STRIP="$(strip $4)"; \
> - test "$${DST}" != "" && DST="-d $${DST}"; \
> + STRIP="$(strip $3)"; \
> $(call install_check, install_copy_toolchain_other); \
> ${CROSS_ENV_CC} $(CROSS_ENV_STRIP) PKGDIR="$(PKGDIR)" \
> - $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -u "$${LIB}" $${DST} -s "$${STRIP}"
> + $(SCRIPTSDIR)/install_copy_toolchain.sh -p "$${XPKG}" -u "$${LIB}" -s "$${STRIP}"
>
> #
> # install_link
> diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
> index 726cc61..27e0a9e 100755
> --- a/scripts/install_copy_toolchain.sh
> +++ b/scripts/install_copy_toolchain.sh
> @@ -50,7 +50,7 @@ ptxd_abs2rel() {
> # out: $lib_path
> #
> ptxd_get_lib_path() {
> - local lib lib_dir lib_path extra_cflags
> + local lib lib_dir lib_path extra_cppflags extra_cflags
>
> lib="${1}"
> extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
> @@ -78,7 +78,7 @@ ptxd_get_lib_path() {
> # out: dynamic linker name
> #
> ptxd_get_dl() {
> - local dl
> + local dl extra_cppflags extra_cflags
> extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
> extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
>
> @@ -106,7 +106,7 @@ ptxd_split_lib_prefix_sysroot_eval() {
> lib_dir="${lib_path%/${lib}}" # abs path to that lib
>
> # try to identify sysroot part of that path
> - for prefix in {/usr,}/lib{64,32,}{/tls,} ""; do
> + for prefix in {/usr,}/lib{64,32,}{/tls,/gconv,/bin,} ""; do
> tmp="${lib_dir%${prefix}}"
> if test "${lib_dir}" != "${tmp}"; then
> break
> @@ -241,10 +241,13 @@ ptxd_install_toolchain_lib() {
>
>
> _ptxd_get_sysroot_usr_by_sysroot() {
> - local sysroot
> + local sysroot extra_cppflags extra_cflags
> +
> + extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
> + extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
>
> sysroot="$(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 -ne "/.*collect2.*/s,.*--sysroot=\([^[:space:]]*\).*,\1,p")"
>
> test -n "${sysroot}" || return 1
> @@ -254,9 +257,12 @@ _ptxd_get_sysroot_usr_by_sysroot() {
>
>
> _ptxd_get_sysroot_usr_by_progname() {
> - local prog_name
> + local prog_name extra_cppflags extra_cflags
> +
> + extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
> + extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
>
> - prog_name="$(${CC} -print-prog-name=gcc)"
> + prog_name="$(${CC} ${extra_cppflags} ${extra_cflags} -print-prog-name=gcc)"
> case "${prog_name}" in
> /*)
> prog_name="$(ptxd_abspath ${prog_name%/bin/gcc})"
> --
> 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
next prev parent reply other threads:[~2012-03-23 7:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 21:14 [ptxdist] [PATCH 1/9 v2] [x86_64] Add x86_64 architecture strings Remy Bohmer
2012-03-19 21:14 ` [ptxdist] [PATCH 2/9 v2] [x86_64] libgcc need to be install in /lib64 instead of /lib Remy Bohmer
2012-03-19 21:14 ` [ptxdist] [PATCH 3/9 v2] [x86_64, multilib] Remove all hardcoded paths from glibc.make Remy Bohmer
2012-03-23 7:42 ` Michael Olbrich [this message]
2012-03-24 18:24 ` Remy Bohmer
2012-03-25 11:29 ` Michael Olbrich
2012-03-19 21:14 ` [ptxdist] [PATCH 4/9 v2] [x86_64, multilib] Make packages install their libraries at the right place Remy Bohmer
2012-03-24 11:04 ` Michael Olbrich
2012-03-24 11:06 ` Michael Olbrich
2012-03-19 21:14 ` [ptxdist] [PATCH 5/9 v2] [x86_64, multilib] Install Zlib " Remy Bohmer
2012-03-19 21:14 ` [ptxdist] [PATCH 6/9 v2] [x86_64, multilib] Install Ncurses " Remy Bohmer
2012-03-19 21:14 ` [ptxdist] [PATCH 7/9 v2] [x86_64, multilib] Install Util-linux-ng " Remy Bohmer
2012-03-19 21:14 ` [ptxdist] [PATCH 8/9 v2] [x86_64, multilib] Install Readline " Remy Bohmer
2012-03-19 21:14 ` [ptxdist] [PATCH 9/9 v2] [x86_64, multilib] Install Procps " Remy Bohmer
2012-03-23 7:53 ` [ptxdist] [PATCH 1/9 v2] [x86_64] Add x86_64 architecture strings Michael Olbrich
2012-03-24 18:29 ` Remy Bohmer
2012-03-26 8:50 ` Michael Olbrich
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=20120323074226.GA20731@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--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