This page is intended to document information relevant to developers building or migrating packages to Thumb-2, related decisions and outstanding tasks.

Review Lists

For lists of packages which may require review, see ARM/Thumb2PackageReviewList.

Default Build Options for Lucid

GCC:

as:

Bug Tagging

To make tracking easier, I suggest that the following tags are applied to every bug which is connected with the migration to ARMv7 or Thumb-2:

For bugs where the only known workaround is to build the package with -marm, please also add the following tag:

Please make sure you add the arm-mode tag when publishing any fix which involves specifying -marm. This should help these cases to be reviewed later.

How to deal with build failures

The following sections suggest what to do if packages fail to build for Thumb-2.

Please subscribe the following people on any launchpad bug connected with ARMv7 / Thumb-2 migration:

Developer Advice

See the Thumb-2 porting HOWTO page for detailed advice on how to make packages ready for Thumb-2 and ARMv7, and how to deal with build failures.

https://wiki.ubuntu.com/ARM/Thumb2PortingHowto

Some of the more common build problems are also summarised briefly below.

Assembler errors

If a build bails out with assembler errors, check the following, in roughly the order specified:

Compiler Errors

If you hit compiler segfaults or other obscure compiler internal errors, this needs to be followed up.

Please raise a bug in launchpad, preferably attaching the preprocessed compiler input and a script containing a suitable command line to reproduce the error.

Please tag such bugs with armel and armv7, and subscribe:

If you need to continue work in the meantime, because you want to purge all failures from a package or because it's a dependency of the package you're really interested in for example, you may be able to work around the error locally by doing one of the following before resuming your build:

...however, such workarounds should not be committed to the archive.

Adding Thumb-2-specific workarounds

If some Thumb-2-specific workaround code is needed in inline assembler in C or C++ source, or in assembler files which will be preprocessed (.S files), use:

#ifdef __thumb__
...
#else
...
#endif

...or equivalent. Some more manual approach may be needed for non-preprocessed assembler files.

Using the GCC atomic intrinsics

Where porting atomic operations to use the GCC atomic intrinsics, the correct way to check for presence of the intrinsics appears to be to check that GCC >= 4.4, so:

For arch-indepdent use of the instrinsics:

#if defined(defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))

For armel-specific use:

#if defined(__arm__) && defined(defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
...
#else
...
#endif

...*phew* ( if anyone knows a neater way to do that, please suggest it! Smile :) )

Packages with outstanding issues

Note: this is a manually-maintainted list, and may not be exhaustive!

The numbers in (parentheses) refer to the relevant item in the How to Deal With Build Failures section.

The Kernel

The kernel is already being compiled for ARMv7. We have investigated switching to thumb mode for the kernel to reduce kernel code size. In summary it does not appear to be possible without significant engineering effort.

The issue is that the kernel side support is a new 2.6.32 feature. I had a look at what it might take to pull this back to a 2.6.31 code base and it seems to be minimally 11 patches to bring basic support. Even pulling those back I was unable to compile the kernel, architecture specific assembly needs to be corrected. It also seemed to prevent compilation of kexec a key feature for softboot.

It does not appear sensible to try and support kernel side thumb support for 2.6.31 based kernels. 2.6.32 kernels should have this support available and we should enable it when we have those kernels.

Information

Sources of information:

General:

Thumb-2 syntax (very brief overview):

Lucid armel toolchain spec from UDS:

NEON SIMD instruction set:

Memory barriers and synchronisation:

ARM/Thumb2 (last edited 2010-09-17 09:30:32 by fw-tnat)