Skip to contentSkip to conversation

libhugetlbfs: add support for armv7a

PATCH In review Anders Roxell 3 participants 6 messages Oct 18, 2013 – Nov 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libhugetlbfs: add support for armv7a

---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +8 -2
index 24480c3..4f1bfa4 100644
@@ -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}"
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 18 lines · Anders Roxell
---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +3 -1
index 24480c3..4f1bfa4 100644
@@ -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):

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \ · line 35

Quoted 10 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +5 -1
+        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'

Quoted 7 lines
Signature · 6 lines
1.8.1.2

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 55 lines · Martin Jansa
Quoted 18 lines · Anders Roxell
---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +3 -1
index 24480c3..4f1bfa4 100644
@@ -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):

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \ · line 35

Quoted 10 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +5 -1
+        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
Quoted 5 lines

/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

Quoted 19 lines
Quoted 9 lines
Signature · 7 lines
-- 
1.8.1.2

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 8 lines
Martin 'JaMa' Jansa     jabber: [email protected]



_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
#3 lore raw

I wasn't using anything special to reproduce it, my setup is described here
http://openembedded.org/wiki/Bitbake_World_Status

Quoted 106 lines · Anders Roxell
Quoted 4 lines · Martin Jansa
Quoted 3 lines · Anders Roxell
---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10

++++++++--

Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 8 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/ libhugetlbfs_git.bb

Quoted 4 lines

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://

Quoted 4 lines

index 24480c3..4f1bfa4 100644

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +0 -0
@@ -20,10 +20,16 @@ SRC_URI = "git://

git.code.sf.net/p/libhugetlbfs/code \

Quoted 6 lines
Quoted 6 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +1 -1
 S = "${WORKDIR}/git"
 
-COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|aarch64).*-linux*"
+COMPATIBLE_HOST = "(x86_64|powerpc|powerpc64|arm|aarch64).*-linux*"
 
Quoted 8 lines

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \

Quoted 8 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +6 -1
+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}"

Quoted 1 line

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git:// · line 31

Quoted 1 line
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +1 -0
+EXTRA_OEMAKE = "'ARCH=${ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}'

BUILDTYPE=NATIVEONLY ${LIBARGS}"

Quoted 1 line

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git:// · line 32

Quoted 1 line
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +0 -0
 CFLAGS += "-fexpensive-optimizations -frename-registers

-fomit-frame-pointer -g0"

Quoted 7 lines

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \ · line 35

Quoted 2 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +0 -0
 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:

Quoted 13 lines

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

Quoted 9 lines

| 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)

Quoted 3 lines

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,

Quoted 1 line

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

Quoted 15 lines
Quoted 9 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +0 -1
--

1.8.1.2

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
Martin 'JaMa' Jansa jabber: [email protected]

Quoted 4 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#4 lore raw
In reply to Anders Roxell
Quoted 12 lines · Anders Roxell
---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +0 -0
index 24480c3..4f1bfa4 100644
@@ -20,10 +20,16 @@ SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \
 
 S = "${WORKDIR}/git"

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \ · line 30

Quoted 10 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +7 -1
 
-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.

Quoted 13 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +1 -2
-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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#5 lore raw
Quoted 17 lines · Khem Raj
Quoted 16 lines · Anders Roxell
---
 meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +1 -1
index 24480c3..4f1bfa4 100644
@@ -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*"
 
Quoted 6 lines

meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb SRC_URI = "git://git.code.sf.net/p/libhugetlbfs/code \ · line 30

Quoted 6 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +6 -0
+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.

Quoted 5 lines

instead of this fugly anon python you could do

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

Much better, thanks!

Quoted 5 lines

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

Quoted 18 lines
Quoted 10 lines
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb +1 -2
-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

Quoted 4 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel