diff mbox

[2/2] package/xenomai: disable obstack support

Message ID 20170331202604.18153-2-romain.naour@gmail.com
State Accepted
Headers show

Commit Message

Romain Naour March 31, 2017, 8:26 p.m. UTC
Obstack support in Xenomai is broken when the libc doesn't support
obstack support itself. Make sure we disable obstack support for all
libc since it was removed in uClibc-ng since 1.0.21 release and it's
always disabled with Glibc.

Fixes:
http://autobuild.buildroot.net/results/555/555d9cb9cb59fad6353516bed206e1117974e8cd/build-end.log

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Pawel Sikora <sikor6@gmail.com>
---
 package/xenomai/xenomai.mk | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Thomas Petazzoni April 1, 2017, 12:44 p.m. UTC | #1
Hello,

On Fri, 31 Mar 2017 22:26:04 +0200, Romain Naour wrote:
> Obstack support in Xenomai is broken when the libc doesn't support
> obstack support itself. Make sure we disable obstack support for all
> libc since it was removed in uClibc-ng since 1.0.21 release and it's
> always disabled with Glibc.

What makes you say it's always disabled in glibc?

What's the status with musl?

Also, Xenomai seems to have some replacement code when obstack support
is not available from the C library. How does that interfact with
ELIDE_CODE ?

Thanks,

Thomas
Romain Naour April 1, 2017, 9:44 p.m. UTC | #2
Hi Thomas, All,

Le 01/04/2017 à 14:44, Thomas Petazzoni a écrit :
> Hello,
> 
> On Fri, 31 Mar 2017 22:26:04 +0200, Romain Naour wrote:
>> Obstack support in Xenomai is broken when the libc doesn't support
>> obstack support itself. Make sure we disable obstack support for all
>> libc since it was removed in uClibc-ng since 1.0.21 release and it's
>> always disabled with Glibc.
> 
> What makes you say it's always disabled in glibc?

From lib/boilerplate/obstack.c in Xenomai code:

#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
#  define ELIDE_CODE
# endif
#endif

While glibc is used, _GNU_OBSTACK_INTERFACE_VERSION is equal to
OBSTACK_INTERFACE_VERSION so ELIDE_CODE is defined and the Xenomai Obstack
support (the replacement code) is disabled.

While uClibc-ng >= 1.0.21 is used, _GNU_OBSTACK_INTERFACE_VERSION is not defined
so the Xenomai Obstack support is used but break the build.

> 
> What's the status with musl?

Xenomai is disabled with musl toolchains

> 
> Also, Xenomai seems to have some replacement code when obstack support
> is not available from the C library. How does that interfact with
> ELIDE_CODE ?

This is precisely the replacement code that is broken...
It try to use "exitfail.h" and define obstack_exit_failure with exit_failure
which is not defined.

The proposed fix define ELIDE_CODE to disable the Xenomai Obstack support
completely.

Otherwise, we have to add a dependency on glibc toolchain only since Obstack
support is missing in uClibc-ng... (maybe it's safer to do that?).

Best regards,
Romain

> 
> Thanks,
> 
> Thomas
>
sikor6@gmail.com April 11, 2017, 9:42 a.m. UTC | #3
Hi,


2017-04-01 23:44 GMT+02:00 Romain Naour <romain.naour@gmail.com>:

> Hi Thomas, All,
>
> Le 01/04/2017 à 14:44, Thomas Petazzoni a écrit :
> > Hello,
> >
> > On Fri, 31 Mar 2017 22:26:04 +0200, Romain Naour wrote:
> >> Obstack support in Xenomai is broken when the libc doesn't support
> >> obstack support itself. Make sure we disable obstack support for all
> >> libc since it was removed in uClibc-ng since 1.0.21 release and it's
> >> always disabled with Glibc.
> >
> > What makes you say it's always disabled in glibc?
>
> From lib/boilerplate/obstack.c in Xenomai code:
>
> #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
> # include <gnu-versions.h>
> # if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
> #  define ELIDE_CODE
> # endif
> #endif
>
> While glibc is used, _GNU_OBSTACK_INTERFACE_VERSION is equal to
> OBSTACK_INTERFACE_VERSION so ELIDE_CODE is defined and the Xenomai Obstack
> support (the replacement code) is disabled.
>
> While uClibc-ng >= 1.0.21 is used, _GNU_OBSTACK_INTERFACE_VERSION is not
> defined
> so the Xenomai Obstack support is used but break the build.
>
> >
> > What's the status with musl?
>
> Xenomai is disabled with musl toolchains
>
> >
> > Also, Xenomai seems to have some replacement code when obstack support
> > is not available from the C library. How does that interfact with
> > ELIDE_CODE ?
>
> This is precisely the replacement code that is broken...
> It try to use "exitfail.h" and define obstack_exit_failure with
> exit_failure
> which is not defined.
>
> The proposed fix define ELIDE_CODE to disable the Xenomai Obstack support
> completely.
>
> Otherwise, we have to add a dependency on glibc toolchain only since
> Obstack
> support is missing in uClibc-ng... (maybe it's safer to do that?).
>

That's a good question, but I also think that we should add dependency from
glibc,
at least until someone could say (Romain?) what would be the impact on
uClibc-ng without
obstack support... and will test it, right?

..but until then, Thomas/All, what do you think?

Regards,
Pawel


>
> Best regards,
> Romain
>
> >
> > Thanks,
> >
> > Thomas
> >
>
>
Thomas Petazzoni April 15, 2017, 10:01 a.m. UTC | #4
Hello,

On Fri, 31 Mar 2017 22:26:04 +0200, Romain Naour wrote:
> Obstack support in Xenomai is broken when the libc doesn't support
> obstack support itself. Make sure we disable obstack support for all
> libc since it was removed in uClibc-ng since 1.0.21 release and it's
> always disabled with Glibc.
> 
> Fixes:
> http://autobuild.buildroot.net/results/555/555d9cb9cb59fad6353516bed206e1117974e8cd/build-end.log
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Pawel Sikora <sikor6@gmail.com>
> ---
>  package/xenomai/xenomai.mk | 6 ++++++
>  1 file changed, 6 insertions(+)

Since nobody proposed a better solution, I applied your patch. However,
could you report the issue upstream? Hopefully they will have a look
and propose a better solution.

Thanks a lot!

Thomas
diff mbox

Patch

diff --git a/package/xenomai/xenomai.mk b/package/xenomai/xenomai.mk
index fc240f9..77889f0 100644
--- a/package/xenomai/xenomai.mk
+++ b/package/xenomai/xenomai.mk
@@ -23,6 +23,12 @@  XENOMAI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-user
 
 XENOMAI_CONF_OPTS += --includedir=/usr/include/xenomai/ --disable-doc-install
 
+# Obstack support in Xenomai is broken when the libc doesn't support
+# obstack support itself. Make sure we disable obstack support for all
+# libc since it was removed in uClibc-ng since 1.0.21 release and it's
+# always disabled with Glibc.
+XENOMAI_CONF_OPTS += CFLAGS="$(TARGET_CFLAGS) -DELIDE_CODE"
+
 define XENOMAI_REMOVE_DEVFILES
 	for i in xeno-config xeno-info wrap-link.sh ; do \
 		rm -f $(TARGET_DIR)/usr/bin/$$i ; \