diff mbox series

[V2,4/9] package/binutils: Add C-SKY support

Message ID 1557305915-11247-4-git-send-email-guoren@kernel.org
State Changes Requested
Headers show
Series [V2,1/9] arch/csky: Add VDSP and FLOAT_ABI compiler options. | expand

Commit Message

Guo Ren May 8, 2019, 8:58 a.m. UTC
From: Guo Ren <ren_guo@c-sky.com>

Add binutils build for C-SKY Architecture.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
---
 package/binutils/Config.in.host | 2 ++
 package/binutils/binutils.hash  | 2 ++
 package/binutils/binutils.mk    | 8 ++++++++
 3 files changed, 12 insertions(+)

Comments

Thomas Petazzoni May 26, 2019, 8:52 p.m. UTC | #1
Hello,

On Wed,  8 May 2019 16:58:30 +0800
guoren@kernel.org wrote:

> +if !BR2_csky
>  choice
>  	prompt "Binutils Version"
>  	default BR2_BINUTILS_VERSION_2_31_X if !BR2_arc
> @@ -32,6 +33,7 @@ config BR2_BINUTILS_VERSION
>  	default "2.30"		if BR2_BINUTILS_VERSION_2_30_X
>  	default "2.31.1"	if BR2_BINUTILS_VERSION_2_31_X
>  	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
> +endif

Let's do it like we do for the ARC architecture: add an option, and the
proper depends on. I.e:

choice
        prompt "Binutils Version"
        default BR2_BINUTILS_VERSION_ARC if BR2_arc
	default BR2_BINUTILS_VERSION_CSKY if BR2_csky
        default BR2_BINUTILS_VERSION_2_31_X
        help
          Select the version of binutils you wish to use.

config BR2_BINUTILS_VERSION_2_30_X
        bool "binutils 2.30"
	depends on !BR2_csky

config BR2_BINUTILS_VERSION_2_31_X
        bool "binutils 2.31.1"
	depends on !BR2_csky

config BR2_BINUTILS_VERSION_2_32_X
        bool "binutils 2.32"
	depends on !BR2_csky

config BR2_BINUTILS_VERSION_ARC
        bool "binutils arc (2.31)"
        depends on BR2_arc

config BR2_BINUTILS_VERSION_CSKY
        bool "binutils csky (2.32)"
        depends on BR2_csky

endchoice

config BR2_BINUTILS_VERSION
        string
	default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY
        default "arc-2019.03-rc1"       if BR2_BINUTILS_VERSION_ARC
        default "2.30"          if BR2_BINUTILS_VERSION_2_30_X
        default "2.31.1"        if BR2_BINUTILS_VERSION_2_31_X
        default "2.32"          if BR2_BINUTILS_VERSION_2_32_X


> diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk
> index c70ba13..cebfd06 100644
> --- a/package/binutils/binutils.mk
> +++ b/package/binutils/binutils.mk
> @@ -20,6 +20,14 @@ BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,
>  BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
>  BINUTILS_FROM_GIT = y
>  endif
> +
> +ifeq ($(BR2_csky),y)
> +BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
> +BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
> +BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
> +BINUTILS_FROM_GIT = y
> +endif

Same here, please follow the same logic as the one used for ARC, for
consistency, i.e:

# Version is set when using buildroot toolchain.
# If not, we do like other packages
BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
ifeq ($(BINUTILS_VERSION),)
ifeq ($(BR2_arc),y)
BINUTILS_VERSION = arc-2019.03-rc1
else ifeq ($(BR2_csky),y)
BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
else
BINUTILS_VERSION = 2.31.1
endif
endif # BINUTILS_VERSION

ifeq ($(BINUTILS_VERSION),arc-2019.03-rc1)
BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
else ifeq ($(BINUTILS_VERSION),c66d8bbcebfddf713b2b436e1b135e6b125a55a5)
BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
endif

What we're doing for ARC is made not the best, but being consistent in
how different architectures do it is much more important.

Thanks,

Thomas
Guo Ren May 27, 2019, 7:23 a.m. UTC | #2
Thx Thomas,

On Sun, May 26, 2019 at 10:52:11PM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed,  8 May 2019 16:58:30 +0800
> guoren@kernel.org wrote:
> 
> > +if !BR2_csky
> >  choice
> >  	prompt "Binutils Version"
> >  	default BR2_BINUTILS_VERSION_2_31_X if !BR2_arc
> > @@ -32,6 +33,7 @@ config BR2_BINUTILS_VERSION
> >  	default "2.30"		if BR2_BINUTILS_VERSION_2_30_X
> >  	default "2.31.1"	if BR2_BINUTILS_VERSION_2_31_X
> >  	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
> > +endif
> 
> Let's do it like we do for the ARC architecture: add an option, and the
> proper depends on. I.e:
> 
> choice
>         prompt "Binutils Version"
>         default BR2_BINUTILS_VERSION_ARC if BR2_arc
> 	default BR2_BINUTILS_VERSION_CSKY if BR2_csky
>         default BR2_BINUTILS_VERSION_2_31_X
>         help
>           Select the version of binutils you wish to use.
> 
> config BR2_BINUTILS_VERSION_2_30_X
>         bool "binutils 2.30"
> 	depends on !BR2_csky
> 
> config BR2_BINUTILS_VERSION_2_31_X
>         bool "binutils 2.31.1"
> 	depends on !BR2_csky
> 
> config BR2_BINUTILS_VERSION_2_32_X
>         bool "binutils 2.32"
> 	depends on !BR2_csky
> 
> config BR2_BINUTILS_VERSION_ARC
>         bool "binutils arc (2.31)"
>         depends on BR2_arc
> 
> config BR2_BINUTILS_VERSION_CSKY
>         bool "binutils csky (2.32)"
>         depends on BR2_csky
> 
> endchoice
> 
> config BR2_BINUTILS_VERSION
>         string
> 	default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY
>         default "arc-2019.03-rc1"       if BR2_BINUTILS_VERSION_ARC
>         default "2.30"          if BR2_BINUTILS_VERSION_2_30_X
>         default "2.31.1"        if BR2_BINUTILS_VERSION_2_31_X
>         default "2.32"          if BR2_BINUTILS_VERSION_2_32_X
Ok, nice tips. Thx.

> 
> > diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk
> > index c70ba13..cebfd06 100644
> > --- a/package/binutils/binutils.mk
> > +++ b/package/binutils/binutils.mk
> > @@ -20,6 +20,14 @@ BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,
> >  BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
> >  BINUTILS_FROM_GIT = y
> >  endif
> > +
> > +ifeq ($(BR2_csky),y)
> > +BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
> > +BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
> > +BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
> > +BINUTILS_FROM_GIT = y
> > +endif
> 
> Same here, please follow the same logic as the one used for ARC, for
> consistency, i.e:
> 
> # Version is set when using buildroot toolchain.
> # If not, we do like other packages
> BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
> ifeq ($(BINUTILS_VERSION),)
> ifeq ($(BR2_arc),y)
> BINUTILS_VERSION = arc-2019.03-rc1
> else ifeq ($(BR2_csky),y)
> BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
> else
> BINUTILS_VERSION = 2.31.1
> endif
> endif # BINUTILS_VERSION
> 
> ifeq ($(BINUTILS_VERSION),arc-2019.03-rc1)
> BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
> BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
> BINUTILS_FROM_GIT = y
> else ifeq ($(BINUTILS_VERSION),c66d8bbcebfddf713b2b436e1b135e6b125a55a5)
> BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
> BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
> BINUTILS_FROM_GIT = y
> endif
> 
> What we're doing for ARC is made not the best, but being consistent in
> how different architectures do it is much more important.
Ok, follow the rules.

Best Regards
 Guo Ren
diff mbox series

Patch

diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host
index c3c3beb..53cd5ce 100644
--- a/package/binutils/Config.in.host
+++ b/package/binutils/Config.in.host
@@ -5,6 +5,7 @@  config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI
 	default y
 	depends on !BR2_microblaze
 
+if !BR2_csky
 choice
 	prompt "Binutils Version"
 	default BR2_BINUTILS_VERSION_2_31_X if !BR2_arc
@@ -32,6 +33,7 @@  config BR2_BINUTILS_VERSION
 	default "2.30"		if BR2_BINUTILS_VERSION_2_30_X
 	default "2.31.1"	if BR2_BINUTILS_VERSION_2_31_X
 	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
+endif
 
 config BR2_BINUTILS_ENABLE_LTO
 	bool
diff --git a/package/binutils/binutils.hash b/package/binutils/binutils.hash
index 039e368..9f8b419 100644
--- a/package/binutils/binutils.hash
+++ b/package/binutils/binutils.hash
@@ -5,3 +5,5 @@  sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724a
 
 # Locally calculated (fetched from Github)
 sha512  a96dfcea6064fcd1aac1333ac0d631491bed8b0be9bdcf62f1447909c8f30d2cb8d9323ffeb7c9ad6b326ecddb72e3d28281684e73343189d0a4a37a11aef62f  binutils-gdb-arc-2018.09-release.tar.gz
+# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
+sha512  979552d4b3a4f31e9f3b9a7027321bd4eb3ac6c2d8deac1720e94e54f81d736db09c53c5d87c301010e307b64127e14400a036c7a35e5d63a954a4edd9cc8e2c  binutils-c66d8bbcebfddf713b2b436e1b135e6b125a55a5.tar.gz
diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk
index c70ba13..cebfd06 100644
--- a/package/binutils/binutils.mk
+++ b/package/binutils/binutils.mk
@@ -20,6 +20,14 @@  BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,
 BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
 BINUTILS_FROM_GIT = y
 endif
+
+ifeq ($(BR2_csky),y)
+BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
+BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
+BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
+BINUTILS_FROM_GIT = y
+endif
+
 BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
 BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.xz
 BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))