Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files
Date: Sat, 1 Nov 2014 17:39:52 +0100	[thread overview]
Message-ID: <20141101163952.GA10189@free.fr> (raw)
In-Reply-To: <1414768749-15134-1-git-send-email-jezz@sysmic.org>

J?r?me, All,

On 2014-10-31 16:19 +0100, J?r?me Pouiller spake thusly:
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
> ---
>  toolchain/toolchain.mk | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/toolchain/toolchain.mk b/toolchain/toolchain.mk
> index 3f9900b..cd65cfc 100644
> --- a/toolchain/toolchain.mk
> +++ b/toolchain/toolchain.mk
> @@ -13,6 +13,31 @@ endef
>  TARGET_FINALIZE_HOOKS += GLIBC_COPY_NSSWITCH_FILE
>  endif
>  
> +# - glibc can include configuration files at runtime
> +# - uclibc does not support "include" feature
> +# - musl use /etc/ld-musl-${ARCH}.path file. This file use same syntax
> +#     than $LD_LIBRARY_PATH. Since there are plenty of corner cases in
> +#     generation of this file, we prefer to not support it. User can
> +#     fix the problem by providing file manualy (in a an overlay).
> +#
> +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
> +define GENERATE_LD_SO_CONF_FILE
> +	echo 'include /etc/ld.so.conf.d/*.conf' > $(TARGET_DIR)/etc/ld.so.conf
> +endef
> +else
> +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
> +define GENERATE_LD_SO_CONF_FILE
> +	ls $(TARGET_DIR)/etc/ld.so.conf.d/*.conf > /dev/null 2>&1 && \
> +	    echo "Usage of /etc/ld.so.conf.d/*.conf files with musl libc is not supported"
> +endef
> +else # UCLIBC
> +define GENERATE_LD_SO_CONF_FILE
> +	cat $(TARGET_DIR)/etc/ld.so.conf.d/*.conf > $(TARGET_DIR)/etc/ld.so.conf
> +endef
> +endif
> +endif
> +TARGET_FINALIZE_HOOKS += GENERATE_LD_SO_CONF_FILE

I think it would be much better to not support this glibcism.

I can only see one use-case for that:

  - the package installs such a file in its install procedure
    => we should provide a post-install hook to move the content of
       this file into /etc/ld.so.conf

As Thomas P. said, we can provide a macro to ease doing that. I propose
something slightly different, because 'grep -q' is not portable and I do
not like 'echo':

    # Add a path in $(1) to /etc/ld.so.conf
    define UPDATE_LD_SO_CONF
        grep -E '^$(1)$$' $(TARGET_DIR)/etc/ld.so.conf >/dev/null 2>&1 || \
        printf '%s\n' '$(1)' >>$(TARGET_DIR)/etc/ld.so.conf
    endef

which you could then call like that:

    define FOO_UPDATE_LD_SO_CONF
        $(call UPDATE_LD_SO_CONF,/usr/lib/foo)
    endef
    FOO_POST_TARGET_INSTALL_HOOKS += FOO_UPDATE_LD_SO_CONF

Alternatively, we could include that in the pakage infra:

    FOO_LD_SO_CONF_PATHS = /usr/lib/foo /usr/lib/foo/bar

and the infra would look at that variable, and if set, add all the paths
to /et/ld/so/conf.

I thionk the pkg-infra solution is a bit overkill, given we currently do
not have that much packages that use that (well, only mysql needs it),
but the macro would not be very much justified either.

So, I just NAK this feature.

Regards,
Yann E. MORIN.

>  # Install the gconv modules
>  ifeq ($(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY),y)
>  GCONV_LIBS = $(call qstrip,$(BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST))
> -- 
> 1.9.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2014-11-01 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 15:19 [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files Jérôme Pouiller
2014-10-31 15:19 ` [Buildroot] [PATCH v2 2/3] gst-fsl-plugins: fix plugins loading Jérôme Pouiller
2014-10-31 15:37   ` Thomas Petazzoni
2014-10-31 15:19 ` [Buildroot] [PATCH v2 3/3] mysql: use /etc/ld.so.conf.d instead of /etc/ld.so.conf Jérôme Pouiller
2014-10-31 15:39   ` Thomas Petazzoni
2014-10-31 15:41 ` [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files Thomas Petazzoni
2014-10-31 16:06   ` Jérôme Pouiller
2014-11-01 16:39 ` Yann E. MORIN [this message]
2014-11-02  5:51 ` Baruch Siach

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=20141101163952.GA10189@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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