* [Buildroot] [PATCH] package/mono: fix undefined reference to tls @ 2016-09-08 8:51 Angelo Compagnucci 2016-09-08 11:42 ` Thomas Petazzoni 0 siblings, 1 reply; 4+ messages in thread From: Angelo Compagnucci @ 2016-09-08 8:51 UTC (permalink / raw) To: buildroot This commit fixes the nasty undefined reference to tls bug experienced with musl. Fixes: http://autobuild.buildroot.net/results/048f04488cb8c7f4c32b828aa5214ebc22ba0153 Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> --- package/mono/mono.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/mono/mono.mk b/package/mono/mono.mk index 3d0b9bc..de4f16b 100644 --- a/package/mono/mono.mk +++ b/package/mono/mono.mk @@ -26,6 +26,10 @@ MONO_CONF_OPTS = --disable-gtk-doc \ --disable-mcs-build \ --enable-static +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +MONO_CONF_OPTS += --with-tls=pthread +endif + # The libraries have been built by the host-mono build. Since they are # architecture-independent, we simply copy them to the target. define MONO_INSTALL_LIBS -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/mono: fix undefined reference to tls 2016-09-08 8:51 [Buildroot] [PATCH] package/mono: fix undefined reference to tls Angelo Compagnucci @ 2016-09-08 11:42 ` Thomas Petazzoni 2016-09-09 5:29 ` Angelo Compagnucci 0 siblings, 1 reply; 4+ messages in thread From: Thomas Petazzoni @ 2016-09-08 11:42 UTC (permalink / raw) To: buildroot Hello, Thanks for investigating this issue! On Thu, 8 Sep 2016 10:51:07 +0200, Angelo Compagnucci wrote: > This commit fixes the nasty undefined reference to tls bug experienced with musl. > > Fixes: > http://autobuild.buildroot.net/results/048f04488cb8c7f4c32b828aa5214ebc22ba0153 > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> > --- > package/mono/mono.mk | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/package/mono/mono.mk b/package/mono/mono.mk > index 3d0b9bc..de4f16b 100644 > --- a/package/mono/mono.mk > +++ b/package/mono/mono.mk > @@ -26,6 +26,10 @@ MONO_CONF_OPTS = --disable-gtk-doc \ > --disable-mcs-build \ > --enable-static > > +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) > +MONO_CONF_OPTS += --with-tls=pthread > +endif Hum, that's interesting. Do you have more details about what this --with-tls option is doing? Is --with-tls related to Thread Local Storage provided by the compiler ? Indeed, TLS support in gcc was disabled for musl toolchains until recently (i.e until commit https://git.buildroot.org/buildroot/commit/package/gcc?id=1bd02bc230e1b3b22ca3eb23fb3dcb91b878283a). Since the toolchain that was causing the build failure was built *prior* to this commit, maybe this commit fixes the issue, as it would make musl toolchains have TLS support enabled in gcc. Could you test this using the internal toolchain backend, and see if without your fix the problem isn't already fixed? If that's the case, I'll simply rebuild the pre-built toolchains. Thanks, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/mono: fix undefined reference to tls 2016-09-08 11:42 ` Thomas Petazzoni @ 2016-09-09 5:29 ` Angelo Compagnucci 2016-09-09 7:26 ` Thomas Petazzoni 0 siblings, 1 reply; 4+ messages in thread From: Angelo Compagnucci @ 2016-09-09 5:29 UTC (permalink / raw) To: buildroot Hello Thomas, 2016-09-08 13:42 GMT+02:00 Thomas Petazzoni < thomas.petazzoni@free-electrons.com>: > Hello, > > Thanks for investigating this issue! > > On Thu, 8 Sep 2016 10:51:07 +0200, Angelo Compagnucci wrote: > > This commit fixes the nasty undefined reference to tls bug experienced > with musl. > > > > Fixes: > > http://autobuild.buildroot.net/results/048f04488cb8c7f4c32b828aa5214e > bc22ba0153 > > Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> > > --- > > package/mono/mono.mk | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/package/mono/mono.mk b/package/mono/mono.mk > > index 3d0b9bc..de4f16b 100644 > > --- a/package/mono/mono.mk > > +++ b/package/mono/mono.mk > > @@ -26,6 +26,10 @@ MONO_CONF_OPTS = --disable-gtk-doc \ > > --disable-mcs-build \ > > --enable-static > > > > +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) > > +MONO_CONF_OPTS += --with-tls=pthread > > +endif > > Hum, that's interesting. Do you have more details about what this > --with-tls option is doing? > Actually, it sets another variable (HAVE_KW_THREAD) that it's used around the code to accommodate the use of __thread or phtread as local storage. > Is --with-tls related to Thread Local Storage provided by the compiler ? > Yes, absolutely! > > Indeed, TLS support in gcc was disabled for musl toolchains until > recently (i.e until commit > https://git.buildroot.org/buildroot/commit/package/gcc?id= > 1bd02bc230e1b3b22ca3eb23fb3dcb91b878283a). > > Since the toolchain that was causing the build failure was built > *prior* to this commit, maybe this commit fixes the issue, as it would > make musl toolchains have TLS support enabled in gcc. > > Could you test this using the internal toolchain backend, and see if > without your fix the problem isn't already fixed? If that's the case, > I'll simply rebuild the pre-built toolchains. > I tested both the pre-compiled musl external toolchain and a musl internal toolchain I compiled and I can confirm that it's working without this patch. So, probably simply rebuilding the autobuild toolchain should solve the problem. Sincerely, Angelo > > Thanks, > > Thomas > -- > Thomas Petazzoni, CTO, Free Electrons > Embedded Linux and Kernel engineering > http://free-electrons.com > -- Profile: http://it.linkedin.com/in/compagnucciangelo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160909/716811ea/attachment.html> ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/mono: fix undefined reference to tls 2016-09-09 5:29 ` Angelo Compagnucci @ 2016-09-09 7:26 ` Thomas Petazzoni 0 siblings, 0 replies; 4+ messages in thread From: Thomas Petazzoni @ 2016-09-09 7:26 UTC (permalink / raw) To: buildroot Hello, On Fri, 9 Sep 2016 07:29:11 +0200, Angelo Compagnucci wrote: > I tested both the pre-compiled musl external toolchain and a musl internal > toolchain I compiled and I can confirm that it's working without this patch. > So, probably simply rebuilding the autobuild toolchain should solve the > problem. Excellent, thanks! I'll kick a rebuild of the different Buildroot toolchains soon, especially since we have move to a newer binutils version, and have more recent version of gcc available as well. Thanks, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-09 7:26 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-09-08 8:51 [Buildroot] [PATCH] package/mono: fix undefined reference to tls Angelo Compagnucci 2016-09-08 11:42 ` Thomas Petazzoni 2016-09-09 5:29 ` Angelo Compagnucci 2016-09-09 7:26 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox