Patchwork [8/9] blackfin: set GNU_TARGET_NAME accordingly

login
register
mail settings
Submitter Gustavo Zacarias
Date July 20, 2013, 12:52 p.m.
Message ID <1374324735-2286-9-git-send-email-gustavo@zacarias.com.ar>
Download mbox | patch
Permalink /patch/260448/
State Accepted
Headers show

Comments

Gustavo Zacarias - July 20, 2013, 12:52 p.m.
Blackfin for FDPIC targets uses *-linux-*, however for FLAT targets it
needs *-uclinux-* in order for gcc to build properly.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/Makefile.in | 5 +++++
 1 file changed, 5 insertions(+)
Thomas Petazzoni - July 21, 2013, 3:38 p.m.
Dear Gustavo Zacarias,

On Sat, 20 Jul 2013 09:52:14 -0300, Gustavo Zacarias wrote:

> @@ -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
Gustavo Zacarias - July 21, 2013, 4:32 p.m.
On 07/21/2013 12:38 PM, Thomas Petazzoni wrote:

> 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.
Thomas Petazzoni - July 27, 2013, 2:22 p.m.
Dear Gustavo Zacarias,

On Sat, 20 Jul 2013 09:52:14 -0300, Gustavo Zacarias wrote:
> Blackfin for FDPIC targets uses *-linux-*, however for FLAT targets it

>  # 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

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

Patch

diff --git a/package/Makefile.in b/package/Makefile.in
index a23eb41..acbc453 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -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