* [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0
@ 2017-12-14 10:57 Arvid E. Picciani
2017-12-14 10:57 ` [Buildroot] [PATCH 2/2] enable static linking for libfuse Arvid E. Picciani
2017-12-14 14:19 ` [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Thomas Petazzoni
0 siblings, 2 replies; 11+ messages in thread
From: Arvid E. Picciani @ 2017-12-14 10:57 UTC (permalink / raw)
To: buildroot
See https://github.com/rust-lang/rust/issues/46566
Signed-off-by: Arvid E. Picciani <aep@exys.org>
---
package/musl/0002-fix-rcrt1.o.patch | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 package/musl/0002-fix-rcrt1.o.patch
diff --git a/package/musl/0002-fix-rcrt1.o.patch b/package/musl/0002-fix-rcrt1.o.patch
new file mode 100644
index 0000000000..3dae65569f
--- /dev/null
+++ b/package/musl/0002-fix-rcrt1.o.patch
@@ -0,0 +1,26 @@
+diff --git a/ldso/dlstart.c b/ldso/dlstart.c
+index 4dbe178..0dd1d5a 100644
+--- a/ldso/dlstart.c
++++ b/ldso/dlstart.c
+@@ -128,16 +128,18 @@ void _dlstart_c(size_t *sp, size_t *dynv)
+ rel = (void *)(base+dyn[DT_REL]);
+ rel_size = dyn[DT_RELSZ];
+ for (; rel_size; rel+=2, rel_size-=2*sizeof(size_t)) {
+- if (!IS_RELATIVE(rel[1], 0)) continue;
+ size_t *rel_addr = (void *)(base + rel[0]);
++ if (rel[1] == REL_DTPMOD) *rel_addr = 1;
++ if (!IS_RELATIVE(rel[1], 0)) continue;
+ *rel_addr += base;
+ }
+
+ rel = (void *)(base+dyn[DT_RELA]);
+ rel_size = dyn[DT_RELASZ];
+ for (; rel_size; rel+=3, rel_size-=3*sizeof(size_t)) {
+- if (!IS_RELATIVE(rel[1], 0)) continue;
+ size_t *rel_addr = (void *)(base + rel[0]);
++ if (rel[1] == REL_DTPMOD) *rel_addr = 1;
++ if (!IS_RELATIVE(rel[1], 0)) continue;
+ *rel_addr = base + rel[2];
+ }
+ #endif
+
--
2.15.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-14 10:57 [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Arvid E. Picciani
@ 2017-12-14 10:57 ` Arvid E. Picciani
2017-12-14 15:21 ` Thomas Petazzoni
2017-12-14 14:19 ` [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Thomas Petazzoni
1 sibling, 1 reply; 11+ messages in thread
From: Arvid E. Picciani @ 2017-12-14 10:57 UTC (permalink / raw)
To: buildroot
Signed-off-by: Arvid E. Picciani <aep@exys.org>
---
package/libfuse/Config.in | 4 ----
package/libfuse/libfuse.mk | 3 ++-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/package/libfuse/Config.in b/package/libfuse/Config.in
index 2b0e31a991..62b18c2444 100644
--- a/package/libfuse/Config.in
+++ b/package/libfuse/Config.in
@@ -1,7 +1,6 @@
config BR2_PACKAGE_LIBFUSE
bool "libfuse"
# Really doesn't like static, see fuse/lib/fuse.c
- depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU # fork()
help
@@ -9,6 +8,3 @@ config BR2_PACKAGE_LIBFUSE
https://github.com/libfuse/libfuse
-comment "libfuse needs a toolchain w/ threads, dynamic library"
- depends on BR2_USE_MMU
- depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
diff --git a/package/libfuse/libfuse.mk b/package/libfuse/libfuse.mk
index dc177d03c1..570390ca76 100644
--- a/package/libfuse/libfuse.mk
+++ b/package/libfuse/libfuse.mk
@@ -12,13 +12,14 @@ LIBFUSE_LICENSE_FILES = COPYING COPYING.LIB
LIBFUSE_INSTALL_STAGING = YES
LIBFUSE_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
LIBFUSE_CONF_OPTS = \
+ --enable-static \
--disable-example \
--enable-lib \
--enable-util
define LIBFUSE_INSTALL_TARGET_CMDS
cp -dpf $(STAGING_DIR)/usr/bin/fusermount $(TARGET_DIR)/usr/bin/
- cp -dpf $(STAGING_DIR)/usr/lib/libfuse.so* $(TARGET_DIR)/usr/lib/
+ cp -dpf $(STAGING_DIR)/usr/lib/libfuse.a* $(TARGET_DIR)/usr/lib/
endef
$(eval $(autotools-package))
--
2.15.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-14 10:57 ` [Buildroot] [PATCH 2/2] enable static linking for libfuse Arvid E. Picciani
@ 2017-12-14 15:21 ` Thomas Petazzoni
2017-12-14 15:27 ` Arvid Picciani
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-12-14 15:21 UTC (permalink / raw)
To: buildroot
Hello,
Thanks for your contribution. However...
On Thu, 14 Dec 2017 11:57:06 +0100, Arvid E. Picciani wrote:
> Signed-off-by: Arvid E. Picciani <aep@exys.org>
> ---
> package/libfuse/Config.in | 4 ----
> package/libfuse/libfuse.mk | 3 ++-
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/package/libfuse/Config.in b/package/libfuse/Config.in
> index 2b0e31a991..62b18c2444 100644
> --- a/package/libfuse/Config.in
> +++ b/package/libfuse/Config.in
> @@ -1,7 +1,6 @@
> config BR2_PACKAGE_LIBFUSE
> bool "libfuse"
> # Really doesn't like static, see fuse/lib/fuse.c
...did you see this comment?
fuse.c uses dlopen(), this requires shared library support.
Apply your patch, and build the following configuration:
BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2017.11-rc1.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_LIBFUSE=y
# BR2_TARGET_ROOTFS_TAR is not set
You'll get the following build failure:
fuse.c:33:19: fatal error: dlfcn.h: No such file or directory
#include <dlfcn.h>
^
compilation terminated.
Also, passing --enable-static is not necessary, this is already done by
the autotools-package infrastructure when BR2_STATIC_LIBS=y.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-14 15:21 ` Thomas Petazzoni
@ 2017-12-14 15:27 ` Arvid Picciani
2017-12-14 15:52 ` Thomas Petazzoni
2017-12-15 13:07 ` Stefan Fröberg
0 siblings, 2 replies; 11+ messages in thread
From: Arvid Picciani @ 2017-12-14 15:27 UTC (permalink / raw)
To: buildroot
thanks for checking.
yes i did see the comment that's why i didnt submit a proper patch but more
an RFC.
It builds fine for me. maybe it doesn't try to use the dlopen stuff with
musl?
On Thu, Dec 14, 2017 at 4:21 PM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> Thanks for your contribution. However...
>
> On Thu, 14 Dec 2017 11:57:06 +0100, Arvid E. Picciani wrote:
> > Signed-off-by: Arvid E. Picciani <aep@exys.org>
> > ---
> > package/libfuse/Config.in | 4 ----
> > package/libfuse/libfuse.mk | 3 ++-
> > 2 files changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/package/libfuse/Config.in b/package/libfuse/Config.in
> > index 2b0e31a991..62b18c2444 100644
> > --- a/package/libfuse/Config.in
> > +++ b/package/libfuse/Config.in
> > @@ -1,7 +1,6 @@
> > config BR2_PACKAGE_LIBFUSE
> > bool "libfuse"
> > # Really doesn't like static, see fuse/lib/fuse.c
>
> ...did you see this comment?
>
> fuse.c uses dlopen(), this requires shared library support.
>
> Apply your patch, and build the following configuration:
>
> BR2_arm=y
> BR2_STATIC_LIBS=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/
> toolchains/tarballs/br-arm-full-static-2017.11-rc1.tar.bz2"
> BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
> BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
> # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_LIBFUSE=y
> # BR2_TARGET_ROOTFS_TAR is not set
>
> You'll get the following build failure:
>
> fuse.c:33:19: fatal error: dlfcn.h: No such file or directory
> #include <dlfcn.h>
> ^
> compilation terminated.
>
> Also, passing --enable-static is not necessary, this is already done by
> the autotools-package infrastructure when BR2_STATIC_LIBS=y.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171214/0ba423a7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config
Type: application/octet-stream
Size: 77278 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171214/0ba423a7/attachment.obj>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-14 15:27 ` Arvid Picciani
@ 2017-12-14 15:52 ` Thomas Petazzoni
2017-12-15 13:12 ` Stefan Fröberg
2017-12-15 13:07 ` Stefan Fröberg
1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-12-14 15:52 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 14 Dec 2017 16:27:36 +0100, Arvid Picciani wrote:
> yes i did see the comment that's why i didnt submit a proper patch but more
> an RFC.
> It builds fine for me. maybe it doesn't try to use the dlopen stuff with
> musl?
I guess musl always has dlopen(), even in a purely statically linked
scenario, while uClibc does not have it.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-14 15:52 ` Thomas Petazzoni
@ 2017-12-15 13:12 ` Stefan Fröberg
2017-12-15 13:22 ` Stefan Fröberg
2017-12-15 14:10 ` Thomas Petazzoni
0 siblings, 2 replies; 11+ messages in thread
From: Stefan Fröberg @ 2017-12-15 13:12 UTC (permalink / raw)
To: buildroot
Hi Thomas
Thomas Petazzoni kirjoitti 14.12.2017 klo 17:52:
> Hello,
>
> On Thu, 14 Dec 2017 16:27:36 +0100, Arvid Picciani wrote:
>
>> yes i did see the comment that's why i didnt submit a proper patch but more
>> an RFC.
>> It builds fine for me. maybe it doesn't try to use the dlopen stuff with
>> musl?
> I guess musl always has dlopen(), even in a purely statically linked
> scenario, while uClibc does not have it.
>
> Thomas
But doesn't static glibc also use dlopen() ?
-S-
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-15 13:12 ` Stefan Fröberg
@ 2017-12-15 13:22 ` Stefan Fröberg
2017-12-15 14:10 ` Thomas Petazzoni
1 sibling, 0 replies; 11+ messages in thread
From: Stefan Fröberg @ 2017-12-15 13:22 UTC (permalink / raw)
To: buildroot
Ah, found this from 2012:
http://openwall.com/lists/musl/2012/12/08/4
So for statically linked musl (and uclibc) dlopen is no no
-S-
Stefan Fr?berg kirjoitti 15.12.2017 klo 15:12:
> Hi Thomas
>
>
> Thomas Petazzoni kirjoitti 14.12.2017 klo 17:52:
>> Hello,
>>
>> On Thu, 14 Dec 2017 16:27:36 +0100, Arvid Picciani wrote:
>>
>>> yes i did see the comment that's why i didnt submit a proper patch but more
>>> an RFC.
>>> It builds fine for me. maybe it doesn't try to use the dlopen stuff with
>>> musl?
>> I guess musl always has dlopen(), even in a purely statically linked
>> scenario, while uClibc does not have it.
>>
>> Thomas
> But doesn't static glibc also use dlopen() ?
>
> -S-
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-15 13:12 ` Stefan Fröberg
2017-12-15 13:22 ` Stefan Fröberg
@ 2017-12-15 14:10 ` Thomas Petazzoni
1 sibling, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2017-12-15 14:10 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 15 Dec 2017 15:12:41 +0200, Stefan Fr?berg wrote:
> > I guess musl always has dlopen(), even in a purely statically linked
> > scenario, while uClibc does not have it.
> >
> > Thomas
>
> But doesn't static glibc also use dlopen() ?
We don't support glibc with BR2_STATIC_LIBS=y.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 2/2] enable static linking for libfuse
2017-12-14 15:27 ` Arvid Picciani
2017-12-14 15:52 ` Thomas Petazzoni
@ 2017-12-15 13:07 ` Stefan Fröberg
[not found] ` <CABukmmN5UjdWupf_8zuCkx13tuNVFxeD9AOE=cemfQ_Soe1AUQ@mail.gmail.com>
1 sibling, 1 reply; 11+ messages in thread
From: Stefan Fröberg @ 2017-12-15 13:07 UTC (permalink / raw)
To: buildroot
Hi Arvid
Arvid Picciani kirjoitti 14.12.2017 klo 17:27:
> thanks for checking.
> yes i did see the comment that's why i didnt submit a proper patch but
> more an RFC.
> It builds fine for me. maybe it doesn't try to use the dlopen stuff
> with musl?
>
Just out of interest:? do you also have the following static musl
libraries with size 8 bytes and
content just "!<arch>" and nothing more :
libcrypt,a libdl.a libm.a libpthread.a libresolv.a librt.a libutil.a
libxnet.a
Musl seems to stuff all their stuff into libc.a when using static linking?
I am asking this because I have dlopen problem with static linking
Python on musl.
(or actually, I can build Python completely statically against musl just
fine if I disable the dlopen part but that will
also disable pip and setuptools support)
-S-
>
> On Thu, Dec 14, 2017 at 4:21 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com
> <mailto:thomas.petazzoni@free-electrons.com>> wrote:
>
> Hello,
>
> Thanks for your contribution. However...
>
> On Thu, 14 Dec 2017 11:57:06 +0100, Arvid E. Picciani wrote:
> > Signed-off-by: Arvid E. Picciani <aep@exys.org
> <mailto:aep@exys.org>>
> > ---
> >? package/libfuse/Config.in? | 4 ----
> >? package/libfuse/libfuse.mk <http://libfuse.mk> | 3 ++-
> >? 2 files changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/package/libfuse/Config.in b/package/libfuse/Config.in
> > index 2b0e31a991..62b18c2444 100644
> > --- a/package/libfuse/Config.in
> > +++ b/package/libfuse/Config.in
> > @@ -1,7 +1,6 @@
> >? config BR2_PACKAGE_LIBFUSE
> >? ? ? ?bool "libfuse"
> >? ? ? ?# Really doesn't like static, see fuse/lib/fuse.c
>
> ...did you see this comment?
>
> fuse.c uses dlopen(), this requires shared library support.
>
> Apply your patch, and build the following configuration:
>
> BR2_arm=y
> BR2_STATIC_LIBS=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2017.11-rc1.tar.bz2
> <http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2017.11-rc1.tar.bz2>"
> BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
> BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
> # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_LIBFUSE=y
> # BR2_TARGET_ROOTFS_TAR is not set
>
> You'll get the following build failure:
>
> fuse.c:33:19: fatal error: dlfcn.h: No such file or directory
> ?#include <dlfcn.h>
> ? ? ? ? ? ? ? ? ? ?^
> compilation terminated.
>
> Also, passing --enable-static is not necessary, this is already
> done by
> the autotools-package infrastructure when BR2_STATIC_LIBS=y.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
>
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171215/2f508195/attachment.html>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0
2017-12-14 10:57 [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Arvid E. Picciani
2017-12-14 10:57 ` [Buildroot] [PATCH 2/2] enable static linking for libfuse Arvid E. Picciani
@ 2017-12-14 14:19 ` Thomas Petazzoni
1 sibling, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2017-12-14 14:19 UTC (permalink / raw)
To: buildroot
Hello,
Thanks for your contribution!
On Thu, 14 Dec 2017 11:57:05 +0100, Arvid E. Picciani wrote:
> See https://github.com/rust-lang/rust/issues/46566
>
> Signed-off-by: Arvid E. Picciani <aep@exys.org>
> ---
> package/musl/0002-fix-rcrt1.o.patch | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 package/musl/0002-fix-rcrt1.o.patch
>
> diff --git a/package/musl/0002-fix-rcrt1.o.patch b/package/musl/0002-fix-rcrt1.o.patch
> new file mode 100644
> index 0000000000..3dae65569f
> --- /dev/null
> +++ b/package/musl/0002-fix-rcrt1.o.patch
All patches need a description and a Signed-off-by. Also is this patch
in upstream musl? Has it been submitted?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-12-18 6:25 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-14 10:57 [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Arvid E. Picciani
2017-12-14 10:57 ` [Buildroot] [PATCH 2/2] enable static linking for libfuse Arvid E. Picciani
2017-12-14 15:21 ` Thomas Petazzoni
2017-12-14 15:27 ` Arvid Picciani
2017-12-14 15:52 ` Thomas Petazzoni
2017-12-15 13:12 ` Stefan Fröberg
2017-12-15 13:22 ` Stefan Fröberg
2017-12-15 14:10 ` Thomas Petazzoni
2017-12-15 13:07 ` Stefan Fröberg
[not found] ` <CABukmmN5UjdWupf_8zuCkx13tuNVFxeD9AOE=cemfQ_Soe1AUQ@mail.gmail.com>
2017-12-18 6:25 ` Thomas Petazzoni
2017-12-14 14:19 ` [Buildroot] [PATCH 1/2] DTPMOD mod fix for musl's rcrt0 Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox