Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check
@ 2014-01-14  8:21 Stefan Sørensen
  2014-01-14  8:21 ` [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf Stefan Sørensen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stefan Sørensen @ 2014-01-14  8:21 UTC (permalink / raw)
  To: buildroot

Currently the check for EABI/EABIhf toolchains looks for the
Tag_ABI_VFP_args attribute in the crt1.o file which gcc adds
in a EABIhw toolchain. The crt1.o is however often not compiled
from c but assembler, and will then always failt he EABIhf check.

Fix by compiling a temporary .c file and checking for the
attribute.

Signed-off-by: Stefan S?rensen <stefan.sorensen@spectralink.com>
---
 toolchain/helpers.mk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index faa9d90..0accb7b 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -284,12 +284,15 @@ check_arm_abi = \
 		echo "External toolchain uses the unsuported OABI" ; \
 		exit 1 ; \
 	fi ; \
-	EXT_TOOLCHAIN_CRT1=`LANG=C $${__CROSS_CC} -print-file-name=crt1.o` ; \
-	if $${__CROSS_READELF} -A $${EXT_TOOLCHAIN_CRT1} | grep -q "Tag_ABI_VFP_args:" ; then \
+	TEMP_C_FILE=`mktemp --tmpdir --suffix=.c`; \
+	touch $${TEMP_C_FILE}; \
+	$${__CROSS_CC} -c -o $${TEMP_C_FILE}.o $${TEMP_C_FILE}; \
+	if $${__CROSS_READELF} -A $${TEMP_C_FILE}.o | grep -q "Tag_ABI_VFP_args:" ; then \
 		EXT_TOOLCHAIN_ABI="eabihf" ; \
 	else \
 		EXT_TOOLCHAIN_ABI="eabi" ; \
 	fi ; \
+	rm -f $${TEMP_C_FILE} $${TEMP_C_FILE}.o; \
 	if [ "$(BR2_ARM_EABI)" = "y" -a "$${EXT_TOOLCHAIN_ABI}" = "eabihf" ] ; then \
 		echo "Incorrect ABI setting: EABI selected, but toolchain uses EABIhf" ; \
 		exit 1 ; \
-- 
1.8.4.2

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

* [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf.
  2014-01-14  8:21 [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Stefan Sørensen
@ 2014-01-14  8:21 ` Stefan Sørensen
  2014-01-15 21:52   ` Peter Korsgaard
  2014-01-14  8:21 ` [Buildroot] [PATCH 3/3] protobuf-c: Don't require protobuf on target Stefan Sørensen
  2014-01-28 21:57 ` [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Thomas Petazzoni
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Sørensen @ 2014-01-14  8:21 UTC (permalink / raw)
  To: buildroot

Currently ld-linux-armhf.so.* is added to external libs when
using an EABIhf toolchain, but this naming is not used by uClibc.
Fix by adding a check for glibc.

Signed-off-by: Stefan S?rensen <stefan.sorensen@spectralink.com>
---
 toolchain/toolchain-external/toolchain-external.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 1084ee2..a7bfafc 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -63,7 +63,7 @@
 
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
 LIB_EXTERNAL_LIBS+=libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.*
-ifeq ($(BR2_ARM_EABIHF),y)
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_ARM_EABIHF),yy)
 LIB_EXTERNAL_LIBS+=ld-linux-armhf.so.*
 else
 LIB_EXTERNAL_LIBS+=ld*.so.*
-- 
1.8.4.2

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

* [Buildroot] [PATCH 3/3] protobuf-c: Don't require protobuf on target.
  2014-01-14  8:21 [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Stefan Sørensen
  2014-01-14  8:21 ` [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf Stefan Sørensen
@ 2014-01-14  8:21 ` Stefan Sørensen
  2014-01-15 21:24   ` Peter Korsgaard
  2014-01-28 21:57 ` [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Thomas Petazzoni
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Sørensen @ 2014-01-14  8:21 UTC (permalink / raw)
  To: buildroot

protobuf-c only requires protobuf when building the protoc compiler,
hence protobuf can be dropped from the target dependencies.

Signed-off-by: Stefan S?rensen <stefan.sorensen@spectralink.com>
---
 package/protobuf-c/Config.in     | 1 -
 package/protobuf-c/protobuf-c.mk | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/protobuf-c/Config.in b/package/protobuf-c/Config.in
index 3baa05e..732befc 100644
--- a/package/protobuf-c/Config.in
+++ b/package/protobuf-c/Config.in
@@ -2,7 +2,6 @@ config BR2_PACKAGE_PROTOBUF_C
 	bool "protobuf-c"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf
-	select BR2_PACKAGE_PROTOBUF
 	help
 	  Code generator and runtime libraries to use Protocol Buffers
 	  from pure C (not C++).
diff --git a/package/protobuf-c/protobuf-c.mk b/package/protobuf-c/protobuf-c.mk
index 271f6d8..42f592b 100644
--- a/package/protobuf-c/protobuf-c.mk
+++ b/package/protobuf-c/protobuf-c.mk
@@ -6,7 +6,7 @@
 
 PROTOBUF_C_VERSION = 0.15
 PROTOBUF_C_SITE = http://protobuf-c.googlecode.com/files
-PROTOBUF_C_DEPENDENCIES = protobuf host-protobuf-c
+PROTOBUF_C_DEPENDENCIES = host-protobuf-c
 HOST_PROTOBUF_C_DEPENDENCIES = host-protobuf
 PROTOBUF_C_MAKE = $(MAKE1)
 PROTOBUF_C_CONF_OPT = --disable-protoc
-- 
1.8.4.2

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

* [Buildroot] [PATCH 3/3] protobuf-c: Don't require protobuf on target.
  2014-01-14  8:21 ` [Buildroot] [PATCH 3/3] protobuf-c: Don't require protobuf on target Stefan Sørensen
@ 2014-01-15 21:24   ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-01-15 21:24 UTC (permalink / raw)
  To: buildroot

>>>>> "Stefan" == Stefan S?rensen <stefan.sorensen@spectralink.com> writes:

 > protobuf-c only requires protobuf when building the protoc compiler,
 > hence protobuf can be dropped from the target dependencies.

 > Signed-off-by: Stefan S?rensen <stefan.sorensen@spectralink.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf.
  2014-01-14  8:21 ` [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf Stefan Sørensen
@ 2014-01-15 21:52   ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-01-15 21:52 UTC (permalink / raw)
  To: buildroot

>>>>> "Stefan" == Stefan S?rensen <stefan.sorensen@spectralink.com> writes:

 > Currently ld-linux-armhf.so.* is added to external libs when
 > using an EABIhf toolchain, but this naming is not used by uClibc.
 > Fix by adding a check for glibc.

 > Signed-off-by: Stefan S?rensen <stefan.sorensen@spectralink.com>
 > ---

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check
  2014-01-14  8:21 [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Stefan Sørensen
  2014-01-14  8:21 ` [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf Stefan Sørensen
  2014-01-14  8:21 ` [Buildroot] [PATCH 3/3] protobuf-c: Don't require protobuf on target Stefan Sørensen
@ 2014-01-28 21:57 ` Thomas Petazzoni
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 21:57 UTC (permalink / raw)
  To: buildroot

Dear Stefan S?rensen,

On Tue, 14 Jan 2014 09:21:34 +0100, Stefan S?rensen wrote:
> Currently the check for EABI/EABIhf toolchains looks for the
> Tag_ABI_VFP_args attribute in the crt1.o file which gcc adds
> in a EABIhw toolchain. The crt1.o is however often not compiled
> from c but assembler, and will then always failt he EABIhf check.

Do you have details about this? Because the crt1.o trick was actually
tested by me on several toolchains, and it was indeed working.

> +	TEMP_C_FILE=`mktemp --tmpdir --suffix=.c`; \
> +	touch $${TEMP_C_FILE}; \
> +	$${__CROSS_CC} -c -o $${TEMP_C_FILE}.o $${TEMP_C_FILE}; \

If all you need is build an empty source file, then you do not even
need to create a temporary .c file:

	gcc -x c -c -o toto.o /dev/null

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2014-01-28 21:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14  8:21 [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Stefan Sørensen
2014-01-14  8:21 ` [Buildroot] [PATCH 2/3] toolchain-external: Fix ld.so naming with uClibc and EABIhf Stefan Sørensen
2014-01-15 21:52   ` Peter Korsgaard
2014-01-14  8:21 ` [Buildroot] [PATCH 3/3] protobuf-c: Don't require protobuf on target Stefan Sørensen
2014-01-15 21:24   ` Peter Korsgaard
2014-01-28 21:57 ` [Buildroot] [PATCH 1/3] toolchain-external: Fix EABIhf check Thomas Petazzoni

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