* [Buildroot] [PATCH] libsigsegv: make the architecture dependencies more robust
@ 2016-08-08 13:11 Thomas Petazzoni
2016-08-09 13:50 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-08 13:11 UTC (permalink / raw)
To: buildroot
While musl and glibc provide the ucontext structure definition on all
architectures they support, it is not the case of uClibc. We have been
excluding more and more architectures over time, but this isn't really
nice as we continuously need to add more. Latest example: the fact that
ucontext on ARM is only available on ARM platforms that support the ARM
instruction set (i.e not on the Thumb-2 only Cortex-M platforms).
Therefore, we introduce a BR2_PACKAGE_LIBSIGSEGV_ARCH_SUPPORTS variable,
which:
- is set to 'y' for musl and glibc
- is set to 'y' for uClibc for the only architectures that are known to
provide ucontext (those are the ones that select ARCH_HAS_UCONTEXT in
uClibc.
Note that we remove the comment, as it would become a way too
complicated comment, and we usually don't add comment for such
complicated situations (see libunwind for a similar example).
Fixes:
http://autobuild.buildroot.net/results/b1e40b3ec64cd98b535d83e89e5780c46680e095/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/libsigsegv/Config.in | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/package/libsigsegv/Config.in b/package/libsigsegv/Config.in
index 90c6ba3..f258dc9 100644
--- a/package/libsigsegv/Config.in
+++ b/package/libsigsegv/Config.in
@@ -1,15 +1,20 @@
+config BR2_PACKAGE_LIBSIGSEGV_ARCH_SUPPORTS
+ bool
+ # with glibc/musl, ucontext is available for all supported
+ # architectures
+ default y if BR2_TOOLCHAIN_USES_GLIBC
+ default y if BR2_TOOLCHAIN_USES_MUSL
+ # with uclibc, ucontext is only available for a subset of the
+ # supported architectures
+ default y if BR2_TOOLCHAIN_USES_UCLIBC && \
+ (BR2_ARM_CPU_HAS_ARM || BR2_i386 || \
+ BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
+ BR2_sparc || BR2_x86_64)
+
config BR2_PACKAGE_LIBSIGSEGV
bool "libsigsegv"
- depends on !BR2_xtensa
- depends on !BR2_arc # no ucontext_i.sym file
- depends on !BR2_microblaze
- depends on !BR2_m68k # unknown type name 'ucontext_t'
- # No ucontext support in uclibc for powerpc and superh
- depends on !((BR2_powerpc || BR2_sh) && BR2_TOOLCHAIN_USES_UCLIBC)
+ depends on BR2_PACKAGE_LIBSIGSEGV_ARCH_SUPPORTS
help
Library for handling page faults in user mode.
http://www.gnu.org/software/libsigsegv/
-
-comment "libsigsegv needs a glibc toolchain"
- depends on (BR2_powerpc || BR2_sh) && BR2_TOOLCHAIN_USES_UCLIBC
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] libsigsegv: make the architecture dependencies more robust
2016-08-08 13:11 [Buildroot] [PATCH] libsigsegv: make the architecture dependencies more robust Thomas Petazzoni
@ 2016-08-09 13:50 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-09 13:50 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 8 Aug 2016 15:11:04 +0200, Thomas Petazzoni wrote:
> While musl and glibc provide the ucontext structure definition on all
> architectures they support, it is not the case of uClibc. We have been
> excluding more and more architectures over time, but this isn't really
> nice as we continuously need to add more. Latest example: the fact that
> ucontext on ARM is only available on ARM platforms that support the ARM
> instruction set (i.e not on the Thumb-2 only Cortex-M platforms).
>
> Therefore, we introduce a BR2_PACKAGE_LIBSIGSEGV_ARCH_SUPPORTS variable,
> which:
>
> - is set to 'y' for musl and glibc
>
> - is set to 'y' for uClibc for the only architectures that are known to
> provide ucontext (those are the ones that select ARCH_HAS_UCONTEXT in
> uClibc.
>
> Note that we remove the comment, as it would become a way too
> complicated comment, and we usually don't add comment for such
> complicated situations (see libunwind for a similar example).
>
> Fixes:
>
> http://autobuild.buildroot.net/results/b1e40b3ec64cd98b535d83e89e5780c46680e095/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> package/libsigsegv/Config.in | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-09 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08 13:11 [Buildroot] [PATCH] libsigsegv: make the architecture dependencies more robust Thomas Petazzoni
2016-08-09 13:50 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox