diff mbox

big endian builds

Message ID C2D7FE5348E1B147BCA15975FBA23075F4E8F650@us01wembx1.internal.synopsys.com
State Superseded
Headers show

Commit Message

Vineet Gupta March 11, 2016, 6:47 a.m. UTC
So for big endian kernel builds, just selecting the CONFIG_CPU_BIG_ENDIAN is not
sufficient, we also need to manually change the CROSS_COMPILE prefix to arceb-xxx.

@Anton, is that what you do for verification builds !

@Noam I presume your defconfig has CONFIG_CROSS_COMPILE or you have set in env
variable ?


The kernel build system needs to take take care of that. Do you guys have issues
with patch below

------------>
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Comments

Vineet Gupta March 11, 2016, 6:52 a.m. UTC | #1
On Friday 11 March 2016 12:18 PM, Vineet Gupta wrote:
> So for big endian kernel builds, just selecting the CONFIG_CPU_BIG_ENDIAN is not
> sufficient, we also need to manually change the CROSS_COMPILE prefix to arceb-xxx.
>
> @Anton, is that what you do for verification builds !
>
> @Noam I presume your defconfig has CONFIG_CROSS_COMPILE or you have set in env
> variable ?
>
>
> The kernel build system needs to take take care of that. Do you guys have issues
> with patch below
>
> ------------>
> diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> index c8230f3395f2..4abcdb89e391 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -9,8 +9,12 @@
>  UTS_MACHINE := arc
>  
>  ifeq ($(CROSS_COMPILE),)
> +ifndef CONFIG_CPU_BIG_ENDIAN
> +CROSS_COMPILE := arceb-linux-
> +else

Please pardon this nonsense as lack of caffeine - despite the obvious fixup, I
still need to change the .config.
I think we need to revert the defconfig patch for fixing the CROSS_COMPILE prefix
after all !

>  CROSS_COMPILE := arc-linux-
>  endif
> +endif
>
>
> _______________________________________________
> linux-snps-arc mailing list
> linux-snps-arc@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-snps-arc
>
Anton Kolesov March 11, 2016, 12:13 p.m. UTC | #2
Nightly verification script modifies CONFIG_CROSS_COMPILE in the .config file before build Linux - little or big endian doesn't matter, so path to tools is always correct. It sets full path in .config, instead of prepending PATH. CONFIG_CPU_BIG_ENDIAN is set accordingly.

--------8<--------

# Generate proper .config file from defconfig
make $MAKEFLAGS -C $src_dir/linux O=$odir ARCH=arc olddefconfig

# Set toolchain path
sed -i \
    -e "s|CONFIG_CROSS_COMPILE=\".*\"|CONFIG_CROSS_COMPILE=\"$build_dir/$target_toolchain/bin/$target_prefix\"|" \
    $odir/.config

# Set proper endianness. It's necessary to set it explicitly because
# we are not sure what value for CONFIG_CPU_BIG_ENDIAN flag is set
# because of impact of allnoconfig or allyesconfig configurations.
if [ $target_endian = eb ]; then
    kconfig_enable_option $odir CONFIG_CPU_BIG_ENDIAN
else
    kconfig_disable_option $odir CONFIG_CPU_BIG_ENDIAN
fi


# Regenerate .config with new CONFIG_CPU_BIG_ENDIAN option value. It's
# necessary because this option may be not presented in platforms defconfigs
# thus sed cannot fix it before generating the first version of .config.
make $MAKEFLAGS -C $src_dir/linux O=$odir ARCH=arc olddefconfig

--------8<--------

Anton

> -----Original Message-----
> From: Vineet Gupta [mailto:vgupta@synopsys.com]
> Sent: Friday, March 11, 2016 9:53 AM
> To: Vineet Gupta <Vineet.Gupta1@synopsys.com>; Anton Kolesov <Anton.Kolesov@synopsys.com>; Alexey
> Brodkin <Alexey.Brodkin@synopsys.com>; Noam Camus <noamc@ezchip.com>
> Cc: arcml <linux-snps-arc@lists.infradead.org>
> Subject: Re: big endian builds
> 
> On Friday 11 March 2016 12:18 PM, Vineet Gupta wrote:
> > So for big endian kernel builds, just selecting the CONFIG_CPU_BIG_ENDIAN is not
> > sufficient, we also need to manually change the CROSS_COMPILE prefix to arceb-xxx.
> >
> > @Anton, is that what you do for verification builds !
> >
> > @Noam I presume your defconfig has CONFIG_CROSS_COMPILE or you have set in env
> > variable ?
> >
> >
> > The kernel build system needs to take take care of that. Do you guys have issues
> > with patch below
> >
> > ------------>
> > diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> > index c8230f3395f2..4abcdb89e391 100644
> > --- a/arch/arc/Makefile
> > +++ b/arch/arc/Makefile
> > @@ -9,8 +9,12 @@
> >  UTS_MACHINE := arc
> >
> >  ifeq ($(CROSS_COMPILE),)
> > +ifndef CONFIG_CPU_BIG_ENDIAN
> > +CROSS_COMPILE := arceb-linux-
> > +else
> 
> Please pardon this nonsense as lack of caffeine - despite the obvious fixup, I
> still need to change the .config.
> I think we need to revert the defconfig patch for fixing the CROSS_COMPILE prefix
> after all !
> 
> >  CROSS_COMPILE := arc-linux-
> >  endif
> > +endif
> >
> >
> > _______________________________________________
> > linux-snps-arc mailing list
> > linux-snps-arc@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-snps-arc
> >
diff mbox

Patch

diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index c8230f3395f2..4abcdb89e391 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -9,8 +9,12 @@ 
 UTS_MACHINE := arc
 
 ifeq ($(CROSS_COMPILE),)
+ifndef CONFIG_CPU_BIG_ENDIAN
+CROSS_COMPILE := arceb-linux-
+else
 CROSS_COMPILE := arc-linux-
 endif
+endif


_______________________________________________