Fix internal blackfin toolchain
cover Fix internal blackfin toolchain
This patchset fixes the internal blackfin toolchain build. It's been broken for ages (never worked maybe?)
Testers wanted, it builds what's supposed to build but i lack hardware to see if it really works.
Gustavo Zacarias (9):
gcc/bfin: doesn't support --with-cpu defaults uclibc/bfin: only supports linuxthreads.old
uclibc: make target utils optional
gcc/bfin: 4.{6,7,8}.x are broken
uclibc: use builtin startfiles target uclibc/bfin: set the appropiate binfmt in the configuration uclibc/bfin: don't install host utils if not FDPIC
blackfin: set GNU_TARGET_NAME accordingly gcc/mudflap: disable for blackfin, it doesn't build
package/Makefile.in | 5 +++ package/gcc/Config.in.host | 7 +++-- package/gcc/gcc.mk | 8 +++++ package/uclibc/Config.in | 15 ++++++++- package/uclibc/uclibc.mk | 76 ++++++++++++++++++++++++++++++++++++++-------- 5 files changed, 95 insertions(+), 16 deletions(-)
--
1.8.1.5
PATCH 1/9 gcc/bfin: doesn't support --with-cpu defaults
--- package/gcc/gcc.mk | 3 +++ 1 file changed, 3 insertions(+)
package/gcc/gcc.mk +3 -0
@@ -159,6 +159,8 @@ endif ifneq ($(call qstrip,$(BR2_GCC_TARGET_ABI)),) HOST_GCC_COMMON_CONF_OPT += --with-abi=$(BR2_GCC_TARGET_ABI) endif +# GCC doesn't support --with-cpu for bfin +ifeq ($(BR2_bfin),) ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),) ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),) HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
@@ -166,6 +168,7 @@ else HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)) endif endif +endif GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU)) ifneq ($(GCC_TARGET_FPU),)
Signature · 1 line
1.8.1.5
PATCH 1/9 gcc/bfin: doesn't support --with-cpu defaults
Dear Gustavo Zacarias,
package/gcc/gcc.mk else · line 171
Quoted 12 lines · Gustavo Zacarias
Signed-off-by Gustavo Zacarias <[email protected]>package/gcc/gcc.mk +3
-0+# GCC doesn't support --with-cpu for bfin +ifeq ($(BR2_bfin),) ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),) ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),) HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))@@ -166,6 +168,7 @@ else HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU)) endif endif +endif
This looks odd because the BR2_GCC_TARGET_CPU_REVISION thing was added by Sonic Zhang, see 66d41890ec2b76189bcd427a0cc3966ff56f9712. So it is specifically useful on Blackfin. Maybe just with Analog Devices toolchains, I don't know. But clearly, removing that for Blackfin seems wrong.
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/9 gcc/bfin: doesn't support --with-cpu defaults
Quoted 5 lines · Thomas Petazzoni
This looks odd because the
BR2_GCC_TARGET_CPU_REVISIONthing was added by Sonic Zhang, see66d41890ec2b76189bcd427a0cc3966ff56f9712. So it is specifically useful on Blackfin. Maybe just with Analog Devices toolchains, I don't know. But clearly, removing that for Blackfin seems wrong.
Exactly, with their twisted toolchains, snip without it:
checking for clock_t... yes
checking for .preinit_array/.init_array/.fini_array support... yes checking if mkdir takes one argument... no
This target does not support --with-cpu.
Valid --with options are:
make[1]: *** [configure-gcc] Error 1
make[1]: Leaving directory `/home/gustavoz/b/fin/output/build/host-gcc-initial-4.5.4/build'
make: *** [/home/gustavoz/b/fin/output/build/host-gcc-initial-4.5.4/.stamp_built] Error 2
Regards.
PATCH 2/9 uclibc/bfin: only supports linuxthreads.old
In reply to Gustavo Zacarias--- package/uclibc/Config.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
package/uclibc/Config.in +3 -1
@@ -104,6 +104,7 @@ choice config BR2_PTHREADS bool "linuxthreads" + depends on !BR2_bfin depends on !BR2_xtensa select BR2_TOOLCHAIN_HAS_THREADS
@@ -115,9 +116,10 @@ choice bool "Native POSIX Threading (NPTL)" select BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_x86_i386 + depends on !BR2_arc depends on !BR2_avr32 + depends on !BR2_bfin depends on !BR2_xtensa - depends on !BR2_arc endchoice config BR2_PTHREAD_DEBUG
Signature · 1 line
1.8.1.5
PATCH 2/9 uclibc/bfin: only supports linuxthreads.old
Gustavo, All,
On 2013-07-20 09:52 -0300, Gustavo Zacarias spake thusly:
Quoted 18 lines
Signed-off-by Gustavo Zacarias <[email protected]>--- package/uclibc/Config.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)package/uclibc/Config.in +1
-0@@ -104,6 +104,7 @@ choice config BR2_PTHREADS bool "linuxthreads" + depends on !BR2_bfin depends on !BR2_xtensa select BR2_TOOLCHAIN_HAS_THREADS
package/uclibc/Config.in choice · line 120
Quoted 8 lines
package/uclibc/Config.in +2
-1@@ -115,9 +116,10 @@ choice bool "Native POSIX Threading (NPTL)" select BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_x86_i386 + depends on !BR2_arc depends on !BR2_avr32 + depends on !BR2_bfin depends on !BR2_xtensa - depends on !BR2_arc
While at re-ordering, you could have also reorderd x86_i386. Note this in the commit log, such as:
trivial options re-rodering at the same time.
Although I would prefer you not mix cosmetics with actual changes.
Regards,
Yann E. MORIN.
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. | '------------------------------^-------^------------------^--------------------'
PATCH 2/9 uclibc/bfin: only supports linuxthreads.old
In reply to Gustavo ZacariasDear Gustavo Zacarias,
Quoted 18 lines · Gustavo Zacarias
Signed-off-by Gustavo Zacarias <[email protected]>--- package/uclibc/Config.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)package/uclibc/Config.in +1
-0@@ -104,6 +104,7 @@ choice config BR2_PTHREADS bool "linuxthreads" + depends on !BR2_bfin depends on !BR2_xtensa select BR2_TOOLCHAIN_HAS_THREADS
package/uclibc/Config.in choice · line 123
Quoted 9 lines
package/uclibc/Config.in +2
-1@@ -115,9 +116,10 @@ choice bool "Native POSIX Threading (NPTL)" select BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_x86_i386 + depends on !BR2_arc depends on !BR2_avr32 + depends on !BR2_bfin depends on !BR2_xtensa - depends on !BR2_arc endchoice
As suggested by Yann, I've splitted this in two patches, one adding the !bfin dependency, another one doing the re-ordering, including x86_i386.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 3/9 uclibc: make target utils optional
In reply to Gustavo ZacariasThese are broken for blackfin unfortunately so they're disabled.
--- package/uclibc/Config.in | 11 +++++++++++ package/uclibc/uclibc.mk | 16 +++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-)
package/uclibc/Config.in +11 -0
@@ -129,6 +129,17 @@ config BR2_PTHREAD_DEBUG help Build the thread library with debugging enabled. +config BR2_UCLIBC_INSTALL_UTILS + bool "Compile and install uClibc utilities" + depends on !BR2_bfin + default y + help + Enabling this option will compile and install the getconf, + ldconfig and ldd uClibc utilities for the target. + + You can save ~32 KiB in target space by disabling them since + they're normally not needed. + config BR2_UCLIBC_INSTALL_TEST_SUITE bool "Compile and install uClibc tests" select BR2_PACKAGE_MAKE
package/uclibc/uclibc.mk +11 -5
@@ -451,6 +451,16 @@ define UCLIBC_INSTALL_TEST_SUITE endef endif +ifeq ($(BR2_UCLIBC_INSTALL_UTILS),y) +define UCLIBC_INSTALL_UTILS_TARGET + $(MAKE1) -C $(@D) \ + CC="$(TARGET_CC)" CPP="$(TARGET_CPP)" LD="$(TARGET_LD)" \ + ARCH="$(UCLIBC_TARGET_ARCH)" \ + PREFIX=$(TARGET_DIR) \ + utils install_utils +endef +endif + define UCLIBC_INSTALL_TARGET_CMDS $(MAKE1) -C $(@D) \ $(UCLIBC_MAKE_FLAGS) \
@@ -458,11 +468,7 @@ define UCLIBC_INSTALL_TARGET_CMDS DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX=/ \ install_runtime - $(MAKE1) -C $(@D) \ - CC="$(TARGET_CC)" CPP="$(TARGET_CPP)" LD="$(TARGET_LD)" \ - ARCH="$(UCLIBC_TARGET_ARCH)" \ - PREFIX=$(TARGET_DIR) \ - utils install_utils + $(UCLIBC_INSTALL_UTILS_TARGET) $(UCLIBC_INSTALL_TEST_SUITE) endef
Signature · 1 line
1.8.1.5
PATCH 3/9 uclibc: make target utils optional
On 2013-07-20 09:52 -0300, Gustavo Zacarias spake thusly:
Quoted 3 lines
These are broken for blackfin unfortunately so they're disabled.
Signed-off-by Gustavo Zacarias <[email protected]>
BTW, I never know if Acked-by includes Reviewed-by...
Regads,
Yann E. MORIN.
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. | '------------------------------^-------^------------------^--------------------'
PATCH 4/9 gcc/bfin: 4.{6,7,8}.x are broken
In reply to Gustavo Zacarias--- package/gcc/Config.in.host | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
package/gcc/Config.in.host +4 -3
@@ -8,6 +8,7 @@ choice default BR2_GCC_VERSION_4_4_X if BR2_sparc_sparchfleon || BR2_sparc_sparchfleonv8 || BR2_sparc_sparcsfleon || BR2_sparc_sparcsfleonv8 default BR2_GCC_VERSION_4_2_2_AVR32_2_1_5 if BR2_avr32 default BR2_GCC_VERSION_4_8_ARC if BR2_arc + default BR2_GCC_VERSION_4_5_X if BR2_bfin default BR2_GCC_VERSION_4_7_X help Select the version of gcc you wish to use.
@@ -37,17 +38,17 @@ choice bool "gcc 4.5.x" config BR2_GCC_VERSION_4_6_X - depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a7 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4 + depends on !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_cortex_a7 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4 select BR2_GCC_NEEDS_MPC bool "gcc 4.6.x" config BR2_GCC_VERSION_4_7_X - depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4 + depends on !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4 select BR2_GCC_NEEDS_MPC bool "gcc 4.7.x" config BR2_GCC_VERSION_4_8_X - depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 + depends on !BR2_arc && !BR2_avr32 && !BR2_bfin && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 select BR2_GCC_NEEDS_MPC bool "gcc 4.8.x"
Signature · 1 line
1.8.1.5
PATCH 5/9 uclibc: use builtin startfiles target
In reply to Gustavo ZacariasNow that we've dropped 0.9.31.x we can use the startfiles / install_startfiles targets instead of building and installing them by hand.
Fixes internal blackfin toolchain build errors regarding crtreloc.o
--- package/uclibc/uclibc.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
package/uclibc/uclibc.mk +2 -3
@@ -409,13 +409,12 @@ define UCLIBC_CONFIGURE_CMDS PREFIX=$(STAGING_DIR) \ DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX=$(STAGING_DIR) \ - headers lib/crt1.o lib/crti.o lib/crtn.o \ - install_headers + headers startfiles \ + install_headers install_startfiles $(TARGET_CROSS)gcc -nostdlib \ -nostartfiles -shared -x c /dev/null -o $(STAGING_DIR)/usr/lib/libc.so $(TARGET_CROSS)gcc -nostdlib \ -nostartfiles -shared -x c /dev/null -o $(STAGING_DIR)/usr/lib/libm.so - cp -pLR $(UCLIBC_DIR)/lib/crt[1in].o $(STAGING_DIR)/usr/lib/ endef ifeq ($(BR2_UCLIBC_INSTALL_TEST_SUITE),y)
Signature · 1 line
1.8.1.5
PATCH 6/9 uclibc/bfin: set the appropiate binfmt in the configuration
In reply to Gustavo Zacarias--- package/uclibc/uclibc.mk | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
package/uclibc/uclibc.mk +40 -0
@@ -148,6 +148,45 @@ endef endif # powerpc # +# Blackfin definitions +# + +ifeq ($(UCLIBC_TARGET_ARCH),bfin) +ifeq ($(BR2_BINFMT_FDPIC),y) +define UCLIBC_BFIN_CONFIG + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_SHARED_FLAT,$(@D)) + $(call UCLIBC_OPT_SET,UCLIBC_FORMAT_FDPIC_ELF,y,$(@D)) +endef +endif +ifeq ($(BR2_BINFMT_FLAT_ONE),y) +define UCLIBC_BFIN_CONFIG + $(call UCLIBC_OPT_SET,UCLIBC_FORMAT_FLAT,y,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_SHARED_FLAT,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FDPIC_ELF,$(@D)) +endef +endif +ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y) +define UCLIBC_BFIN_CONFIG + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT,$(@D)) + $(call UCLIBC_OPT_SET,UCLIBC_FORMAT_FLAT_SEP_DATA,y,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_SHARED_FLAT,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FDPIC_ELF,$(@D)) +endef +endif +ifeq ($(BR2_BINFMT_FLAT_SHARED),y) +define UCLIBC_BFIN_CONFIG + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)) + $(call UCLIBC_OPT_SET,UCLIBC_FORMAT_SHARED_FLAT,y,$(@D)) + $(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FDPIC_ELF,$(@D)) +endef +endif +endif # bfin + +# # AVR32 definitions #
@@ -380,6 +419,7 @@ define UCLIBC_SETUP_DOT_CONFIG $(UCLIBC_SPARC_TYPE_CONFIG) $(UCLIBC_POWERPC_TYPE_CONFIG) $(UCLIBC_AVR32_CONFIG) + $(UCLIBC_BFIN_CONFIG) $(UCLIBC_X86_TYPE_CONFIG) $(UCLIBC_ENDIAN_CONFIG) $(UCLIBC_LARGEFILE_CONFIG)
Signature · 1 line
1.8.1.5
PATCH 7/9 uclibc/bfin: don't install host utils if not FDPIC
In reply to Gustavo Zacarias--- package/uclibc/uclibc.mk | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
package/uclibc/uclibc.mk +11 -4
@@ -511,6 +511,16 @@ define UCLIBC_INSTALL_TARGET_CMDS $(UCLIBC_INSTALL_TEST_SUITE) endef +# For FLAT binfmts (static) there are no host utils +ifeq ($(BR2_BINFMT_FLAT),) +define UCLIBC_INSTALL_UTILS_STAGING + $(INSTALL) -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/usr/bin/ldd + ln -sf ldd $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldd + $(INSTALL) -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/usr/bin/ldconfig + ln -sf ldconfig $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldconfig +endef +endif + define UCLIBC_INSTALL_STAGING_CMDS $(MAKE1) -C $(@D) \ $(UCLIBC_MAKE_FLAGS) \
@@ -518,10 +528,7 @@ define UCLIBC_INSTALL_STAGING_CMDS DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX=/ \ install_runtime install_dev - install -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/usr/bin/ldd - ln -sf ldd $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldd - install -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/usr/bin/ldconfig - ln -sf ldconfig $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldconfig + $(UCLIBC_INSTALL_UTILS_STAGING) endef uclibc-menuconfig: dirs uclibc-patch
Signature · 1 line
1.8.1.5
PATCH 8/9 blackfin: set GNU_TARGET_NAME accordingly
In reply to Gustavo ZacariasBlackfin for FDPIC targets uses *-linux-*, however for FLAT targets it needs *-uclinux-* in order for gcc to build properly.
--- package/Makefile.in | 5 +++++ 1 file changed, 5 insertions(+)
package/Makefile.in +5 -0
@@ -23,6 +23,11 @@ MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS) # Compute GNU_TARGET_NAME GNU_TARGET_NAME=$(ARCH)-buildroot-linux-$(LIBC)$(ABI) +# Blackfin FLAT needs uclinux +ifeq ($(BR2_bfin)$(BR2_BINFMT_FLAT),yy) +GNU_TARGET_NAME=$(ARCH)-buildroot-uclinux-$(LIBC)$(ABI) +endif + ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) LIBC=uclibc else
Signature · 1 line
1.8.1.5
PATCH 8/9 blackfin: set GNU_TARGET_NAME accordingly
Dear Gustavo Zacarias,
package/Makefile.in MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS) · line 29
Quoted 8 lines · Gustavo Zacarias
package/Makefile.in +4
-0@@ -23,6 +23,11 @@ MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS) # Compute GNU_TARGET_NAME GNU_TARGET_NAME=$(ARCH)-buildroot-linux-$(LIBC)$(ABI) +# Blackfin FLAT needs uclinux +ifeq ($(BR2_bfin)$(BR2_BINFMT_FLAT),yy) +GNU_TARGET_NAME=$(ARCH)-buildroot-uclinux-$(LIBC)$(ABI) +endif
Isn't the 'uclinux' OS part something that is not specific to Blackfin? I.e, should this rather be something like:
ifeq ($(BR2_USE_MMU),y)
OS=linux
else
OS=uclinux
endif
GNU_TARGET_NAME=$(ARCH)-buildroot-$(OS)-$(LIBC)$(ABI)
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 8/9 blackfin: set GNU_TARGET_NAME accordingly
Quoted 8 lines · Thomas Petazzoni
Isn't the 'uclinux' OS part something that is not specific to Blackfin? I.e, should this rather be something like:
ifeq ($(BR2_USE_MMU),y)
OS=linux
else
OS=uclinux
endif
In theory, yes.
For blackfin, doesn't seem so.
Seems (caveat: no access to blackfin.uclinux.org IF it's even documented, bizarre patches and so on) that for blackfin being MMU-less across the whole arch it's used to select from FDPIC and FLAT*. Again going to the source (gcc to be precise) we see that crtreloc.o (for FDPIC targets) is used in gcc/config/bfin/linux.h (linux tuple), and crtlibid (for FLAT targets, internal to gcc) is used in gcc/config/bfin/uclinux.h
crtreloc.o is generated by uClibc only when doing FDPIC, and used by 'linux', and 'uclinux' doesn't do FDPIC (no linking with crtreloc.o) hence FLAT.
Regards.
PATCH 8/9 blackfin: set GNU_TARGET_NAME accordingly
In reply to Gustavo ZacariasDear Gustavo Zacarias,
package/Makefile.in MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS) · line 29
Quoted 9 lines · Gustavo Zacarias
Blackfin for FDPIC targets uses *-linux-*, however for FLAT targets it
# Compute
GNU_TARGET_NAMEGNU_TARGET_NAME=$(ARCH)-buildroot-linux-$(LIBC)$(ABI)package/Makefile.in +4
-0+# Blackfin FLAT needs uclinux +ifeq ($(BR2_bfin)$(BR2_BINFMT_FLAT),yy) +GNU_TARGET_NAME=$(ARCH)-buildroot-uclinux-$(LIBC)$(ABI) +endif
I've changed that to keep a single GNU_TARGET_NAME definition and to use a new TARGET_OS variable, like the existing LIBC and ABI variables we had.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 9/9 gcc/mudflap: disable for blackfin, it doesn't build
In reply to Gustavo Zacarias--- package/gcc/gcc.mk | 5 +++++ 1 file changed, 5 insertions(+)
package/gcc/gcc.mk +5 -0
@@ -202,6 +202,11 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y) HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap endif +# Blackfin doesn't do mudflap +ifeq ($(BR2_bfin),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 += \
Signature · 1 line
1.8.1.5
cover Fix internal blackfin toolchain
In reply to Gustavo ZacariasDear Gustavo Zacarias,
Quoted 5 lines · Gustavo Zacarias
This patchset fixes the internal blackfin toolchain build. It's been broken for ages (never worked maybe?)
Testers wanted, it builds what's supposed to build but i lack hardware to see if it really works.
Quoted 10 lines
Gustavo Zacarias (9):
gcc/bfin: doesn't support --with-cpu defaults uclibc/bfin: only supports linuxthreads.old
uclibc: make target utils optional
gcc/bfin: 4.{6,7,8}.x are broken
uclibc: use builtin startfiles target uclibc/bfin: set the appropiate binfmt in the configuration uclibc/bfin: don't install host utils if not FDPIC
blackfin: setGNU_TARGET_NAMEaccordingly gcc/mudflap: disable for blackfin, it doesn't build
Committed entire series, with the minor fixes I pointed on the individual patches.
Note that when you select FLAT format, it is still ELF binaries that are produced in $(O)/target. Most likely related to our non-working handling of elf2flt, as discussed recently on the list regarding ARM noMMU platforms. So this patch series certainly improves the situation, but doesn't fix the whole thing yet :)
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
cover Fix internal blackfin toolchain
Quoted 8 lines · Thomas Petazzoni
Committed entire series, with the minor fixes I pointed on the individual patches.
Note that when you select FLAT format, it is still ELF binaries that are produced in $(O)/target. Most likely related to our non-working handling of elf2flt, as discussed recently on the list regarding ARM noMMU platforms. So this patch series certainly improves the situation, but doesn't fix the whole thing yet :)
Thanks.
Yes, as i've stated, it's a first patchset/try of fixing things, but most certainly not tested :)
I've been playing a bit with fixing ARM nommu, quick notes say we need to ditch libmudflap, change the tuple (uclinux-eabi & maybe uclinux-elf), make host-elf2flt a hard dep (it's invoked at link time by gcc with the appropiate tuple), probably add the mmu-less cortex processors (M*, R4), and get someone to test the whole thing. I've still didn't get the whole thing to build properly but it's close. Regards.