Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
@ 2008-03-12  8:08 Thomas Petazzoni
  2008-03-14  8:03 ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2008-03-12  8:08 UTC (permalink / raw)
  To: buildroot

Hi,

You'll find enclosed in this mail a patch that adds Thumb support for
buildroot. It allows to generate an interworking-enabled toolchain,
with an uClibc compiled in ARM mode, and then to compile userspace
applications in Thumb mode.

More details are available in the patch description.

Of course, your comments, reviews and suggestions are welcome!

Thanks for developing such a great tool,

Sincerly,

Thomas

---
Add thumb support to buildroot for the ARM architecture

The Thumb instruction set is encoded on 16 bits opcode instead of 32
bits opcode for the regular ARM instruction set. It generally allows
for greater code density, leading to reduced code size, which is nice
on memory-constrained embedded systems.

Currently, uClibc cannot be fully compiled using the Thumb instruction
set. Therefore, this patch still compile uClibc in regular ARM mode,
but allows to enable interworking support for the
toolchain. Interworking allows Thumb code to call ARM code and
vice-versa, allowing a mixed Thumb/ARM userspace.

Enabling interworking at the toolchain level is done using the
BR2_INTERWORKING_SUPPORT option, added by the patch. When enabled, it
adds --enable-interwork to the binutils and gcc configure options,
adds -mthumb-interwork to the CFLAGS during uClibc compilation, and
enables the USE_BX config option of uClibc (bx is an ARM instruction
that allows to switch between ARM and Thumb mode).

Once interworking is enabled, it is then possible to compile the
userspace applications in Thumb mode. This is what the new
BR2_THUMB_BINARIES option allows, by adding -mthumb to the CFLAGS used
during the compilation of userspace applications.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
 Config.in                      |    8 ++++++++
 package/Makefile.in            |    4 ++++
 toolchain/Config.in.2          |   12 ++++++++++++
 toolchain/binutils/binutils.mk |    5 +++++
 toolchain/gcc/Makefile.in      |    4 ++++
 toolchain/uClibc/uclibc.mk     |    7 +++++++
 6 files changed, 40 insertions(+)

Index: buildroot.new/Config.in
===================================================================
--- buildroot.new.orig/Config.in
+++ buildroot.new/Config.in
@@ -223,6 +223,14 @@
 
 	  WARNING: This is highly experimental at the moment.
 
+config BR2_THUMB_BINARIES
+	bool "generate Thumb binaries"
+	default n
+	depends on BR2_INTERWORKING_SUPPORT
+	help
+	  Compile binaries in Thumb mode. Only valid for ARM
+	  architecture.
+
 config BR2_HAVE_MANPAGES
 	bool "manpages on the target"
 	default n
Index: buildroot.new/package/Makefile.in
===================================================================
--- buildroot.new.orig/package/Makefile.in
+++ buildroot.new/package/Makefile.in
@@ -46,6 +46,10 @@
 TARGET_CFLAGS+=-msoft-float
 endif
 
+ifeq ($(BR2_THUMB_BINARIES),y)
+TARGET_CFLAGS+=-mthumb
+endif
+
 # enable VIS for v9a and v9b
 ifeq ($(findstring y,$(BR2_sparc_v9a)$(BR2_sparc64_v9a)$(BR2_sparc_v9b)$(BR2_sparc64_v9b)),y)
 TARGET_CFLAGS+=-mvis
Index: buildroot.new/toolchain/Config.in.2
===================================================================
--- buildroot.new.orig/toolchain/Config.in.2
+++ buildroot.new/toolchain/Config.in.2
@@ -61,6 +61,18 @@
 #	bool "Use softfp"
 #	default n
 
+config BR2_INTERWORKING_SUPPORT
+	bool "Enable interworking support"
+	default n
+	depends on BR2_arm || BR2_armeb
+	depends on !BR2_generic_arm && !BR2_arm610 && !BR2_arm710
+	help
+	  Interworking allows Thumb userspace binaries to be linked
+	  against the C standard library compiled in ARM mode.
+
+	  This is only possible on Thumb-aware architectures, i.e not
+	  Generic ARM, ARM610 or ARM710.
+
 config BR2_TARGET_OPTIMIZATION
 	string "Target Optimizations"
 	default "-Os -pipe"
Index: buildroot.new/toolchain/binutils/binutils.mk
===================================================================
--- buildroot.new.orig/toolchain/binutils/binutils.mk
+++ buildroot.new/toolchain/binutils/binutils.mk
@@ -65,6 +65,10 @@
 BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_TARGET_DIR)"
 endif
 
+ifeq ($(BR2_INTERWORKING_SUPPORT),y)
+INTERWORKING_CONFIG_OPTION=--enable-interwork
+endif
+
 BINUTILS_OFFICIAL_VERSION:=$(BINUTILS_VERSION)$(VENDOR_SUFFIX)$(VENDOR_BINUTILS_RELEASE)
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
 BINUTILS_PATCH_DIR:=toolchain/binutils/$(BINUTILS_VERSION)
@@ -112,6 +116,7 @@
 		--disable-werror \
 		$(SOFT_FLOAT_CONFIG_OPTION) \
 		$(EXTRA_BINUTILS_CONFIG_OPTIONS) \
+		$(INTERWORKING_CONFIG_OPTION) \
 	)
 	touch $@
 
Index: buildroot.new/toolchain/gcc/Makefile.in
===================================================================
--- buildroot.new.orig/toolchain/gcc/Makefile.in
+++ buildroot.new/toolchain/gcc/Makefile.in
@@ -65,6 +65,10 @@
 endif
 endif
 
+ifeq ($(BR2_INTERWORKING_SUPPORT),y)
+EXTRA_GCC_CONFIG_OPTIONS+=--enable-interwork
+endif
+
 # AVR32 GCC configuration
 ifeq ($(strip $(BR2_avr32)),y)
 EXTRA_GCC_CONFIG_OPTIONS+=--disable-libmudflap
Index: buildroot.new/toolchain/uClibc/uclibc.mk
===================================================================
--- buildroot.new.orig/toolchain/uClibc/uclibc.mk
+++ buildroot.new/toolchain/uClibc/uclibc.mk
@@ -322,6 +322,13 @@
 else
 	$(SED) 's,^.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=n,g' $(UCLIBC_DIR)/.oldconfig
 endif
+ifeq ($(BR2_INTERWORKING_SUPPORT),y)
+	$(SED) 's,^.*USE_BX.*,USE_BX=y,g' $(UCLIBC_DIR)/.oldconfig
+	$(SED) 's,^.*UCLIBC_EXTRA_CFLAGS.*,UCLIBC_EXTRA_CFLAGS="-mthumb-interwork",g' $(UCLIBC_DIR)/.oldconfig
+else
+
+	$(SED) 's,^.*USE_BX.*,USE_BX=n,g' $(UCLIBC_DIR)/.oldconfig
+endif
 ifeq ($(BR2_UCLIBC_PROGRAM_INVOCATION),y)
 	$(SED) 's,^.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*,UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y,g' $(UCLIBC_DIR)/.oldconfig
 else


-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080312/09bfe59a/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-12  8:08 [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture Thomas Petazzoni
@ 2008-03-14  8:03 ` Thomas Petazzoni
  2008-03-14 13:33   ` Ivan Kuten
  2008-03-19 16:16   ` Thomas Petazzoni
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2008-03-14  8:03 UTC (permalink / raw)
  To: buildroot

Hi,

Any comments on that ? Are you interested in merging such a patch ?

Thanks,

Thomas

Le Wed, 12 Mar 2008 09:08:46 +0100,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :

> Hi,
> 
> You'll find enclosed in this mail a patch that adds Thumb support for
> buildroot. It allows to generate an interworking-enabled toolchain,
> with an uClibc compiled in ARM mode, and then to compile userspace
> applications in Thumb mode.
> 
> More details are available in the patch description.
> 
> Of course, your comments, reviews and suggestions are welcome!
> 
> Thanks for developing such a great tool,
> 
> Sincerly,
> 
> Thomas
> 
> ---
> Add thumb support to buildroot for the ARM architecture
> 
> The Thumb instruction set is encoded on 16 bits opcode instead of 32
> bits opcode for the regular ARM instruction set. It generally allows
> for greater code density, leading to reduced code size, which is nice
> on memory-constrained embedded systems.
> 
> Currently, uClibc cannot be fully compiled using the Thumb instruction
> set. Therefore, this patch still compile uClibc in regular ARM mode,
> but allows to enable interworking support for the
> toolchain. Interworking allows Thumb code to call ARM code and
> vice-versa, allowing a mixed Thumb/ARM userspace.
> 
> Enabling interworking at the toolchain level is done using the
> BR2_INTERWORKING_SUPPORT option, added by the patch. When enabled, it
> adds --enable-interwork to the binutils and gcc configure options,
> adds -mthumb-interwork to the CFLAGS during uClibc compilation, and
> enables the USE_BX config option of uClibc (bx is an ARM instruction
> that allows to switch between ARM and Thumb mode).
> 
> Once interworking is enabled, it is then possible to compile the
> userspace applications in Thumb mode. This is what the new
> BR2_THUMB_BINARIES option allows, by adding -mthumb to the CFLAGS used
> during the compilation of userspace applications.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> ---
>  Config.in                      |    8 ++++++++
>  package/Makefile.in            |    4 ++++
>  toolchain/Config.in.2          |   12 ++++++++++++
>  toolchain/binutils/binutils.mk |    5 +++++
>  toolchain/gcc/Makefile.in      |    4 ++++
>  toolchain/uClibc/uclibc.mk     |    7 +++++++
>  6 files changed, 40 insertions(+)
> 
> Index: buildroot.new/Config.in
> ===================================================================
> --- buildroot.new.orig/Config.in
> +++ buildroot.new/Config.in
> @@ -223,6 +223,14 @@
>  
>  	  WARNING: This is highly experimental at the moment.
>  
> +config BR2_THUMB_BINARIES
> +	bool "generate Thumb binaries"
> +	default n
> +	depends on BR2_INTERWORKING_SUPPORT
> +	help
> +	  Compile binaries in Thumb mode. Only valid for ARM
> +	  architecture.
> +
>  config BR2_HAVE_MANPAGES
>  	bool "manpages on the target"
>  	default n
> Index: buildroot.new/package/Makefile.in
> ===================================================================
> --- buildroot.new.orig/package/Makefile.in
> +++ buildroot.new/package/Makefile.in
> @@ -46,6 +46,10 @@
>  TARGET_CFLAGS+=-msoft-float
>  endif
>  
> +ifeq ($(BR2_THUMB_BINARIES),y)
> +TARGET_CFLAGS+=-mthumb
> +endif
> +
>  # enable VIS for v9a and v9b
>  ifeq ($(findstring
> y,$(BR2_sparc_v9a)$(BR2_sparc64_v9a)$(BR2_sparc_v9b)$(BR2_sparc64_v9b)),y)
> TARGET_CFLAGS+=-mvis Index: buildroot.new/toolchain/Config.in.2
> ===================================================================
> --- buildroot.new.orig/toolchain/Config.in.2
> +++ buildroot.new/toolchain/Config.in.2
> @@ -61,6 +61,18 @@
>  #	bool "Use softfp"
>  #	default n
>  
> +config BR2_INTERWORKING_SUPPORT
> +	bool "Enable interworking support"
> +	default n
> +	depends on BR2_arm || BR2_armeb
> +	depends on !BR2_generic_arm && !BR2_arm610 && !BR2_arm710
> +	help
> +	  Interworking allows Thumb userspace binaries to be linked
> +	  against the C standard library compiled in ARM mode.
> +
> +	  This is only possible on Thumb-aware architectures, i.e not
> +	  Generic ARM, ARM610 or ARM710.
> +
>  config BR2_TARGET_OPTIMIZATION
>  	string "Target Optimizations"
>  	default "-Os -pipe"
> Index: buildroot.new/toolchain/binutils/binutils.mk
> ===================================================================
> --- buildroot.new.orig/toolchain/binutils/binutils.mk
> +++ buildroot.new/toolchain/binutils/binutils.mk
> @@ -65,6 +65,10 @@
>  BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_TARGET_DIR)"
>  endif
>  
> +ifeq ($(BR2_INTERWORKING_SUPPORT),y)
> +INTERWORKING_CONFIG_OPTION=--enable-interwork
> +endif
> +
>  BINUTILS_OFFICIAL_VERSION:=$(BINUTILS_VERSION)$(VENDOR_SUFFIX)$(VENDOR_BINUTILS_RELEASE)
>  ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
>  BINUTILS_PATCH_DIR:=toolchain/binutils/$(BINUTILS_VERSION)
> @@ -112,6 +116,7 @@
>  		--disable-werror \
>  		$(SOFT_FLOAT_CONFIG_OPTION) \
>  		$(EXTRA_BINUTILS_CONFIG_OPTIONS) \
> +		$(INTERWORKING_CONFIG_OPTION) \
>  	)
>  	touch $@
>  
> Index: buildroot.new/toolchain/gcc/Makefile.in
> ===================================================================
> --- buildroot.new.orig/toolchain/gcc/Makefile.in
> +++ buildroot.new/toolchain/gcc/Makefile.in
> @@ -65,6 +65,10 @@
>  endif
>  endif
>  
> +ifeq ($(BR2_INTERWORKING_SUPPORT),y)
> +EXTRA_GCC_CONFIG_OPTIONS+=--enable-interwork
> +endif
> +
>  # AVR32 GCC configuration
>  ifeq ($(strip $(BR2_avr32)),y)
>  EXTRA_GCC_CONFIG_OPTIONS+=--disable-libmudflap
> Index: buildroot.new/toolchain/uClibc/uclibc.mk
> ===================================================================
> --- buildroot.new.orig/toolchain/uClibc/uclibc.mk
> +++ buildroot.new/toolchain/uClibc/uclibc.mk
> @@ -322,6 +322,13 @@
>  else
>  	$(SED) 's,^.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=n,g'
> $(UCLIBC_DIR)/.oldconfig endif
> +ifeq ($(BR2_INTERWORKING_SUPPORT),y)
> +	$(SED) 's,^.*USE_BX.*,USE_BX=y,g' $(UCLIBC_DIR)/.oldconfig
> +	$(SED)
> 's,^.*UCLIBC_EXTRA_CFLAGS.*,UCLIBC_EXTRA_CFLAGS="-mthumb-interwork",g'
> $(UCLIBC_DIR)/.oldconfig +else +
> +	$(SED) 's,^.*USE_BX.*,USE_BX=n,g' $(UCLIBC_DIR)/.oldconfig
> +endif
>  ifeq ($(BR2_UCLIBC_PROGRAM_INVOCATION),y)
>  	$(SED)
> 's,^.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*,UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y,g'
> $(UCLIBC_DIR)/.oldconfig else
> 
> 


-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080314/20868ae7/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-14 13:33   ` Ivan Kuten
@ 2008-03-14 13:19     ` Thomas Petazzoni
  2008-03-14 13:56       ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2008-03-14 13:19 UTC (permalink / raw)
  To: buildroot

Le Fri, 14 Mar 2008 15:33:08 +0200,
Ivan Kuten <ivan.kuten@promwad.com> a ?crit :

> Thanks for your excellent work! Before committing your patch I have a
> question: have you tested it? on which CPU? which buildroot configs?

Yes, I tested it using Qemu versatilepb emulation. Enclosed is the
buildroot configuration I used.

> I'm asking this because for almost half of year I did not managed to
> build a good ARM EABI toolchain with buildroot. Toolchain seems emit
> invalid instructions when building busybox. So I managed only to run
> very simple hello-world when set in cmdline init=hello-world, but not
> a busybox binary with shell, etc. Boot process just hangs when
> busybox running. Magic-SysRq key shows that illegal instruction trap
> was involved. What is surprising that rootfs can be launched ok on
> qemu with versatilepb machine emulation, but as I told fails to run
> on real hardware S3C2440 CPU - 920T target.

I have not tested on real hardware, so I can't say. There might be
remaining issues.

However, there is quite a big difference between your S3C2440 real
hardware and the Qemu versatilepb emulation. S3C2440 is based on 920T
as you say, which supports the ARMv4T ISA. But the versatilepb
emulation of Qemu emulates an ARM926EJ-S CPU, which supports the
ARMv5TEJ ISA. And as far as I understood, there are some differences in
the ARM <-> Thumb switch capabilities between ARMv4T and ARMv5T.

For what exact CPU did you configure your buildroot ? What was the
exact instruction causing the "Illegal instruction" exception ?

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buildroot-config-with-interworking-and-thumb-applications
Type: application/octet-stream
Size: 9648 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080314/2a9ee424/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080314/2a9ee424/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-14  8:03 ` Thomas Petazzoni
@ 2008-03-14 13:33   ` Ivan Kuten
  2008-03-14 13:19     ` Thomas Petazzoni
  2008-03-19 16:16   ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Ivan Kuten @ 2008-03-14 13:33 UTC (permalink / raw)
  To: buildroot

Thomas Petazzoni wrote:
> Hi,
> 
> Any comments on that ? Are you interested in merging such a patch ?
> 
> Thanks,
> 
> Thomas
> 

Hi Thomas!

Thanks for your excellent work! Before committing your patch I have a question:
have you tested it? on which CPU? which buildroot configs?
I'm asking this because for almost half of year I did not managed to build a good ARM EABI toolchain with buildroot.
Toolchain seems emit invalid instructions when building busybox. So I managed only to run
 very simple hello-world when set in cmdline init=hello-world, but not a busybox binary with shell, etc.
Boot process just hangs when busybox running. Magic-SysRq key shows that illegal instruction trap was involved.
What is surprising that rootfs can be launched ok on qemu with versatilepb machine emulation, but as I told fails
to run on real hardware S3C2440 CPU - 920T target.

Regards,
Ivan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-14 13:19     ` Thomas Petazzoni
@ 2008-03-14 13:56       ` Thomas Petazzoni
  2008-03-22 11:06         ` Ivan Kuten
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2008-03-14 13:56 UTC (permalink / raw)
  To: buildroot

Le Fri, 14 Mar 2008 14:19:29 +0100,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :

> However, there is quite a big difference between your S3C2440 real
> hardware and the Qemu versatilepb emulation. S3C2440 is based on 920T
> as you say, which supports the ARMv4T ISA. But the versatilepb
> emulation of Qemu emulates an ARM926EJ-S CPU, which supports the
> ARMv5TEJ ISA. And as far as I understood, there are some differences
> in the ARM <-> Thumb switch capabilities between ARMv4T and ARMv5T.

In particular, from the ARM architecture manual:

?
BL (H == 10 and H == 11 forms) is in all T variants.
BLX (H == 01 form) is in T variants of ARMv5 and above.
?

So on your S3C2440, the 'blx' instruction is not supported. And this
instruction can especially be used to do interworking. So if gcc
generated this instruction, it of course will fail with the "illegal
instruction" exception.

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080314/729ea7f3/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-14  8:03 ` Thomas Petazzoni
  2008-03-14 13:33   ` Ivan Kuten
@ 2008-03-19 16:16   ` Thomas Petazzoni
  2008-05-15 12:26     ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2008-03-19 16:16 UTC (permalink / raw)
  To: buildroot

Le Fri, 14 Mar 2008 09:03:31 +0100,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :

> Any comments on that ? Are you interested in merging such a patch ?

Still no interest in this patch ? Is the patch wrong ?

I can work on an improved version if comments are made.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080319/a6424067/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-14 13:56       ` Thomas Petazzoni
@ 2008-03-22 11:06         ` Ivan Kuten
  2008-03-22 12:19           ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Ivan Kuten @ 2008-03-22 11:06 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

I compiled for ARM_920T & EABI & SOFTFLOAT.
I checked busybox binary ( arm-linux-objdump ) - there is no blx instruction.
Seems all these ARM troubles were related to avr32 patches (see recent posts in mailing list) because
yesterday finally I managed to build working rootfs. However busybox binary seems resulted
 in OABI format because when in kernel disable OABI_COMPAT - rootfs does not boot.

BR,
Ivan


> Le Fri, 14 Mar 2008 14:19:29 +0100,
> Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :
>
>> However, there is quite a big difference between your S3C2440 real
>> hardware and the Qemu versatilepb emulation. S3C2440 is based on 920T
>> as you say, which supports the ARMv4T ISA. But the versatilepb
>> emulation of Qemu emulates an ARM926EJ-S CPU, which supports the
>> ARMv5TEJ ISA. And as far as I understood, there are some differences
>> in the ARM <-> Thumb switch capabilities between ARMv4T and ARMv5T.
>
> In particular, from the ARM architecture manual:
>
> ?
> BL (H == 10 and H == 11 forms) is in all T variants.
> BLX (H == 01 form) is in T variants of ARMv5 and above.
> ?
>
> So on your S3C2440, the 'blx' instruction is not supported. And this
> instruction can especially be used to do interworking. So if gcc
> generated this instruction, it of course will fail with the "illegal
> instruction" exception.
>
> Sincerly,
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Free Embedded Linux Training Materials
> on http://free-electrons.com/training
> (More than 1500 pages!)
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-22 11:06         ` Ivan Kuten
@ 2008-03-22 12:19           ` Thomas Petazzoni
  2008-03-23 21:57             ` Ivan Kuten
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2008-03-22 12:19 UTC (permalink / raw)
  To: buildroot

Le Sat, 22 Mar 2008 13:06:58 +0200 (EET),
"Ivan Kuten" <ivan.kuten@promwad.com> a ?crit :

> I compiled for ARM_920T & EABI & SOFTFLOAT.
> I checked busybox binary ( arm-linux-objdump ) - there is no blx
> instruction. Seems all these ARM troubles were related to avr32
> patches (see recent posts in mailing list) because yesterday finally
> I managed to build working rootfs.

Hum, maybe.

> However busybox binary seems resulted in OABI format because when
> in kernel disable OABI_COMPAT - rootfs does not boot.

Do you have CONFIG_EABI=y in your buildroot config file ?

But anyway, do you confirm that my patch works ?

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080322/17173df4/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-22 12:19           ` Thomas Petazzoni
@ 2008-03-23 21:57             ` Ivan Kuten
  0 siblings, 0 replies; 10+ messages in thread
From: Ivan Kuten @ 2008-03-23 21:57 UTC (permalink / raw)
  To: buildroot

Hi,

Sure I had CONFIG_EABI enabled.

I tried to apply your patch - when ucLibc is configured ( BR2_UCLIBC_CONFIG=toolchain/uClibc/uClibc-0.9.29.config )
it is asking Target File Format:
1. FDPIC ELF
2. STATIC FLAT
3. STATIC FLAT (sep-data)
4. SHARED FLAT

What did you choose? If I choose FDPIC ELF I'm getting unrecognized command line option "-mfdpic" - when
arm-linux-gcc is trying to build uClibc.

Regards,
Ivan


>> I compiled for ARM_920T & EABI & SOFTFLOAT.
>> I checked busybox binary ( arm-linux-objdump ) - there is no blx
>> instruction. Seems all these ARM troubles were related to avr32
>> patches (see recent posts in mailing list) because yesterday finally
>> I managed to build working rootfs.
>
> Hum, maybe.
>
>> However busybox binary seems resulted in OABI format because when
>> in kernel disable OABI_COMPAT - rootfs does not boot.
>
> Do you have CONFIG_EABI=y in your buildroot config file ?
>
> But anyway, do you confirm that my patch works ?
>
> Sincerly,
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Free Embedded Linux Training Materials
> on http://free-electrons.com/training
> (More than 1500 pages!)
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture
  2008-03-19 16:16   ` Thomas Petazzoni
@ 2008-05-15 12:26     ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2008-05-15 12:26 UTC (permalink / raw)
  To: buildroot

Le Wed, 19 Mar 2008 17:16:15 +0100,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :

> > Any comments on that ? Are you interested in merging such a patch ?
> 
> Still no interest in this patch ? Is the patch wrong ?

Up again. Initial patch sent two months ago, on March, 12th. Please
tell me something: ?doesn't work, please fix?, ?we don't care about
your stuff, it's useless? or ? works, but we would like this and this
to be improved?.

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20080515/5adb23a2/attachment.pgp 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-15 12:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-12  8:08 [Buildroot] [PATCH] Add thumb support to buildroot for the ARM architecture Thomas Petazzoni
2008-03-14  8:03 ` Thomas Petazzoni
2008-03-14 13:33   ` Ivan Kuten
2008-03-14 13:19     ` Thomas Petazzoni
2008-03-14 13:56       ` Thomas Petazzoni
2008-03-22 11:06         ` Ivan Kuten
2008-03-22 12:19           ` Thomas Petazzoni
2008-03-23 21:57             ` Ivan Kuten
2008-03-19 16:16   ` Thomas Petazzoni
2008-05-15 12:26     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox