diff mbox

[1/1] Option to copy Linaro gconv libs to target

Message ID 1383428236-3842-1-git-send-email-svlasic@gmail.com
State Superseded
Headers show

Commit Message

Stanislav Vasic Nov. 2, 2013, 9:37 p.m. UTC
This patch adds an option for external Linaro toolchains
which allows buildroot to copy gconv libs to target.

Also exports GCONV_PATH if folder exists on target.
That is needed because some programs (eg. XBMC) dont
see gconv libs if GCONV_PATH is not exported.

Signed-off-by: Stanislav Vasic <svlasic@gmail.com>
---
 system/skeleton/etc/profile                        |  6 ++++++
 toolchain/helpers.mk                               | 12 ++++++++++++
 toolchain/toolchain-external/Config.in             |  6 ++++++
 toolchain/toolchain-external/toolchain-external.mk |  4 ++++
 4 files changed, 28 insertions(+)

Comments

Yann E. MORIN June 8, 2014, 5:23 p.m. UTC | #1
Stanislav, All,

On 2013-11-02 22:37 +0100, Stanislav Vasic spake thusly:
> This patch adds an option for external Linaro toolchains
> which allows buildroot to copy gconv libs to target.

We have another, more generic patch in the making:
    http://patchwork.ozlabs.org/patch/357067/

which I'm still working on:
    https://www.gitorious.org/buildroot/buildroot/commit/9a86575442f9861fa5a4777798fc84b999a12f7f

and which should supersed this patch.

As such, I marked this patch superseded in the pathwork.

> Also exports GCONV_PATH if folder exists on target.
> That is needed because some programs (eg. XBMC) dont
> see gconv libs if GCONV_PATH is not exported.

I haven't seen the need to export GCONV_PATH when running my XBMC,
neither did Maxime.

What is the reason for exporting GCONV_PATH, if the gconv libs are
properly installed in /usr/lib/gconv ?

Is it because Linaro toolchains install them in
libc/usr/lib/arm-linux-gnueabihf/gconv ?

Regards,
Yann E. MORIN.

> Signed-off-by: Stanislav Vasic <svlasic@gmail.com>
> ---
>  system/skeleton/etc/profile                        |  6 ++++++
>  toolchain/helpers.mk                               | 12 ++++++++++++
>  toolchain/toolchain-external/Config.in             |  6 ++++++
>  toolchain/toolchain-external/toolchain-external.mk |  4 ++++
>  4 files changed, 28 insertions(+)
> 
> diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
> index 31d3180..d7fef65 100644
> --- a/system/skeleton/etc/profile
> +++ b/system/skeleton/etc/profile
> @@ -8,6 +8,12 @@ export PATH=\
>  /usr/bin/X11:\
>  /usr/local/bin
>  
> +# If gconv folder exists, export GCONV_PATH
> +
> +if [ -d /usr/lib/gconv ]; then
> +    export GCONV_PATH = /usr/lib/gconv
> +fi
> +
>  # If running interactively, then:
>  if [ "$PS1" ]; then
>  
> diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> index a8944ce..a778cef 100644
> --- a/toolchain/helpers.mk
> +++ b/toolchain/helpers.mk
> @@ -83,6 +83,18 @@ copy_toolchain_lib_root = \
>   \
>  	echo -n
>  
> +# Function for Linaro toolchains (EABIhf) that copies gconv libs to target
> +# Expects 1 param:
> +# $1: toolchain root
> +copy_toolchain_gconv = \
> +    BASE_DIR="$(strip $1)"; \
> +    if [ -d $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv ] ; then \
> +	mkdir -p $(TARGET_DIR)/usr/lib/gconv ; \
> +	cp -r $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv/* $(TARGET_DIR)/usr/lib/gconv ; \
> +    fi; \
> + \
> +    echo -n
> +
>  #
>  # Copy the full external toolchain sysroot directory to the staging
>  # dir. The operation of this function is rendered a little bit
> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index 48b5865..fc328b1 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -864,6 +864,12 @@ config BR2_TOOLCHAIN_EXTERNAL_MUSL
>  	bool
>  	select BR2_TOOLCHAIN_USES_MUSL
>  
> +config BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV
> +	bool "Copy GCONV libraries to target"
> +	depends on BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 \
> +	    || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 \
> +	    || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09
> +
>  if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
>  
>  choice
> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> index d41cc7c..c1a3dc7 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -496,6 +496,10 @@ define TOOLCHAIN_EXTERNAL_INSTALL_CORE
>  			echo "Could not find gdbserver in external toolchain" ; \
>  			exit 1 ; \
>  		fi ; \
> +	fi; \
> +	if test "$(BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV)" = "y" ; then \
> +		$(call MESSAGE,"Copying external toolchain gconv to target...") ; \
> +		$(call copy_toolchain_gconv,$${SYSROOT_DIR}) ; \
>  	fi
>  endef
>  
> -- 
> 1.8.3.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Stanislav Vasic June 8, 2014, 6:18 p.m. UTC | #2
Hi Yann, all,

if GCONV_PATH is not exported, xbmc doesn't see it and decoding subtitles
or whatever which have special characters (eg cp1250) fails. Also, w/o
gconv libs XBMC 13.0+ doesn't draw menus etc. I exported GCONV_PATH in xbmc
startup script, but I guess exporting it in profile would also work.


On Sun, Jun 8, 2014 at 7:23 PM, Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Stanislav, All,
>
> On 2013-11-02 22:37 +0100, Stanislav Vasic spake thusly:
> > This patch adds an option for external Linaro toolchains
> > which allows buildroot to copy gconv libs to target.
>
> We have another, more generic patch in the making:
>     http://patchwork.ozlabs.org/patch/357067/
>
> which I'm still working on:
>
> https://www.gitorious.org/buildroot/buildroot/commit/9a86575442f9861fa5a4777798fc84b999a12f7f
>
> and which should supersed this patch.
>
> As such, I marked this patch superseded in the pathwork.
>
> > Also exports GCONV_PATH if folder exists on target.
> > That is needed because some programs (eg. XBMC) dont
> > see gconv libs if GCONV_PATH is not exported.
>
> I haven't seen the need to export GCONV_PATH when running my XBMC,
> neither did Maxime.
>
> What is the reason for exporting GCONV_PATH, if the gconv libs are
> properly installed in /usr/lib/gconv ?
>
> Is it because Linaro toolchains install them in
> libc/usr/lib/arm-linux-gnueabihf/gconv ?
>
> Regards,
> Yann E. MORIN.
>
> > Signed-off-by: Stanislav Vasic <svlasic@gmail.com>
> > ---
> >  system/skeleton/etc/profile                        |  6 ++++++
> >  toolchain/helpers.mk                               | 12 ++++++++++++
> >  toolchain/toolchain-external/Config.in             |  6 ++++++
> >  toolchain/toolchain-external/toolchain-external.mk |  4 ++++
> >  4 files changed, 28 insertions(+)
> >
> > diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
> > index 31d3180..d7fef65 100644
> > --- a/system/skeleton/etc/profile
> > +++ b/system/skeleton/etc/profile
> > @@ -8,6 +8,12 @@ export PATH=\
> >  /usr/bin/X11:\
> >  /usr/local/bin
> >
> > +# If gconv folder exists, export GCONV_PATH
> > +
> > +if [ -d /usr/lib/gconv ]; then
> > +    export GCONV_PATH = /usr/lib/gconv
> > +fi
> > +
> >  # If running interactively, then:
> >  if [ "$PS1" ]; then
> >
> > diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> > index a8944ce..a778cef 100644
> > --- a/toolchain/helpers.mk
> > +++ b/toolchain/helpers.mk
> > @@ -83,6 +83,18 @@ copy_toolchain_lib_root = \
> >   \
> >       echo -n
> >
> > +# Function for Linaro toolchains (EABIhf) that copies gconv libs to
> target
> > +# Expects 1 param:
> > +# $1: toolchain root
> > +copy_toolchain_gconv = \
> > +    BASE_DIR="$(strip $1)"; \
> > +    if [ -d $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv ] ; then \
> > +     mkdir -p $(TARGET_DIR)/usr/lib/gconv ; \
> > +     cp -r $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv/*
> $(TARGET_DIR)/usr/lib/gconv ; \
> > +    fi; \
> > + \
> > +    echo -n
> > +
> >  #
> >  # Copy the full external toolchain sysroot directory to the staging
> >  # dir. The operation of this function is rendered a little bit
> > diff --git a/toolchain/toolchain-external/Config.in
> b/toolchain/toolchain-external/Config.in
> > index 48b5865..fc328b1 100644
> > --- a/toolchain/toolchain-external/Config.in
> > +++ b/toolchain/toolchain-external/Config.in
> > @@ -864,6 +864,12 @@ config BR2_TOOLCHAIN_EXTERNAL_MUSL
> >       bool
> >       select BR2_TOOLCHAIN_USES_MUSL
> >
> > +config BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV
> > +     bool "Copy GCONV libraries to target"
> > +     depends on BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 \
> > +         || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 \
> > +         || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09
> > +
> >  if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
> >
> >  choice
> > diff --git a/toolchain/toolchain-external/toolchain-external.mk
> b/toolchain/toolchain-external/toolchain-external.mk
> > index d41cc7c..c1a3dc7 100644
> > --- a/toolchain/toolchain-external/toolchain-external.mk
> > +++ b/toolchain/toolchain-external/toolchain-external.mk
> > @@ -496,6 +496,10 @@ define TOOLCHAIN_EXTERNAL_INSTALL_CORE
> >                       echo "Could not find gdbserver in external
> toolchain" ; \
> >                       exit 1 ; \
> >               fi ; \
> > +     fi; \
> > +     if test "$(BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV)" = "y" ; then \
> > +             $(call MESSAGE,"Copying external toolchain gconv to
> target...") ; \
> > +             $(call copy_toolchain_gconv,$${SYSROOT_DIR}) ; \
> >       fi
> >  endef
> >
> > --
> > 1.8.3.2
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>       |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There
> is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
> conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>
Maxime Hadjinlian June 8, 2014, 6:53 p.m. UTC | #3
Hi Stanislav, Yann, all

On Sun, Jun 8, 2014 at 8:18 PM, Stanislav Vlasic <svlasic@gmail.com> wrote:
> Hi Yann, all,
>
> if GCONV_PATH is not exported, xbmc doesn't see it and decoding subtitles or
> whatever which have special characters (eg cp1250) fails. Also, w/o gconv
> libs XBMC 13.0+ doesn't draw menus etc. I exported GCONV_PATH in xbmc
> startup script, but I guess exporting it in profile would also work.
>
Just a quick question, where did you export theses libraries ?
As Yann stated, we did not need to export this variable to make it
work for XBMC.
And I can assure you that it's nowhere in my env.
>
> On Sun, Jun 8, 2014 at 7:23 PM, Yann E. MORIN <yann.morin.1998@free.fr>
> wrote:
>>
>> Stanislav, All,
>>
>> On 2013-11-02 22:37 +0100, Stanislav Vasic spake thusly:
>> > This patch adds an option for external Linaro toolchains
>> > which allows buildroot to copy gconv libs to target.
>>
>> We have another, more generic patch in the making:
>>     http://patchwork.ozlabs.org/patch/357067/
>>
>> which I'm still working on:
>>
>> https://www.gitorious.org/buildroot/buildroot/commit/9a86575442f9861fa5a4777798fc84b999a12f7f
>>
>> and which should supersed this patch.
>>
>> As such, I marked this patch superseded in the pathwork.
>>
>> > Also exports GCONV_PATH if folder exists on target.
>> > That is needed because some programs (eg. XBMC) dont
>> > see gconv libs if GCONV_PATH is not exported.
>>
>> I haven't seen the need to export GCONV_PATH when running my XBMC,
>> neither did Maxime.
>>
>> What is the reason for exporting GCONV_PATH, if the gconv libs are
>> properly installed in /usr/lib/gconv ?
>>
>> Is it because Linaro toolchains install them in
>> libc/usr/lib/arm-linux-gnueabihf/gconv ?
>>
>> Regards,
>> Yann E. MORIN.
>>
>> > Signed-off-by: Stanislav Vasic <svlasic@gmail.com>
>> > ---
>> >  system/skeleton/etc/profile                        |  6 ++++++
>> >  toolchain/helpers.mk                               | 12 ++++++++++++
>> >  toolchain/toolchain-external/Config.in             |  6 ++++++
>> >  toolchain/toolchain-external/toolchain-external.mk |  4 ++++
>> >  4 files changed, 28 insertions(+)
>> >
>> > diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
>> > index 31d3180..d7fef65 100644
>> > --- a/system/skeleton/etc/profile
>> > +++ b/system/skeleton/etc/profile
>> > @@ -8,6 +8,12 @@ export PATH=\
>> >  /usr/bin/X11:\
>> >  /usr/local/bin
>> >
>> > +# If gconv folder exists, export GCONV_PATH
>> > +
>> > +if [ -d /usr/lib/gconv ]; then
>> > +    export GCONV_PATH = /usr/lib/gconv
>> > +fi
>> > +
>> >  # If running interactively, then:
>> >  if [ "$PS1" ]; then
>> >
>> > diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
>> > index a8944ce..a778cef 100644
>> > --- a/toolchain/helpers.mk
>> > +++ b/toolchain/helpers.mk
>> > @@ -83,6 +83,18 @@ copy_toolchain_lib_root = \
>> >   \
>> >       echo -n
>> >
>> > +# Function for Linaro toolchains (EABIhf) that copies gconv libs to
>> > target
>> > +# Expects 1 param:
>> > +# $1: toolchain root
>> > +copy_toolchain_gconv = \
>> > +    BASE_DIR="$(strip $1)"; \
>> > +    if [ -d $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv ] ; then \
>> > +     mkdir -p $(TARGET_DIR)/usr/lib/gconv ; \
>> > +     cp -r $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv/*
>> > $(TARGET_DIR)/usr/lib/gconv ; \
>> > +    fi; \
>> > + \
>> > +    echo -n
>> > +
>> >  #
>> >  # Copy the full external toolchain sysroot directory to the staging
>> >  # dir. The operation of this function is rendered a little bit
>> > diff --git a/toolchain/toolchain-external/Config.in
>> > b/toolchain/toolchain-external/Config.in
>> > index 48b5865..fc328b1 100644
>> > --- a/toolchain/toolchain-external/Config.in
>> > +++ b/toolchain/toolchain-external/Config.in
>> > @@ -864,6 +864,12 @@ config BR2_TOOLCHAIN_EXTERNAL_MUSL
>> >       bool
>> >       select BR2_TOOLCHAIN_USES_MUSL
>> >
>> > +config BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV
>> > +     bool "Copy GCONV libraries to target"
>> > +     depends on BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 \
>> > +         || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 \
>> > +         || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09
>> > +
>> >  if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
>> >
>> >  choice
>> > diff --git a/toolchain/toolchain-external/toolchain-external.mk
>> > b/toolchain/toolchain-external/toolchain-external.mk
>> > index d41cc7c..c1a3dc7 100644
>> > --- a/toolchain/toolchain-external/toolchain-external.mk
>> > +++ b/toolchain/toolchain-external/toolchain-external.mk
>> > @@ -496,6 +496,10 @@ define TOOLCHAIN_EXTERNAL_INSTALL_CORE
>> >                       echo "Could not find gdbserver in external
>> > toolchain" ; \
>> >                       exit 1 ; \
>> >               fi ; \
>> > +     fi; \
>> > +     if test "$(BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV)" = "y" ; then \
>> > +             $(call MESSAGE,"Copying external toolchain gconv to
>> > target...") ; \
>> > +             $(call copy_toolchain_gconv,$${SYSROOT_DIR}) ; \
>> >       fi
>> >  endef
>> >
>> > --
>> > 1.8.3.2
>> >
>> > _______________________________________________
>> > buildroot mailing list
>> > buildroot@busybox.net
>> > http://lists.busybox.net/mailman/listinfo/buildroot
>>
>> --
>>
>> .-----------------.--------------------.------------------.--------------------.
>> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
>> conspiracy: |
>> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>> |
>> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is
>> no  |
>> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>> conspiracy.  |
>>
>> '------------------------------^-------^------------------^--------------------'
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Stanislav Vasic June 8, 2014, 6:55 p.m. UTC | #4
Hi,

I export them in /usr/lib/gconv


On Sun, Jun 8, 2014 at 8:53 PM, Maxime Hadjinlian <
maxime.hadjinlian@gmail.com> wrote:

> Hi Stanislav, Yann, all
>
> On Sun, Jun 8, 2014 at 8:18 PM, Stanislav Vlasic <svlasic@gmail.com>
> wrote:
> > Hi Yann, all,
> >
> > if GCONV_PATH is not exported, xbmc doesn't see it and decoding
> subtitles or
> > whatever which have special characters (eg cp1250) fails. Also, w/o gconv
> > libs XBMC 13.0+ doesn't draw menus etc. I exported GCONV_PATH in xbmc
> > startup script, but I guess exporting it in profile would also work.
> >
> Just a quick question, where did you export theses libraries ?
> As Yann stated, we did not need to export this variable to make it
> work for XBMC.
> And I can assure you that it's nowhere in my env.
> >
> > On Sun, Jun 8, 2014 at 7:23 PM, Yann E. MORIN <yann.morin.1998@free.fr>
> > wrote:
> >>
> >> Stanislav, All,
> >>
> >> On 2013-11-02 22:37 +0100, Stanislav Vasic spake thusly:
> >> > This patch adds an option for external Linaro toolchains
> >> > which allows buildroot to copy gconv libs to target.
> >>
> >> We have another, more generic patch in the making:
> >>     http://patchwork.ozlabs.org/patch/357067/
> >>
> >> which I'm still working on:
> >>
> >>
> https://www.gitorious.org/buildroot/buildroot/commit/9a86575442f9861fa5a4777798fc84b999a12f7f
> >>
> >> and which should supersed this patch.
> >>
> >> As such, I marked this patch superseded in the pathwork.
> >>
> >> > Also exports GCONV_PATH if folder exists on target.
> >> > That is needed because some programs (eg. XBMC) dont
> >> > see gconv libs if GCONV_PATH is not exported.
> >>
> >> I haven't seen the need to export GCONV_PATH when running my XBMC,
> >> neither did Maxime.
> >>
> >> What is the reason for exporting GCONV_PATH, if the gconv libs are
> >> properly installed in /usr/lib/gconv ?
> >>
> >> Is it because Linaro toolchains install them in
> >> libc/usr/lib/arm-linux-gnueabihf/gconv ?
> >>
> >> Regards,
> >> Yann E. MORIN.
> >>
> >> > Signed-off-by: Stanislav Vasic <svlasic@gmail.com>
> >> > ---
> >> >  system/skeleton/etc/profile                        |  6 ++++++
> >> >  toolchain/helpers.mk                               | 12 ++++++++++++
> >> >  toolchain/toolchain-external/Config.in             |  6 ++++++
> >> >  toolchain/toolchain-external/toolchain-external.mk |  4 ++++
> >> >  4 files changed, 28 insertions(+)
> >> >
> >> > diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
> >> > index 31d3180..d7fef65 100644
> >> > --- a/system/skeleton/etc/profile
> >> > +++ b/system/skeleton/etc/profile
> >> > @@ -8,6 +8,12 @@ export PATH=\
> >> >  /usr/bin/X11:\
> >> >  /usr/local/bin
> >> >
> >> > +# If gconv folder exists, export GCONV_PATH
> >> > +
> >> > +if [ -d /usr/lib/gconv ]; then
> >> > +    export GCONV_PATH = /usr/lib/gconv
> >> > +fi
> >> > +
> >> >  # If running interactively, then:
> >> >  if [ "$PS1" ]; then
> >> >
> >> > diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> >> > index a8944ce..a778cef 100644
> >> > --- a/toolchain/helpers.mk
> >> > +++ b/toolchain/helpers.mk
> >> > @@ -83,6 +83,18 @@ copy_toolchain_lib_root = \
> >> >   \
> >> >       echo -n
> >> >
> >> > +# Function for Linaro toolchains (EABIhf) that copies gconv libs to
> >> > target
> >> > +# Expects 1 param:
> >> > +# $1: toolchain root
> >> > +copy_toolchain_gconv = \
> >> > +    BASE_DIR="$(strip $1)"; \
> >> > +    if [ -d $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv ] ; then \
> >> > +     mkdir -p $(TARGET_DIR)/usr/lib/gconv ; \
> >> > +     cp -r $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv/*
> >> > $(TARGET_DIR)/usr/lib/gconv ; \
> >> > +    fi; \
> >> > + \
> >> > +    echo -n
> >> > +
> >> >  #
> >> >  # Copy the full external toolchain sysroot directory to the staging
> >> >  # dir. The operation of this function is rendered a little bit
> >> > diff --git a/toolchain/toolchain-external/Config.in
> >> > b/toolchain/toolchain-external/Config.in
> >> > index 48b5865..fc328b1 100644
> >> > --- a/toolchain/toolchain-external/Config.in
> >> > +++ b/toolchain/toolchain-external/Config.in
> >> > @@ -864,6 +864,12 @@ config BR2_TOOLCHAIN_EXTERNAL_MUSL
> >> >       bool
> >> >       select BR2_TOOLCHAIN_USES_MUSL
> >> >
> >> > +config BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV
> >> > +     bool "Copy GCONV libraries to target"
> >> > +     depends on BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 \
> >> > +         || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 \
> >> > +         || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09
> >> > +
> >> >  if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
> >> >
> >> >  choice
> >> > diff --git a/toolchain/toolchain-external/toolchain-external.mk
> >> > b/toolchain/toolchain-external/toolchain-external.mk
> >> > index d41cc7c..c1a3dc7 100644
> >> > --- a/toolchain/toolchain-external/toolchain-external.mk
> >> > +++ b/toolchain/toolchain-external/toolchain-external.mk
> >> > @@ -496,6 +496,10 @@ define TOOLCHAIN_EXTERNAL_INSTALL_CORE
> >> >                       echo "Could not find gdbserver in external
> >> > toolchain" ; \
> >> >                       exit 1 ; \
> >> >               fi ; \
> >> > +     fi; \
> >> > +     if test "$(BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV)" = "y" ; then \
> >> > +             $(call MESSAGE,"Copying external toolchain gconv to
> >> > target...") ; \
> >> > +             $(call copy_toolchain_gconv,$${SYSROOT_DIR}) ; \
> >> >       fi
> >> >  endef
> >> >
> >> > --
> >> > 1.8.3.2
> >> >
> >> > _______________________________________________
> >> > buildroot mailing list
> >> > buildroot@busybox.net
> >> > http://lists.busybox.net/mailman/listinfo/buildroot
> >>
> >> --
> >>
> >>
> .-----------------.--------------------.------------------.--------------------.
> >> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> >> conspiracy: |
> >> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
> >> |
> >> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/
>  There is
> >> no  |
> >> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
> >> conspiracy.  |
> >>
> >>
> '------------------------------^-------^------------------^--------------------'
> >
> >
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
Yann E. MORIN June 8, 2014, 7:04 p.m. UTC | #5
Maxime, Stanislav, All,

On 2014-06-08 20:53 +0200, Maxime Hadjinlian spake thusly:
> On Sun, Jun 8, 2014 at 8:18 PM, Stanislav Vlasic <svlasic@gmail.com> wrote:
> > Hi Yann, all,
> >
> > if GCONV_PATH is not exported, xbmc doesn't see it and decoding subtitles or
> > whatever which have special characters (eg cp1250) fails. Also, w/o gconv
> > libs XBMC 13.0+ doesn't draw menus etc. I exported GCONV_PATH in xbmc
> > startup script, but I guess exporting it in profile would also work.
> >
> Just a quick question, where did you export theses libraries ?
> As Yann stated, we did not need to export this variable to make it
> work for XBMC.
> And I can assure you that it's nowhere in my env.

I think the problem Stanislav had is that he is using a Linaro
toolchain, which puts the gconv module in /usr/lib/arm-linux-gnueabihf
and so expects them in that location at runtime.

But since Buildroot does not follow the multi-arch convention (and
rightfully, IMHO), it does not work for Stanislav.

I'm not very happy with the exporting of GCONV_PATH as-is. I'd prefer we
find another solution. I'll look into that.

Regards,
Yann E. MORIN.
Yann E. MORIN June 8, 2014, 7:20 p.m. UTC | #6
Stanislav, All,

On 2013-11-02 22:37 +0100, Stanislav Vasic spake thusly:
> Also exports GCONV_PATH if folder exists on target.
> That is needed because some programs (eg. XBMC) dont
> see gconv libs if GCONV_PATH is not exported.
[--SNIP--]
> diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
> index 31d3180..d7fef65 100644
> --- a/system/skeleton/etc/profile
> +++ b/system/skeleton/etc/profile
> @@ -8,6 +8,12 @@ export PATH=\
>  /usr/bin/X11:\
>  /usr/local/bin
>  
> +# If gconv folder exists, export GCONV_PATH
> +
> +if [ -d /usr/lib/gconv ]; then
> +    export GCONV_PATH = /usr/lib/gconv
> +fi

This will only work for programs started from a login shell. Programs
that are started /automatically/ (eg. by startup scripts, like we do for
XBMC) will not have that variable in their environment, so will still
fail to find the gconv libs.

I've looked at the glibc source code, and besides the GCONV_PATH
solution, I can't see another wayt to tell where to look for the gconv
libs.

All this multi-arch stuff is so utterly broken, and there is not even a
real use-case for it. Not even a Debian developper I talked to, which
was involved in the mess, was able to explain what the reason was, that
was not already covered by existing mechanisms. That's a shame...

I still have to look if it is possible to pass an alternative path to
the dynamic linker in one of its config files...

Sigh...

Regards,
Yann E. MORIN.
Mike Zick June 8, 2014, 9 p.m. UTC | #7
On Sun, 8 Jun 2014 21:20:43 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> All this multi-arch stuff is so utterly broken, and there is not even
> a real use-case for it. Not even a Debian developper I talked to,
> which was involved in the mess, was able to explain what the reason
> was, that was not already covered by existing mechanisms. That's a
> shame...
>
rant

You mean this sort of c...?

     11193:   file=libc.so.6 [0];  needed by ./busybox [0]
     11193:   find library=libc.so.6 [0]; searching
     11193:    search path=../lib/tls/v7l/neon/vfp:../lib/tls/v7l/neon:../lib/tls/v7l/vfp:../lib/tls/v7l:../lib/tls/neon/vfp:../lib/tls/neon:../lib/tls/vfp:../lib/tls:../lib/v7l/neon/vfp:../lib/v7l/neon:../lib/v7l/vfp:../lib/v7l:../lib/neon/vfp:../lib/neon:../li
b/vfp:../lib          (RUNPATH from file ./busybox)
     11193:     trying file=../lib/tls/v7l/neon/vfp/libc.so.6
     11193:     trying file=../lib/tls/v7l/neon/libc.so.6
     11193:     trying file=../lib/tls/v7l/vfp/libc.so.6
     11193:     trying file=../lib/tls/v7l/libc.so.6
     11193:     trying file=../lib/tls/neon/vfp/libc.so.6
     11193:     trying file=../lib/tls/neon/libc.so.6
     11193:     trying file=../lib/tls/vfp/libc.so.6
     11193:     trying file=../lib/tls/libc.so.6
     11193:     trying file=../lib/v7l/neon/vfp/libc.so.6
     11193:     trying file=../lib/v7l/neon/libc.so.6
     11193:     trying file=../lib/v7l/vfp/libc.so.6
     11193:     trying file=../lib/v7l/libc.so.6
     11193:     trying file=../lib/neon/vfp/libc.so.6
     11193:     trying file=../lib/neon/libc.so.6
     11193:     trying file=../lib/vfp/libc.so.6
     11193:     trying file=../lib/libc.so.6

From one of today's builds of glibc-2.19 for a Cortex-A8.
The &$#^&^ loader is looking everywhere except under the bed.

Only one (the last) of the sixteen is where I told the loader to look.
Sure am glad that someone thinks they know better than I where I put
libc.

/rant
Mike
diff mbox

Patch

diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
index 31d3180..d7fef65 100644
--- a/system/skeleton/etc/profile
+++ b/system/skeleton/etc/profile
@@ -8,6 +8,12 @@  export PATH=\
 /usr/bin/X11:\
 /usr/local/bin
 
+# If gconv folder exists, export GCONV_PATH
+
+if [ -d /usr/lib/gconv ]; then
+    export GCONV_PATH = /usr/lib/gconv
+fi
+
 # If running interactively, then:
 if [ "$PS1" ]; then
 
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index a8944ce..a778cef 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -83,6 +83,18 @@  copy_toolchain_lib_root = \
  \
 	echo -n
 
+# Function for Linaro toolchains (EABIhf) that copies gconv libs to target
+# Expects 1 param:
+# $1: toolchain root
+copy_toolchain_gconv = \
+    BASE_DIR="$(strip $1)"; \
+    if [ -d $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv ] ; then \
+	mkdir -p $(TARGET_DIR)/usr/lib/gconv ; \
+	cp -r $${BASE_DIR}usr/lib/arm-linux-gnueabihf/gconv/* $(TARGET_DIR)/usr/lib/gconv ; \
+    fi; \
+ \
+    echo -n
+
 #
 # Copy the full external toolchain sysroot directory to the staging
 # dir. The operation of this function is rendered a little bit
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 48b5865..fc328b1 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -864,6 +864,12 @@  config BR2_TOOLCHAIN_EXTERNAL_MUSL
 	bool
 	select BR2_TOOLCHAIN_USES_MUSL
 
+config BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV
+	bool "Copy GCONV libraries to target"
+	depends on BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07 \
+	    || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_08 \
+	    || BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09
+
 if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
 choice
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index d41cc7c..c1a3dc7 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -496,6 +496,10 @@  define TOOLCHAIN_EXTERNAL_INSTALL_CORE
 			echo "Could not find gdbserver in external toolchain" ; \
 			exit 1 ; \
 		fi ; \
+	fi; \
+	if test "$(BR2_TOOLCHAIN_EXTERNAL_LINARO_GCONV)" = "y" ; then \
+		$(call MESSAGE,"Copying external toolchain gconv to target...") ; \
+		$(call copy_toolchain_gconv,$${SYSROOT_DIR}) ; \
 	fi
 endef