Skip to contentSkip to conversation

Pull request for branch fix-gcc-on-target

GIT PULL New Thomas Petazzoni 3 participants 7 messages Jul 27, 2010

lore
Share & tools
lore
#0 lore raw

Hello,

Here are a few patches concerning target-gcc. One of them is a build fix (issue reported by rfs on IRC), the other ones are minor improvements.

Thomas

The following changes since commit e475cf0309f11078202ade5019fcf49f58a60eed:
Thomas Petazzoni (1):
Deprecate pcmcia and microwin packages

are available in the git repository at:

git://git.busybox.net/~tpetazzoni/git/buildroot fix-gcc-on-target

Thomas Petazzoni (4):
target-gcc: Get rid of TARGET_GCC_FLAGS
target-gcc: fix build
target-gcc: no need to strip binaries, remove .la files and doc
target-gcc: remove useless copies of gcc

 toolchain/gcc/Makefile.in       |    5 -----
 toolchain/gcc/gcc-uclibc-4.x.mk |   19 +++++++++----------
 2 files changed, 9 insertions(+), 15 deletions(-)

Thanks,

Signature · 1 line
Thomas Petazzoni
#1 lore raw

PATCH 1/4 target-gcc: Get rid of TARGET_GCC_FLAGS

This variable is used only once, so let's just hardcode its value at its call site.

---
 toolchain/gcc/Makefile.in       |    5 -----
 toolchain/gcc/gcc-uclibc-4.x.mk |    5 ++++-
 2 files changed, 4 insertions(+), 6 deletions(-)
toolchain/gcc/Makefile.in +0 -5
index 0dcd803..4278bdb 100644
@@ -50,11 +50,6 @@ EXTRA_GCC_CONFIG_OPTIONS+=--with-build-time-tools=$(STAGING_DIR)/$(REAL_GNU_TARG
 #EXTRA_GCC_CONFIG_OPTIONS+=--with-as=$(TARGET_CROSS)as
 endif
 
-TARGET_GCC_FLAGS= CFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
-	CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
-	CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
-	BOOT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)"
-
 ifeq ($(BR2_PACKAGE_GCC_TARGET),y)
 EXTRA_TARGET_GCC_CONFIG_OPTIONS:=
 
toolchain/gcc/gcc-uclibc-4.x.mk +4 -1
index 081e906..cfbe616 100644
@@ -393,7 +393,10 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.prepared
 	(cd $(GCC_BUILD_DIR3); rm -rf config.cache; \
 		$(TARGET_CONFIGURE_OPTS) \
 		$(TARGET_CONFIGURE_ARGS) \
-		$(TARGET_GCC_FLAGS) \
+		CFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
+		CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
+		CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
+		BOOT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
 		$(GCC_SRC_DIR)/configure $(QUIET) \
 		--prefix=/usr \
 		--build=$(GNU_HOST_NAME) \
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/4 target-gcc: fix build

In reply to Thomas Petazzoni

Now that $(STAGING_DIR)/usr/bin is no longer in the PATH, we need to pass the absolute paths to $(TARGET_CC) when building the target gcc compiler.

This commit fixes the target gcc build problem reported on the list. I have successfully been able to build a target gcc for ARM, use it to compile a hello world application on the target and run this application.

---
 toolchain/gcc/gcc-uclibc-4.x.mk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
toolchain/gcc/gcc-uclibc-4.x.mk +2 -0
index cfbe616..52b20e9 100644
@@ -397,6 +397,8 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.prepared
 		CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
 		CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
 		BOOT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
+		GCC_FOR_TARGET="$(TARGET_CC)" \
+		CC_FOR_TARGET="$(TARGET_CC)" \
 		$(GCC_SRC_DIR)/configure $(QUIET) \
 		--prefix=/usr \
 		--build=$(GNU_HOST_NAME) \
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 2/4 target-gcc: fix build

Quoted 11 lines · On Tuesday 27 July 2010 20:18:59 Thomas Petazzoni wrote:

Now that $(STAGING_DIR)/usr/bin is no longer in the PATH, we need to pass the absolute paths to $(TARGET_CC) when building the target gcc compiler.

This commit fixes the target gcc build problem reported on the list. I have successfully been able to build a target gcc for ARM, use it to compile a hello world application on the target and run this application.

Quoted 17 lines
---
 toolchain/gcc/gcc-uclibc-4.x.mk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
toolchain/gcc/gcc-uclibc-4.x.mk +2 -0
index cfbe616..52b20e9 100644
@@ -397,6 +397,8 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.prepared
 		CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
 		CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
 		BOOT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
+		GCC_FOR_TARGET="$(TARGET_CC)" \
+		CC_FOR_TARGET="$(TARGET_CC)" \
 		$(GCC_SRC_DIR)/configure $(QUIET) \
 		--prefix=/usr \
 		--build=$(GNU_HOST_NAME) \
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 3/4 target-gcc: no need to strip binaries, remove .la files and doc

In reply to Thomas Petazzoni

This is done in a global way by the target-finalize target of the main Makefile.

---
 toolchain/gcc/gcc-uclibc-4.x.mk |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
toolchain/gcc/gcc-uclibc-4.x.mk +0 -9
index 52b20e9..5dec86c 100644
@@ -445,15 +445,6 @@ $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
 	# Remove broken specs file (cross compile flag is set).
 	rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs
 
-	-(cd $(TARGET_DIR)/bin && find -type f | xargs $(STRIPCMD) > /dev/null 2>&1)
-	-(cd $(TARGET_DIR)/usr/bin && find -type f | xargs $(STRIPCMD) > /dev/null 2>&1)
-	-(cd $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR) && $(STRIPCMD) cc1 cc1plus collect2 > /dev/null 2>&1)
-	-(cd $(TARGET_DIR)/usr/lib && $(STRIPCMD) libstdc++.so.*.*.* > /dev/null 2>&1)
-	-(cd $(TARGET_DIR)/lib && $(STRIPCMD) libgcc_s*.so.*.*.* > /dev/null 2>&1)
-	#
-	rm -f $(TARGET_DIR)/usr/lib/*.la*
-	#rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-	#	$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
 	# Work around problem of missing syslimits.h
 	if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h ]; then \
 		echo "warning: working around missing syslimits.h"; \
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH 4/4 target-gcc: remove useless copies of gcc

In reply to Thomas Petazzoni

When doing the "make install" of target, three identical copies of gcc are installed in $(TARGET_DIR)/usr/bin:

  039adcc582c365f12ba6fc5f96098128  arm-unknown-linux-uclibcgnueabi-gcc
  039adcc582c365f12ba6fc5f96098128  arm-unknown-linux-uclibcgnueabi-gcc-4.3.5
  039adcc582c365f12ba6fc5f96098128  gcc

This patch removes the first two copies and keeps only the common "gcc" one.

---
 toolchain/gcc/gcc-uclibc-4.x.mk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
toolchain/gcc/gcc-uclibc-4.x.mk +3 -0
index 5dec86c..9720ed3 100644
@@ -445,6 +445,9 @@ $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
 	# Remove broken specs file (cross compile flag is set).
 	rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs
 
+	# Remove useless copies of gcc
+	rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc*
+
 	# Work around problem of missing syslimits.h
 	if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h ]; then \
 		echo "warning: working around missing syslimits.h"; \
Signature · 1 line
1.7.0.4
#6 lore raw
In reply to Thomas Petazzoni
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Hello,
Thomas> Here are a few patches concerning target-gcc. One of them is a build Thomas> fix (issue reported by rfs on IRC), the other ones are minor Thomas> improvements.

Committed, thanks!

Signature · 1 line
Bye, Peter Korsgaard