Build breakage with thumb2

Yann E. MORIN yann.morin.1998 at free.fr
Sat Apr 6 17:56:05 UTC 2013


Will, All,

On Tue, Apr 02, 2013 at 12:04:57PM +0100, Will Newton wrote:
> It looks like the below patch breaks the build when the compiler
> defines __thumb2__. I don't see how this patch was intended to work -
> arm_asm.h does not define __USE_BX__ and it does not seem suitable to
> include in C files. I would suggest the patch is reverted.
> 
> commit 3862c65a05983b2b18cb7884a124a905828f7a18
> Author: Yann E. MORIN <yann.morin.1998 at anciens.enib.fr>
> Date:   Sun Jan 9 01:45:08 2011 +0100
> 
>     ARM: #include <bits/arm_asm.h> where __USE_BX__ is used
> 
>     The check for __USE_BX__ will be available in bits/arm_asm.h,
>     so the latter must be included wherever the former is used.
> 
>     Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at anciens.enib.fr>
>     Cc: Khem Raj <raj.khem at gmail.com>
>     Cc: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
>     Cc: Carmelo AMOROSO <carmelo.amoroso at st.com>
>     Signed-off-by: Khem Raj <raj.khem at gmail.com>

Indeed, it's broken.

This patch was part of a bigger patch series which goal was to remove
cpu-variant and similar features selection from the menuconfig, and
instead rely on the compiler to be properly set up:
    http://lists.uclibc.org/pipermail/uclibc/2011-January/044599.html
and following mails in the thread.

Basically, the reasoning for this patch was:
  - BX is not available on all CPUs
  - we no longer select the CPU from the menuconfig
  - thus, there is no way to ensure coherency from the menuconfig
  - yet people may still want to use BX
  - so, we can only check at build time
  - all files that need to know whether to use BX have to check it is
    available
  - doing so in bits/asm_arm.h seemed like a good place at the time

This patch was only the first step, and was quickly followed by:

---8<---
commit 7a246fda8e3bd2067d44e01c30c8ce761dad39a8
Author: Yann E. MORIN <yann.morin.1998 at anciens.enib.fr>
Date:   Sun Jan 9 01:45:09 2011 +0100

    ARM: detect BX availibility at build time
    
    The "use BX" option is now a suggestion that BX be used if available.
    Use a macro to detect if BX is available at build time. If so, and
    the user requested it be used, then use it. Otherwise, error out.
    
    Macro courtesy Khem RAJ:
      http://lists.uclibc.org/pipermail/uclibc/2009-April/042301.html
    
    Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at anciens.enib.fr>
    Cc: Khem Raj <raj.khem at gmail.com>
    Cc: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
    Cc: Carmelo AMOROSO <carmelo.amoroso at st.com>
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
---8<---

I indeed did not test targetting a Thumb-2 CPU with a Thumb-2 aware
compiler.

This commit should be reverted, but not before files that use __USE_BX__
can include another header that does the check that BS is indeed
available.

I'll cook a patch now.

Thanks for the report. :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the uClibc mailing list