Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1)
@ 2013-07-19 13:06 Gustavo Zacarias
  2013-07-19 13:06 ` [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode Gustavo Zacarias
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2013-07-19 13:06 UTC (permalink / raw)
  To: buildroot

libmudflap doesn't build for a thumb(1) toolchain so disable it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/gcc/gcc.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index c0d821b..85cd7d4 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -194,6 +194,11 @@ ifeq ($(BR2_avr32),y)
 HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap
 endif

+# ARM Thumb and mudflap aren't friends
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
+HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap
+endif
+
 # Disable mudflap and enable proper double/long double for SPE ABI
 ifeq ($(BR2_powerpc_SPE),y)
 HOST_GCC_COMMON_CONF_OPT += \
--
1.8.1.5

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

* [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode
  2013-07-19 13:06 [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Gustavo Zacarias
@ 2013-07-19 13:06 ` Gustavo Zacarias
  2013-07-19 22:07   ` Peter Korsgaard
  2013-07-19 13:06 ` [Buildroot] [PATCHv2 3/3] uclibc/arm: doesn't build in thumb(1) mode with threads Gustavo Zacarias
  2013-07-19 22:07 ` [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Peter Korsgaard
  2 siblings, 1 reply; 7+ messages in thread
From: Gustavo Zacarias @ 2013-07-19 13:06 UTC (permalink / raw)
  To: buildroot

It runs out of registers, so build it in ARM mode, EABI mandates
interworking so this isn't an issue.
Tested in an arm920t board.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/eglibc/eglibc.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/eglibc/eglibc.mk b/package/eglibc/eglibc.mk
index 5431ac5..253dabd 100644
--- a/package/eglibc/eglibc.mk
+++ b/package/eglibc/eglibc.mk
@@ -23,6 +23,11 @@ EGLIBC_INSTALL_STAGING = YES

 EGLIBC_INSTALL_STAGING_OPT = install_root=$(STAGING_DIR) install

+# Thumb build is broken, build in ARM mode
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
+EGLIBC_EXTRA_CFLAGS += -marm
+endif
+
 # Even though we use the autotools-package infrastructure, we have to
 # override the default configure commands for several reasons:
 #
@@ -36,7 +41,8 @@ define EGLIBC_CONFIGURE_CMDS
 	# Do the configuration
 	(cd $(@D)/build; \
 		$(TARGET_CONFIGURE_OPTS) \
-		CFLAGS="-O2" CPPFLAGS="" CXXFLAGS="-O2" \
+		CFLAGS="-O2 $(EGLIBC_EXTRA_CFLAGS)" CPPFLAGS="" \
+		CXXFLAGS="-O2 $(EGLIBC_EXTRA_CFLAGS)" \
 		$(SHELL) $(@D)/libc/configure \
 		ac_cv_path_BASH_SHELL=/bin/bash \
 		libc_cv_forced_unwind=yes \
--
1.8.1.5

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

* [Buildroot] [PATCHv2 3/3] uclibc/arm: doesn't build in thumb(1) mode with threads
  2013-07-19 13:06 [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Gustavo Zacarias
  2013-07-19 13:06 ` [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode Gustavo Zacarias
@ 2013-07-19 13:06 ` Gustavo Zacarias
  2013-07-19 22:07 ` [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2013-07-19 13:06 UTC (permalink / raw)
  To: buildroot

It runs out of registers, it fails even in official form
(COMPILE_IN_THUMB_MODE=y) so just build it in ARM mode since EABI
mandates interworking.
Tested in an arm920t board.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/uclibc/Config.in | 2 +-
 package/uclibc/uclibc.mk | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
index 8d16e8c..90aae90 100644
--- a/package/uclibc/Config.in
+++ b/package/uclibc/Config.in
@@ -185,7 +185,7 @@ config BR2_UCLIBC_ARM_TYPE
 config BR2_UCLIBC_ARM_BX
 	bool
 	depends on BR2_UCLIBC_TARGET_ARCH = "arm"
-	default y if !BR2_fa265 && !BR2_strongarm
+	default y if (BR2_ARM_CPU_HAS_THUMB || BR2_ARM_CPU_HAS_THUMB2)

 config BR2_UCLIBC_MIPS_ABI
 	string
diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index 0c76c3f..cf53280 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -74,6 +74,11 @@ define UCLIBC_ARM_ABI_CONFIG
 	$(call UCLIBC_OPT_SET,CONFIG_ARM_EABI,y,$(@D))
 endef

+# Thumb build is broken with threads, build in ARM mode
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
+UCLIBC_EXTRA_CFLAGS += -marm
+endif
+
 ifeq ($(BR2_UCLIBC_ARM_BX),y)
 define UCLIBC_ARM_BX_CONFIG
 	$(call UCLIBC_OPT_SET,USE_BX,y,$(@D))
@@ -354,7 +359,7 @@ endif
 UCLIBC_MAKE_FLAGS = \
 	ARCH="$(UCLIBC_TARGET_ARCH)" \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	UCLIBC_EXTRA_CFLAGS="$(TARGET_ABI)" \
+	UCLIBC_EXTRA_CFLAGS="$(UCLIBC_EXTRA_CFLAGS) $(TARGET_ABI)" \
 	HOSTCC="$(HOSTCC)"

 define UCLIBC_SETUP_DOT_CONFIG
--
1.8.1.5

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

* [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1)
  2013-07-19 13:06 [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Gustavo Zacarias
  2013-07-19 13:06 ` [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode Gustavo Zacarias
  2013-07-19 13:06 ` [Buildroot] [PATCHv2 3/3] uclibc/arm: doesn't build in thumb(1) mode with threads Gustavo Zacarias
@ 2013-07-19 22:07 ` Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2013-07-19 22:07 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 Gustavo> libmudflap doesn't build for a thumb(1) toolchain so disable it.
 Gustavo> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Committed series, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode
  2013-07-19 13:06 ` [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode Gustavo Zacarias
@ 2013-07-19 22:07   ` Peter Korsgaard
  2013-07-21 15:24     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2013-07-19 22:07 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 Gustavo> It runs out of registers, so build it in ARM mode, EABI mandates
 Gustavo> interworking so this isn't an issue.
 Gustavo> Tested in an arm920t board.

 Gustavo> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 Gustavo> ---
 Gustavo>  package/eglibc/eglibc.mk | 8 +++++++-
 Gustavo>  1 file changed, 7 insertions(+), 1 deletion(-)

 Gustavo> diff --git a/package/eglibc/eglibc.mk b/package/eglibc/eglibc.mk
 Gustavo> index 5431ac5..253dabd 100644
 Gustavo> --- a/package/eglibc/eglibc.mk
 Gustavo> +++ b/package/eglibc/eglibc.mk
 Gustavo> @@ -23,6 +23,11 @@ EGLIBC_INSTALL_STAGING = YES

 Gustavo>  EGLIBC_INSTALL_STAGING_OPT = install_root=$(STAGING_DIR) install

 Gustavo> +# Thumb build is broken, build in ARM mode
 Gustavo> +ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
 Gustavo> +EGLIBC_EXTRA_CFLAGS += -marm
 Gustavo> +endif
 Gustavo> +
 Gustavo>  # Even though we use the autotools-package infrastructure, we have to
 Gustavo>  # override the default configure commands for several reasons:
 Gustavo>  #
 Gustavo> @@ -36,7 +41,8 @@ define EGLIBC_CONFIGURE_CMDS
 Gustavo>  	# Do the configuration
 Gustavo>  	(cd $(@D)/build; \
 Gustavo>  		$(TARGET_CONFIGURE_OPTS) \
 Gustavo> -		CFLAGS="-O2" CPPFLAGS="" CXXFLAGS="-O2" \
 Gustavo> +		CFLAGS="-O2 $(EGLIBC_EXTRA_CFLAGS)" CPPFLAGS="" \

I know you didn't add this, but why are we forcing -O2 here? Thomas?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode
  2013-07-19 22:07   ` Peter Korsgaard
@ 2013-07-21 15:24     ` Thomas Petazzoni
  2013-07-21 16:06       ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2013-07-21 15:24 UTC (permalink / raw)
  To: buildroot

Dear Peter Korsgaard,

On Sat, 20 Jul 2013 00:07:59 +0200, Peter Korsgaard wrote:

>  Gustavo> @@ -36,7 +41,8 @@ define EGLIBC_CONFIGURE_CMDS
>  Gustavo>  	# Do the configuration
>  Gustavo>  	(cd $(@D)/build; \
>  Gustavo>  		$(TARGET_CONFIGURE_OPTS) \
>  Gustavo> -		CFLAGS="-O2" CPPFLAGS="" CXXFLAGS="-O2" \
>  Gustavo> +		CFLAGS="-O2 $(EGLIBC_EXTRA_CFLAGS)" CPPFLAGS="" \
> 
> I know you didn't add this, but why are we forcing -O2 here? Thomas?

Because eglibc must be built with optimizations. See
http://patches.openembedded.org/patch/38849/ for example.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode
  2013-07-21 15:24     ` Thomas Petazzoni
@ 2013-07-21 16:06       ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2013-07-21 16:06 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> I know you didn't add this, but why are we forcing -O2 here? Thomas?

 Thomas> Because eglibc must be built with optimizations. See
 Thomas> http://patches.openembedded.org/patch/38849/ for example.

Ok, thanks. A small note about this would be good so it doesn't get
removed in future "cleanups".

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2013-07-21 16:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-19 13:06 [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Gustavo Zacarias
2013-07-19 13:06 ` [Buildroot] [PATCHv2 2/3] eglibc/arm: doesn't build in thumb(1) mode Gustavo Zacarias
2013-07-19 22:07   ` Peter Korsgaard
2013-07-21 15:24     ` Thomas Petazzoni
2013-07-21 16:06       ` Peter Korsgaard
2013-07-19 13:06 ` [Buildroot] [PATCHv2 3/3] uclibc/arm: doesn't build in thumb(1) mode with threads Gustavo Zacarias
2013-07-19 22:07 ` [Buildroot] [PATCHv2 1/3] gcc/arm: disable mudflap for thumb(1) Peter Korsgaard

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