Patchwork libhugetlbfs: add support for armv7a

login
register
mail settings
Submitter Anders Roxell
Date Oct. 18, 2013, 2:09 p.m.
Message ID <1382105347-27538-1-git-send-email-anders.roxell@linaro.org>
Download mbox | patch
Permalink /patch/60237/
State Changes Requested, archived
Headers show

Comments

Anders Roxell - Oct. 18, 2013, 2:09 p.m.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Martin Jansa - Oct. 28, 2013, 8:26 a.m.
On Fri, Oct 18, 2013 at 04:09:07PM +0200, Anders Roxell wrote:
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> index 24480c3..4f1bfa4 100644
> --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> @@ -20,10 +20,16 @@ SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \
>  
>  S = "${WORKDIR}/git"
>  
> -COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
> +COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
>  
> +python __anonymous() {
> +    if base_contains('TARGET_ARCH', 'arm', True, False, d):
> +        d.setVar('ARCH', 'armv7l')
> +    else:
> +        d.setVar('ARCH', d.getVar('TARGET_ARCH'))
> +}
>  
> -EXTRA_OEMAKE = "'ARCH=${TARGET_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
> +EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
>  CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0"
>  
>  TARGET_CC_ARCH += "${LDFLAGS}"

It enables every arm* and fails for qemuarm:

|
/home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.1/ld:
error: zero_filesize_segment.ld: SECTIONS seen after other input files;
try -T/--script
| collect2: error: ld returned 1 exit status
| 	 CC32 obj32/linkhuge.o
| 	 LD32 (hugelink test) obj32/linkhuge
| 	 CC32 obj32/linkhuge_nofd.o
| 	 LD32 (hugelink test) obj32/linkhuge_nofd
| 	 CC32 obj32/linkshare.o
| 	 LD32 (hugelink test) obj32/linkshare
| 	 CC32 obj32/linkhuge_rw.o
| 	 LD32 (hugelink_rw test) obj32/linkhuge_rw
| arm-oe-linux-gnueabi-ld: error: cannot open text-segment=2097152: No
such file or directory
| arm-oe-linux-gnueabi-ld: fatal error: unable to parse script file
text-segment=2097152
| collect2: error: ld returned 1 exit status
| make[1]: *** [obj32/linkhuge_rw] Error 1
| make: *** [tests/all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at
/home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libhugetlbfs/git-r0/temp/log.do_compile.24357)
NOTE: recipe libhugetlbfs-git-r0: task do_compile: Failed
ERROR: Task 23498
(/home/jenkins/oe/shr-core-branches/shr-core/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb,
do_compile) failed with exit code '1'


> -- 
> 1.8.1.2
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Khem Raj - Oct. 29, 2013, 1:42 a.m.
On Fri, Oct 18, 2013 at 7:09 AM, Anders Roxell <anders.roxell@linaro.org> wrote:
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> index 24480c3..4f1bfa4 100644
> --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> @@ -20,10 +20,16 @@ SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \
>
>  S = "${WORKDIR}/git"
>
> -COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
> +COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
>
> +python __anonymous() {
> +    if base_contains('TARGET_ARCH', 'arm', True, False, d):
> +        d.setVar('ARCH', 'armv7l')
> +    else:
> +        d.setVar('ARCH', d.getVar('TARGET_ARCH'))
> +}

instead of this fugly anon python you could do

ARCH_arm = "armv7l"
ARCH ?=  "${TARGET_ARCH}"

and btw. we support ARM v4,v5,v6 architectures as well. It seems your
patch only cares about armv7,
and if this recipe only works for armv7+ then dont open the floodgates
for all kind of arm architectures.

>
> -EXTRA_OEMAKE = "'ARCH=${TARGET_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
> +EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
>  CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0"
>
>  TARGET_CC_ARCH += "${LDFLAGS}"
> --
> 1.8.1.2
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Anders Roxell - Nov. 6, 2013, 9:05 a.m.
On 2013-10-28 18:42, Khem Raj wrote:
> On Fri, Oct 18, 2013 at 7:09 AM, Anders Roxell <anders.roxell@linaro.org> wrote:
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > ---
> >  meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > index 24480c3..4f1bfa4 100644
> > --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > @@ -20,10 +20,16 @@ SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \
> >
> >  S = "${WORKDIR}/git"
> >
> > -COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
> > +COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
> >
> > +python __anonymous() {
> > +    if base_contains('TARGET_ARCH', 'arm', True, False, d):
> > +        d.setVar('ARCH', 'armv7l')
> > +    else:
> > +        d.setVar('ARCH', d.getVar('TARGET_ARCH'))
> > +}
I'm sorry for the late response.

> 
> instead of this fugly anon python you could do
> 
> ARCH_arm = "armv7l"
> ARCH ?=  "${TARGET_ARCH}"
Much better, thanks!

> 
> and btw. we support ARM v4,v5,v6 architectures as well. It seems your
> patch only cares about armv7,
> and if this recipe only works for armv7+ then dont open the floodgates
> for all kind of arm architectures.
Agree.

Will send out patch v2.

Cheers,
Anders

> 
> >
> > -EXTRA_OEMAKE = "'ARCH=${TARGET_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
> > +EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
> >  CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0"
> >
> >  TARGET_CC_ARCH += "${LDFLAGS}"
> > --
> > 1.8.1.2
> >
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Anders Roxell - Nov. 7, 2013, 4:03 p.m.
On 2013-10-28 09:26, Martin Jansa wrote:
> On Fri, Oct 18, 2013 at 04:09:07PM +0200, Anders Roxell wrote:
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > ---
> >  meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > index 24480c3..4f1bfa4 100644
> > --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > @@ -20,10 +20,16 @@ SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \
> >  
> >  S = "${WORKDIR}/git"
> >  
> > -COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
> > +COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
> >  
> > +python __anonymous() {
> > +    if base_contains('TARGET_ARCH', 'arm', True, False, d):
> > +        d.setVar('ARCH', 'armv7l')
> > +    else:
> > +        d.setVar('ARCH', d.getVar('TARGET_ARCH'))
> > +}
> >  
> > -EXTRA_OEMAKE = "'ARCH=${TARGET_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
> > +EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
> >  CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0"
> >  
> >  TARGET_CC_ARCH += "${LDFLAGS}"
> 
> It enables every arm* and fails for qemuarm:
> 
> |
> /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.1/ld:
> error: zero_filesize_segment.ld: SECTIONS seen after other input files;
> try -T/--script
> | collect2: error: ld returned 1 exit status
> | 	 CC32 obj32/linkhuge.o
> | 	 LD32 (hugelink test) obj32/linkhuge
> | 	 CC32 obj32/linkhuge_nofd.o
> | 	 LD32 (hugelink test) obj32/linkhuge_nofd
> | 	 CC32 obj32/linkshare.o
> | 	 LD32 (hugelink test) obj32/linkshare
> | 	 CC32 obj32/linkhuge_rw.o
> | 	 LD32 (hugelink_rw test) obj32/linkhuge_rw
> | arm-oe-linux-gnueabi-ld: error: cannot open text-segment=2097152: No
> such file or directory
> | arm-oe-linux-gnueabi-ld: fatal error: unable to parse script file
> text-segment=2097152
> | collect2: error: ld returned 1 exit status
> | make[1]: *** [obj32/linkhuge_rw] Error 1
> | make: *** [tests/all] Error 2
> | ERROR: oe_runmake failed
> | WARNING: exit code 1 from a shell command.
> | ERROR: Function failed: do_compile (log file is located at
> /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libhugetlbfs/git-r0/temp/log.do_compile.24357)
> NOTE: recipe libhugetlbfs-git-r0: task do_compile: Failed
> ERROR: Task 23498
> (/home/jenkins/oe/shr-core-branches/shr-core/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb,
> do_compile) failed with exit code '1'
Hi,

I'm sorry for the late response!

How can I reproduce this error?
I tried to build libhugetlbfs for qemuarm and that worked for me...

Cheers,
Anders

> 
> 
> > -- 
> > 1.8.1.2
> > 
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Martin Jansa - Nov. 8, 2013, 11:29 a.m.
I wasn't using anything special to reproduce it, my setup is described here
http://openembedded.org/wiki/Bitbake_World_Status


On Thu, Nov 7, 2013 at 5:03 PM, Anders Roxell <anders.roxell@linaro.org>wrote:

> On 2013-10-28 09:26, Martin Jansa wrote:
> > On Fri, Oct 18, 2013 at 04:09:07PM +0200, Anders Roxell wrote:
> > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > ---
> > >  meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10
> ++++++++--
> > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/
> libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/
> libhugetlbfs_git.bb
> > > index 24480c3..4f1bfa4 100644
> > > --- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > > +++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
> > > @@ -20,10 +20,16 @@ SRC_URI = "git://
> git.code.sf.net/p/libhugetlbfs/code \
> > >
> > >  S = "${WORKDIR}/git"
> > >
> > > -COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
> > > +COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
> > >
> > > +python __anonymous() {
> > > +    if base_contains('TARGET_ARCH', 'arm', True, False, d):
> > > +        d.setVar('ARCH', 'armv7l')
> > > +    else:
> > > +        d.setVar('ARCH', d.getVar('TARGET_ARCH'))
> > > +}
> > >
> > > -EXTRA_OEMAKE = "'ARCH=${TARGET_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}'
> BUILDTYPE=NATIVEONLY ${LIBARGS}"
> > > +EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}'
> BUILDTYPE=NATIVEONLY ${LIBARGS}"
> > >  CFLAGS += "-fexpensive-optimizations -frename-registers
> -fomit-frame-pointer -g0"
> > >
> > >  TARGET_CC_ARCH += "${LDFLAGS}"
> >
> > It enables every arm* and fails for qemuarm:
> >
> > |
> >
> /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.1/ld:
> > error: zero_filesize_segment.ld: SECTIONS seen after other input files;
> > try -T/--script
> > | collect2: error: ld returned 1 exit status
> > |      CC32 obj32/linkhuge.o
> > |      LD32 (hugelink test) obj32/linkhuge
> > |      CC32 obj32/linkhuge_nofd.o
> > |      LD32 (hugelink test) obj32/linkhuge_nofd
> > |      CC32 obj32/linkshare.o
> > |      LD32 (hugelink test) obj32/linkshare
> > |      CC32 obj32/linkhuge_rw.o
> > |      LD32 (hugelink_rw test) obj32/linkhuge_rw
> > | arm-oe-linux-gnueabi-ld: error: cannot open text-segment=2097152: No
> > such file or directory
> > | arm-oe-linux-gnueabi-ld: fatal error: unable to parse script file
> > text-segment=2097152
> > | collect2: error: ld returned 1 exit status
> > | make[1]: *** [obj32/linkhuge_rw] Error 1
> > | make: *** [tests/all] Error 2
> > | ERROR: oe_runmake failed
> > | WARNING: exit code 1 from a shell command.
> > | ERROR: Function failed: do_compile (log file is located at
> >
> /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libhugetlbfs/git-r0/temp/log.do_compile.24357)
> > NOTE: recipe libhugetlbfs-git-r0: task do_compile: Failed
> > ERROR: Task 23498
> >
> (/home/jenkins/oe/shr-core-branches/shr-core/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/
> libhugetlbfs_git.bb,
> > do_compile) failed with exit code '1'
> Hi,
>
> I'm sorry for the late response!
>
> How can I reproduce this error?
> I tried to build libhugetlbfs for qemuarm and that worked for me...
>
> Cheers,
> Anders
>
> >
> >
> > > --
> > > 1.8.1.2
> > >
> > > _______________________________________________
> > > Openembedded-devel mailing list
> > > Openembedded-devel@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> >
> > --
> > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>
>
>
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>

Patch

diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
index 24480c3..4f1bfa4 100644
--- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
+++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
@@ -20,10 +20,16 @@  SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \
 
 S = "${WORKDIR}/git"
 
-COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
+COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
 
+python __anonymous() {
+    if base_contains('TARGET_ARCH', 'arm', True, False, d):
+        d.setVar('ARCH', 'armv7l')
+    else:
+        d.setVar('ARCH', d.getVar('TARGET_ARCH'))
+}
 
-EXTRA_OEMAKE = "'ARCH=${TARGET_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
+EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' BUILDTYPE=NATIVEONLY ${LIBARGS}"
 CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0"
 
 TARGET_CC_ARCH += "${LDFLAGS}"