1 The "use BX" option is now a suggestion that BX be used if available.
2 Use a macro to detect if BX is available at build time. If so, and
3 the user requested it be used, then use it. Otherwise, error out.
5 Macro courtesy Khem RAJ:
6 http://lists.uclibc.org/pipermail/uclibc/2009-April/042301.html
8 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
9 Cc: Khem Raj <raj.khem@gmail.com>
10 Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
13 extra/Configs/Config.arm | 4 +++-
14 libc/sysdeps/linux/arm/bits/arm_asm.h | 9 ++++++++-
15 2 files changed, 11 insertions(+), 2 deletions(-)
17 --- a/extra/Configs/Config.arm
18 +++ b/extra/Configs/Config.arm
19 @@ -33,4 +33,6 @@ config COMPILE_IN_THUMB_MODE
21 bool "Use BX in function return"
23 - Use BX instruction for THUMB aware architectures.
24 + Say 'y' to use BX to return from functions on your thumb-aware
25 + processor. Say 'y' if you need to use interworking. Say 'n' if not.
26 + It is safe to say 'y' even if you're not doing interworking.
27 --- a/libc/sysdeps/linux/arm/bits/arm_asm.h
28 +++ b/libc/sysdeps/linux/arm/bits/arm_asm.h
33 -#endif /* _ARM_ASM_H */
34 +#if defined(__USE_BX__)
35 +# if ( defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \
36 + || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
38 +# error Use of BX was requested, but is not available on the target processor.
39 +# endif /* ARCH level */
40 +#endif /* __USE_BX__ */
42 +#endif /* _ARM_ASM_H */