* [lttng-dev] [PATCH lttng-ust 2/4] Fix: strerror_r behavior is glibc specific
2016-05-30 20:31 [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h Michael Jeanson
@ 2016-05-30 20:31 ` Michael Jeanson
2016-05-30 20:31 ` [lttng-dev] [PATCH lttng-ust 3/4] Fix: use limits.h in ust-elf test Michael Jeanson
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Michael Jeanson @ 2016-05-30 20:31 UTC (permalink / raw)
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
include/usterr-signal-safe.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/usterr-signal-safe.h b/include/usterr-signal-safe.h
index bc68fbf..1df5ada 100644
--- a/include/usterr-signal-safe.h
+++ b/include/usterr-signal-safe.h
@@ -106,7 +106,7 @@ do { \
#define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args)
#define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args)
-#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
+#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
/*
* Version using XSI strerror_r.
*/
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread* [lttng-dev] [PATCH lttng-ust 3/4] Fix: use limits.h in ust-elf test
2016-05-30 20:31 [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h Michael Jeanson
2016-05-30 20:31 ` [lttng-dev] [PATCH lttng-ust 2/4] Fix: strerror_r behavior is glibc specific Michael Jeanson
@ 2016-05-30 20:31 ` Michael Jeanson
2016-05-30 20:31 ` [lttng-dev] [PATCH lttng-ust 4/4] Use config.h to detect sched_getcpu support Michael Jeanson
2016-05-31 4:38 ` [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h Mathieu Desnoyers
3 siblings, 0 replies; 5+ messages in thread
From: Michael Jeanson @ 2016-05-30 20:31 UTC (permalink / raw)
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
tests/ust-elf/prog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/ust-elf/prog.c b/tests/ust-elf/prog.c
index da4f396..4036563 100644
--- a/tests/ust-elf/prog.c
+++ b/tests/ust-elf/prog.c
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <linux/limits.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [lttng-dev] [PATCH lttng-ust 4/4] Use config.h to detect sched_getcpu support
2016-05-30 20:31 [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h Michael Jeanson
2016-05-30 20:31 ` [lttng-dev] [PATCH lttng-ust 2/4] Fix: strerror_r behavior is glibc specific Michael Jeanson
2016-05-30 20:31 ` [lttng-dev] [PATCH lttng-ust 3/4] Fix: use limits.h in ust-elf test Michael Jeanson
@ 2016-05-30 20:31 ` Michael Jeanson
2016-05-31 4:38 ` [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h Mathieu Desnoyers
3 siblings, 0 replies; 5+ messages in thread
From: Michael Jeanson @ 2016-05-30 20:31 UTC (permalink / raw)
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
libringbuffer/getcpu.h | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/libringbuffer/getcpu.h b/libringbuffer/getcpu.h
index fbddb79..7b009dc 100644
--- a/libringbuffer/getcpu.h
+++ b/libringbuffer/getcpu.h
@@ -22,6 +22,7 @@
#include <urcu/compiler.h>
#include <urcu/system.h>
#include <urcu/arch.h>
+#include <config.h>
void lttng_ust_getcpu_init(void);
@@ -47,10 +48,7 @@ int lttng_ust_get_cpu_internal(void)
*/
#ifdef __linux__
-/* old uClibc versions didn't have sched_getcpu */
-#if defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && \
- (__UCLIBC_MINOR__ < 9 || \
- (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32))
+#if !HAVE_SCHED_GETCPU
#include <sys/syscall.h>
#define __getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
/*
@@ -64,9 +62,9 @@ int lttng_ust_get_cpu_internal(void)
ret = __getcpu(&cpu, NULL, NULL);
if (caa_unlikely(ret < 0))
return 0;
- return c;
+ return cpu;
}
-#else /* __UCLIBC__ */
+#else /* HAVE_SCHED_GETCPU */
#include <sched.h>
/*
@@ -82,7 +80,7 @@ int lttng_ust_get_cpu_internal(void)
return 0;
return cpu;
}
-#endif /* __UCLIBC__ */
+#endif /* HAVE_SCHED_GETCPU */
#elif (defined(__FreeBSD__) || defined(__CYGWIN__))
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h
2016-05-30 20:31 [lttng-dev] [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h Michael Jeanson
` (2 preceding siblings ...)
2016-05-30 20:31 ` [lttng-dev] [PATCH lttng-ust 4/4] Use config.h to detect sched_getcpu support Michael Jeanson
@ 2016-05-31 4:38 ` Mathieu Desnoyers
3 siblings, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2016-05-31 4:38 UTC (permalink / raw)
All merged into master, stable-2.8. The commit marked
"fix" that apply to 2.7 has been backported.
----- On May 30, 2016, at 10:31 PM, Michael Jeanson mjeanson at efficios.com wrote:
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
> include/lttng/ust-dlfcn.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/lttng/ust-dlfcn.h b/include/lttng/ust-dlfcn.h
> index c92f1bb..7471d94 100644
> --- a/include/lttng/ust-dlfcn.h
> +++ b/include/lttng/ust-dlfcn.h
> @@ -31,6 +31,7 @@
> #error "Please include lttng/ust-dlfcn.h before dlfcn.h."
> #endif /* _DLFCN_H */
>
> +#ifdef __GLIBC__
> /*
> * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see
> * THROW annotation). Unfortunately, this is not in sync with reality,
> @@ -57,5 +58,8 @@ extern int dlclose(void *__handle) __nonnull ((1));
> extern void *dlsym(void *__restrict __handle,
> __const char *__restrict __name) __nonnull ((2));
> extern char *dlerror(void);
> +#else
> +#include <dlfcn.h>
> +#endif /* __GLIBC__ */
>
> #endif /* _LTTNG_UST_DLFCN_H */
> --
> 2.7.4
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 5+ messages in thread