diff mbox

[v2,1/2] deb-pkg: Add automatic support for armhf architecture

Message ID 1402273294.23860.59.camel@deadeye.wl.decadent.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Hutchings June 9, 2014, 12:21 a.m. UTC
The Debian armhf architecture uses the ARM EABI hard-float variant,
whereas armel uses the soft-float variant.  Although the kernel
doesn't use FP itself, CONFIG_VFP must be enabled to support
hard-float userland and will probably be disabled when supporting a
soft-float userland.  So set the architecture to armhf by default when
CONFIG_AEABI and CONFIG_VFP are both enabled.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
v2: rebased

After discussion with Hector, we agreed this would be a worthwhile
change.  Hector may later improve this by using gcc specs.

Ben.

 scripts/package/builddeb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Fathi Boudra June 10, 2014, 8:10 a.m. UTC | #1
On 9 June 2014 03:21, Ben Hutchings <ben@decadent.org.uk> wrote:
> The Debian armhf architecture uses the ARM EABI hard-float variant,
> whereas armel uses the soft-float variant.  Although the kernel
> doesn't use FP itself, CONFIG_VFP must be enabled to support
> hard-float userland and will probably be disabled when supporting a
> soft-float userland.  So set the architecture to armhf by default when
> CONFIG_AEABI and CONFIG_VFP are both enabled.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Acked-by: Fathi Boudra <fathi.boudra@linaro.org>

> ---
> v2: rebased
>
> After discussion with Hector, we agreed this would be a worthwhile
> change.  Hector may later improve this by using gcc specs.
>
> Ben.
>
>  scripts/package/builddeb | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index f46e4dd..6756ed6 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -43,7 +43,16 @@ create_package() {
>         mips*)
>                 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
>         arm*)
> -               debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
> +               if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
> +                   if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
> +                       debarch=armhf
> +                   else
> +                       debarch=armel
> +                   fi
> +               else
> +                   debarch=arm
> +               fi
> +               ;;
>         *)
>                 echo "" >&2
>                 echo "** ** **  WARNING  ** ** **" >&2
>
>
> --
> Ben Hutchings
> One of the nice things about standards is that there are so many of them.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Riku Voipio June 10, 2014, 1:06 p.m. UTC | #2
On Mon, Jun 09, 2014 at 01:21:34AM +0100, Ben Hutchings wrote:
> The Debian armhf architecture uses the ARM EABI hard-float variant,
> whereas armel uses the soft-float variant.  Although the kernel
> doesn't use FP itself, CONFIG_VFP must be enabled to support
> hard-float userland and will probably be disabled when supporting a
> soft-float userland.  So set the architecture to armhf by default when
> CONFIG_AEABI and CONFIG_VFP are both enabled.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> v2: rebased
> 
> After discussion with Hector, we agreed this would be a worthwhile
> change.  Hector may later improve this by using gcc specs.

That should be easy:

-if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
+if $CC -dM -E - < /dev/null|grep -q __ARM_PCS_VFP; then

It worked at least for my cross-compile test a minute ago.

Riku

> Ben.
> 
>  scripts/package/builddeb | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index f46e4dd..6756ed6 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -43,7 +43,16 @@ create_package() {
>  	mips*)
>  		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
>  	arm*)
> -		debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
> +		if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
> +		    if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
> +			debarch=armhf
> +		    else
> +			debarch=armel
> +		    fi
> +		else
> +		    debarch=arm
> +		fi
> +		;;
>  	*)
>  		echo "" >&2
>  		echo "** ** **  WARNING  ** ** **" >&2
> 
> 
> -- 
> Ben Hutchings
> One of the nice things about standards is that there are so many of them.


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Riku Voipio July 14, 2014, 2:14 p.m. UTC | #3
On Tue, Jun 10, 2014 at 04:06:39PM +0300, Riku Voipio wrote:
> On Mon, Jun 09, 2014 at 01:21:34AM +0100, Ben Hutchings wrote:
> > The Debian armhf architecture uses the ARM EABI hard-float variant,
> > whereas armel uses the soft-float variant.  Although the kernel
> > doesn't use FP itself, CONFIG_VFP must be enabled to support
> > hard-float userland and will probably be disabled when supporting a
> > soft-float userland.  So set the architecture to armhf by default when
> > CONFIG_AEABI and CONFIG_VFP are both enabled.
> > 
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> > v2: rebased
> > 
> > After discussion with Hector, we agreed this would be a worthwhile
> > change.  Hector may later improve this by using gcc specs.
> 
> That should be easy:
> 
> -if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
> +if $CC -dM -E - < /dev/null|grep -q __ARM_PCS_VFP; then
 
> It worked at least for my cross-compile test a minute ago.

It would be nice to have this change scheduled in any form to 3.17.
Most people building kernels these days do armhf, so Bens version is
already a material improvement for everyone.

Riku

> Riku
> 
> > Ben.
> > 
> >  scripts/package/builddeb | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > index f46e4dd..6756ed6 100644
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -43,7 +43,16 @@ create_package() {
> >  	mips*)
> >  		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
> >  	arm*)
> > -		debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
> > +		if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
> > +		    if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
> > +			debarch=armhf
> > +		    else
> > +			debarch=armel
> > +		    fi
> > +		else
> > +		    debarch=arm
> > +		fi
> > +		;;
> >  	*)
> >  		echo "" >&2
> >  		echo "** ** **  WARNING  ** ** **" >&2
> > 
> > 
> > -- 
> > Ben Hutchings
> > One of the nice things about standards is that there are so many of them.
> 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-arm-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: https://lists.debian.org/20140610130639.GA25366@afflict.kos.to
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index f46e4dd..6756ed6 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -43,7 +43,16 @@  create_package() {
 	mips*)
 		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
 	arm*)
-		debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
+		if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
+		    if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
+			debarch=armhf
+		    else
+			debarch=armel
+		    fi
+		else
+		    debarch=arm
+		fi
+		;;
 	*)
 		echo "" >&2
 		echo "** ** **  WARNING  ** ** **" >&2