Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files
@ 2014-10-31 15:19 Jérôme Pouiller
  2014-10-31 15:19 ` [Buildroot] [PATCH v2 2/3] gst-fsl-plugins: fix plugins loading Jérôme Pouiller
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jérôme Pouiller @ 2014-10-31 15:19 UTC (permalink / raw)
  To: buildroot

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
+
 # 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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 2/3] gst-fsl-plugins: fix plugins loading
  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 ` 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
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jérôme Pouiller @ 2014-10-31 15:19 UTC (permalink / raw)
  To: buildroot

Problem was reported :
  http://lists.busybox.net/pipermail/buildroot/2014-July/101566.html
  http://lists.busybox.net/pipermail/buildroot/2014-October/107613.html

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk             | 9 +++++++++
 .../gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf  | 5 +++++
 2 files changed, 14 insertions(+)
 create mode 100644 package/gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf

diff --git a/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk b/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk
index 8d8b8b4..21046fc 100644
--- a/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk
+++ b/package/gstreamer/gst-fsl-plugins/gst-fsl-plugins.mk
@@ -40,4 +40,13 @@ endef
 
 GST_FSL_PLUGINS_POST_PATCH_HOOKS += GST_FSL_PLUGINS_PATCH_M4
 
+define GST_FSL_PLUGINS_FIX_LD_PATH
+	$(INSTALL) -d $(TARGET_DIR)/etc/ld.so.conf.d
+	$(INSTALL) -m 644 \
+		package/gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf \
+		$(TARGET_DIR)/etc/ld.so.conf.d
+endef
+
+GST_FSL_PLUGINS_POST_INSTALL_TARGET_HOOKS += GST_FSL_PLUGINS_FIX_LD_PATH
+
 $(eval $(autotools-package))
diff --git a/package/gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf b/package/gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf
new file mode 100644
index 0000000..325fbf1
--- /dev/null
+++ b/package/gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf
@@ -0,0 +1,5 @@
+# cf. https://community.freescale.com/thread/300387
+/usr/lib/imx-mm/audio-codec
+/usr/lib/imx-mm/video-codec
+/usr/lib/imx-mm/parser
+
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 3/3] mysql: use /etc/ld.so.conf.d instead of /etc/ld.so.conf
  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:19 ` 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
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jérôme Pouiller @ 2014-10-31 15:19 UTC (permalink / raw)
  To: buildroot

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/mysql/ld.so.conf.d-mysql.conf | 1 +
 package/mysql/mysql.mk                | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 package/mysql/ld.so.conf.d-mysql.conf

diff --git a/package/mysql/ld.so.conf.d-mysql.conf b/package/mysql/ld.so.conf.d-mysql.conf
new file mode 100644
index 0000000..33d9ace
--- /dev/null
+++ b/package/mysql/ld.so.conf.d-mysql.conf
@@ -0,0 +1 @@
+/usr/lib/mysql
diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
index 945ca18..1a35378 100644
--- a/package/mysql/mysql.mk
+++ b/package/mysql/mysql.mk
@@ -114,7 +114,10 @@ define MYSQL_REMOVE_TEST_PROGS
 endef
 
 define MYSQL_ADD_MYSQL_LIB_PATH
-	echo "/usr/lib/mysql" >> $(TARGET_DIR)/etc/ld.so.conf
+	$(INSTALL) -d $(TARGET_DIR)/etc/ld.so.conf.d
+	$(INSTALL) -m 644 \
+		package/mysql g/ld.so.conf.d-mysql.conf \
+		$(TARGET_DIR)/etc/ld.so.conf.d
 endef
 
 MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_REMOVE_TEST_PROGS
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 2/3] gst-fsl-plugins: fix plugins loading
  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
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-31 15:37 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Fri, 31 Oct 2014 16:19:08 +0100, J?r?me Pouiller wrote:

> +define GST_FSL_PLUGINS_FIX_LD_PATH
> +	$(INSTALL) -d $(TARGET_DIR)/etc/ld.so.conf.d
> +	$(INSTALL) -m 644 \
> +		package/gstreamer/gst-fsl-plugins/ld.so.conf.d-gst-fsl-plugins.conf \
> +		$(TARGET_DIR)/etc/ld.so.conf.d

In a review of an earlier patch, Yann already suggested to do this in
one command using $(INSTALL) -D -m 644.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 3/3] mysql: use /etc/ld.so.conf.d instead of /etc/ld.so.conf
  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
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-31 15:39 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Fri, 31 Oct 2014 16:19:09 +0100, J?r?me Pouiller wrote:

>  define MYSQL_ADD_MYSQL_LIB_PATH
> -	echo "/usr/lib/mysql" >> $(TARGET_DIR)/etc/ld.so.conf
> +	$(INSTALL) -d $(TARGET_DIR)/etc/ld.so.conf.d
> +	$(INSTALL) -m 644 \
> +		package/mysql g/ld.so.conf.d-mysql.conf \
> +		$(TARGET_DIR)/etc/ld.so.conf.d
>  endef

Does this works with uClibc?

The gst-fsl-plugins package is limited to glibc, so we don't care. But
mysql is supported with uClibc, and I'm not sure uClibc
supports /etc/ld.so.conf.d/.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files
  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: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:41 ` Thomas Petazzoni
  2014-10-31 16:06   ` Jérôme Pouiller
  2014-11-01 16:39 ` Yann E. MORIN
  2014-11-02  5:51 ` Baruch Siach
  4 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-31 15:41 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Fri, 31 Oct 2014 16:19:07 +0100, J?r?me Pouiller wrote:

> +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"

We should error out here.

Does musl supports /etc/ld.so.conf ? If so, then I believe we should
simply not use the /etc/ld.so.conf.d/ feature of glibc, and instead
keep using /etc/ld.so.conf only, like MySQL was doing.

If you don't want to see repeated entries, you can do something like:

	grep -q "^/usr/lib/mysql$" $(TARGET_DIR)/etc/ld.so.conf ||
		echo "/usr/lib/mysql" >> $(TARGET_DIR)/etc/ld.so.conf

We could even imagine having a make function to do that.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files
  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
  0 siblings, 0 replies; 9+ messages in thread
From: Jérôme Pouiller @ 2014-10-31 16:06 UTC (permalink / raw)
  To: buildroot

On Friday 31 October 2014 16:41:56 Thomas Petazzoni wrote:
> Dear J?r?me Pouiller,
> 
> On Fri, 31 Oct 2014 16:19:07 +0100, J?r?me Pouiller wrote:
> > +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"
> We should error out here.
User may fix problem by providing correct file in an overlay. However, I 
haven't a strong opinion about that.


> Does musl supports /etc/ld.so.conf ? 
I have checked in sources and it seems it doesn't :( .  It use a file called 
/etc/ld-musl-${ARCH}.path (with ARCH={arm,x86,...}). Syntax of this file is 
same than $LD_LIBRARY_PATH (paths separated with ':').

> If so, then I believe we should
> simply not use the /etc/ld.so.conf.d/ feature of glibc, and instead
> keep using /etc/ld.so.conf only, like MySQL was doing.
> 
> If you don't want to see repeated entries, you can do something like:
> 
> 	grep -q "^/usr/lib/mysql$" $(TARGET_DIR)/etc/ld.so.conf ||
> 		echo "/usr/lib/mysql" >> $(TARGET_DIR)/etc/ld.so.conf
> 
> We could even imagine having a make function to do that.
The two options have their drawbacks. I have no strong opinion.


-- 
J?r?me Pouiller, Sysmic

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files
  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
                   ` (2 preceding siblings ...)
  2014-10-31 15:41 ` [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files Thomas Petazzoni
@ 2014-11-01 16:39 ` Yann E. MORIN
  2014-11-02  5:51 ` Baruch Siach
  4 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2014-11-01 16:39 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH v2 1/3] skeleton: add support for /etc/ld.so.conf.d/*.conf files
  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
                   ` (3 preceding siblings ...)
  2014-11-01 16:39 ` Yann E. MORIN
@ 2014-11-02  5:51 ` Baruch Siach
  4 siblings, 0 replies; 9+ messages in thread
From: Baruch Siach @ 2014-11-02  5:51 UTC (permalink / raw)
  To: buildroot

Hi J?r?me,

On Fri, Oct 31, 2014 at 04:19:07PM +0100, J?r?me Pouiller wrote:
> 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

s/than/as/

> +#     generation of this file, we prefer to not support it. User can
> +#     fix the problem by providing file manualy (in a an overlay).

Redundant "a".

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-02  5:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-11-02  5:51 ` Baruch Siach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox