Patchwork [meta-fsl-ppc] lttng-modules: build as 64-bit kernel module on e6500

login
register
mail settings
Submitter chunrong guo
Date Dec. 13, 2013, 7:47 a.m.
Message ID <1386920864-10198-1-git-send-email-b40290@freescale.com>
Download mbox | patch
Permalink /patch/63311/
State Rejected
Headers show

Comments

chunrong guo - Dec. 13, 2013, 7:47 a.m.
From: Chunrong Guo <B40290@freescale.com>

   *e6500 is built with 32b rootfs/64b kernel, build asf as 64bit too.
   *Fix the below build issue on e6500 core:
   | DEBUG: Executing shell function do_make_scripts
   | make: Entering directory `.../tmp/sysroots/t4240qds/usr/src/kernel'
   | CC scripts/mod/empty.o | scripts/mod/empty.c:1:0: error: -mcmodel not supported in this configuration
   | make[2]: *** [scripts/mod/empty.o] Error 1
   | make[1]: *** [scripts/mod] Error 2
   | make: *** [scripts] Error 2

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 recipes-kernel/lttng/lttng-modules_2.3.3.bbappend |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
Zhenhua Luo - Dec. 14, 2013, 5:38 a.m.
Applied, thanks. 


Best Regards,

Zhenhua


> -----Original Message-----
> From: b40290@freescale.com [mailto:b40290@freescale.com]
> Sent: Friday, December 13, 2013 3:48 PM
> To: meta-freescale@yoctoproject.org
> Cc: Liu Ting-B28495; Luo Zhenhua-B19537; Guo Chunrong-B40290
> Subject: [meta-fsl-ppc][PATCH] lttng-modules: build as 64-bit kernel
> module on e6500
> 
> From: Chunrong Guo <B40290@freescale.com>
> 
>    *e6500 is built with 32b rootfs/64b kernel, build asf as 64bit too.
>    *Fix the below build issue on e6500 core:
>    | DEBUG: Executing shell function do_make_scripts
>    | make: Entering directory `.../tmp/sysroots/t4240qds/usr/src/kernel'
>    | CC scripts/mod/empty.o | scripts/mod/empty.c:1:0: error: -mcmodel
> not supported in this configuration
>    | make[2]: *** [scripts/mod/empty.o] Error 1
>    | make[1]: *** [scripts/mod] Error 2
>    | make: *** [scripts] Error 2
> 
> Signed-off-by: Chunrong Guo <B40290@freescale.com>
> ---
>  recipes-kernel/lttng/lttng-modules_2.3.3.bbappend |   21
> +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)  create mode 100644
> recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> 
> diff --git a/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend b/recipes-
> kernel/lttng/lttng-modules_2.3.3.bbappend
> new file mode 100644
> index 0000000..0452d7c
> --- /dev/null
> +++ b/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> @@ -0,0 +1,21 @@
> +PRINC := "${@int(PRINC) + 1}"
> +
> +python () {
> +    ma = d.getVar("DISTRO_FEATURES", True)
> +    arch = d.getVar("OVERRIDES", True)
> +
> +    # the : after the arch is to skip the message on 64b
> +    if not "multiarch" in ma and "e6500:" in arch:
> +        raise bb.parse.SkipPackage("Building the kernel for this arch
> + requires multiarch to be in DISTRO_FEATURES")
> +
> +    promote_kernel = d.getVar('BUILD_64BIT_KERNEL')
> +
> +    if promote_kernel == "1":
> +        d.setVar('KERNEL_CC_append', ' -m64')
> +        d.setVar('KERNEL_LD_append', ' -melf64ppc')
> +
> +    error_qa = d.getVar('ERROR_QA', True)
> +    if 'arch' in error_qa:
> +        d.setVar('ERROR_QA', error_qa.replace(' arch', '')) }
> +
> --
> 1.7.5.4
>
Otavio Salvador - Dec. 14, 2013, 11:18 a.m.
On Fri, Dec 13, 2013 at 5:47 AM,  <b40290@freescale.com> wrote:
> From: Chunrong Guo <B40290@freescale.com>
>
>    *e6500 is built with 32b rootfs/64b kernel, build asf as 64bit too.
>    *Fix the below build issue on e6500 core:
>    | DEBUG: Executing shell function do_make_scripts
>    | make: Entering directory `.../tmp/sysroots/t4240qds/usr/src/kernel'
>    | CC scripts/mod/empty.o | scripts/mod/empty.c:1:0: error: -mcmodel not supported in this configuration
>    | make[2]: *** [scripts/mod/empty.o] Error 1
>    | make[1]: *** [scripts/mod] Error 2
>    | make: *** [scripts] Error 2
>
> Signed-off-by: Chunrong Guo <B40290@freescale.com>
> ---
>  recipes-kernel/lttng/lttng-modules_2.3.3.bbappend |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
>  create mode 100644 recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
>
> diff --git a/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend b/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> new file mode 100644
> index 0000000..0452d7c
> --- /dev/null
> +++ b/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> @@ -0,0 +1,21 @@
> +PRINC := "${@int(PRINC) + 1}"

No PRINC.

> +python () {
> +    ma = d.getVar("DISTRO_FEATURES", True)
> +    arch = d.getVar("OVERRIDES", True)
> +
> +    # the : after the arch is to skip the message on 64b
> +    if not "multiarch" in ma and "e6500:" in arch:
> +        raise bb.parse.SkipPackage("Building the kernel for this arch requires multiarch to be in DISTRO_FEATURES")

You can use distro-features-check here.

> +    promote_kernel = d.getVar('BUILD_64BIT_KERNEL')
> +
> +    if promote_kernel == "1":
> +        d.setVar('KERNEL_CC_append', ' -m64')
> +        d.setVar('KERNEL_LD_append', ' -melf64ppc')

d.appendVar here

> +    error_qa = d.getVar('ERROR_QA', True)
> +    if 'arch' in error_qa:
> +        d.setVar('ERROR_QA', error_qa.replace(' arch', ''))
> +}
> +
> --
> 1.7.5.4
>
>
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
Zhenhua Luo - Dec. 16, 2013, 5:47 a.m.
The commit is reverted due to there is comments for the patch. 

Chunrong, please submit a new version according to the comment from Otavio. 


Best Regards,

Zhenhua


> -----Original Message-----
> From: meta-freescale-bounces@yoctoproject.org [mailto:meta-freescale-
> bounces@yoctoproject.org] On Behalf Of zhenhua.luo@freescale.com
> Sent: Saturday, December 14, 2013 1:38 PM
> To: Guo Chunrong-B40290
> Cc: meta-freescale@yoctoproject.org
> Subject: Re: [meta-freescale] [meta-fsl-ppc][PATCH] lttng-modules: build
> as 64-bit kernel module on e6500
> 
> Applied, thanks.
> 
> 
> Best Regards,
> 
> Zhenhua
> 
> 
> > -----Original Message-----
> > From: b40290@freescale.com [mailto:b40290@freescale.com]
> > Sent: Friday, December 13, 2013 3:48 PM
> > To: meta-freescale@yoctoproject.org
> > Cc: Liu Ting-B28495; Luo Zhenhua-B19537; Guo Chunrong-B40290
> > Subject: [meta-fsl-ppc][PATCH] lttng-modules: build as 64-bit kernel
> > module on e6500
> >
> > From: Chunrong Guo <B40290@freescale.com>
> >
> >    *e6500 is built with 32b rootfs/64b kernel, build asf as 64bit too.
> >    *Fix the below build issue on e6500 core:
> >    | DEBUG: Executing shell function do_make_scripts
> >    | make: Entering directory
> `.../tmp/sysroots/t4240qds/usr/src/kernel'
> >    | CC scripts/mod/empty.o | scripts/mod/empty.c:1:0: error: -mcmodel
> > not supported in this configuration
> >    | make[2]: *** [scripts/mod/empty.o] Error 1
> >    | make[1]: *** [scripts/mod] Error 2
> >    | make: *** [scripts] Error 2
> >
> > Signed-off-by: Chunrong Guo <B40290@freescale.com>
> > ---
> >  recipes-kernel/lttng/lttng-modules_2.3.3.bbappend |   21
> > +++++++++++++++++++++
> >  1 files changed, 21 insertions(+), 0 deletions(-)  create mode 100644
> > recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> >
> > diff --git a/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> > b/recipes- kernel/lttng/lttng-modules_2.3.3.bbappend
> > new file mode 100644
> > index 0000000..0452d7c
> > --- /dev/null
> > +++ b/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
> > @@ -0,0 +1,21 @@
> > +PRINC := "${@int(PRINC) + 1}"
> > +
> > +python () {
> > +    ma = d.getVar("DISTRO_FEATURES", True)
> > +    arch = d.getVar("OVERRIDES", True)
> > +
> > +    # the : after the arch is to skip the message on 64b
> > +    if not "multiarch" in ma and "e6500:" in arch:
> > +        raise bb.parse.SkipPackage("Building the kernel for this arch
> > + requires multiarch to be in DISTRO_FEATURES")
> > +
> > +    promote_kernel = d.getVar('BUILD_64BIT_KERNEL')
> > +
> > +    if promote_kernel == "1":
> > +        d.setVar('KERNEL_CC_append', ' -m64')
> > +        d.setVar('KERNEL_LD_append', ' -melf64ppc')
> > +
> > +    error_qa = d.getVar('ERROR_QA', True)
> > +    if 'arch' in error_qa:
> > +        d.setVar('ERROR_QA', error_qa.replace(' arch', '')) }
> > +
> > --
> > 1.7.5.4
> >
> 
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
>

Patch

diff --git a/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend b/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
new file mode 100644
index 0000000..0452d7c
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules_2.3.3.bbappend
@@ -0,0 +1,21 @@ 
+PRINC := "${@int(PRINC) + 1}"
+
+python () {
+    ma = d.getVar("DISTRO_FEATURES", True)
+    arch = d.getVar("OVERRIDES", True)
+
+    # the : after the arch is to skip the message on 64b
+    if not "multiarch" in ma and "e6500:" in arch:
+        raise bb.parse.SkipPackage("Building the kernel for this arch requires multiarch to be in DISTRO_FEATURES")
+
+    promote_kernel = d.getVar('BUILD_64BIT_KERNEL')
+
+    if promote_kernel == "1":
+        d.setVar('KERNEL_CC_append', ' -m64')
+        d.setVar('KERNEL_LD_append', ' -melf64ppc')
+
+    error_qa = d.getVar('ERROR_QA', True)
+    if 'arch' in error_qa:
+        d.setVar('ERROR_QA', error_qa.replace(' arch', ''))
+}
+