summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-benchmark/libhugetlbfs/files/Force-text-segment-alignment-to-0x08000000-for-i386-.patch92
-rw-r--r--meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb20
2 files changed, 5 insertions, 107 deletions
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/files/Force-text-segment-alignment-to-0x08000000-for-i386-.patch b/meta-oe/recipes-benchmark/libhugetlbfs/files/Force-text-segment-alignment-to-0x08000000-for-i386-.patch
deleted file mode 100644
index ce6974d7c..000000000
--- a/meta-oe/recipes-benchmark/libhugetlbfs/files/Force-text-segment-alignment-to-0x08000000-for-i386-.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From 3c6f8d0e3c0694f79244ec6ad5ad9ba3ca26bc0a Mon Sep 17 00:00:00 2001
2From: Yang Shi <yang.shi@linaro.org>
3Date: Mon, 7 Dec 2015 14:12:13 -0800
4Subject: [PATCH] Force text segment alignment to 0x08000000 for i386 with gold
5 linker
6
7Upstream-Status: Backport
8
9When build libhugetlbfs tests with gold linker for i386, the below error occurs:
10
11i586-oe-linux-gcc -m32 -march=i586 -Wl,-O1 -Wl,--hash-style=gnu
12-Wl,--as-needed
13--sysroot=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemux86 -I..
14-O2
15-Wall -g -o obj32/linkhuge_rw.o -c linkhuge_rw.c
16| i586-oe-linux-gcc -m32 -march=i586 -Wl,-O1 -Wl,--hash-style=gnu
17-Wl,--as-needed
18--sysroot=/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemux86
19-B./obj32
20-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,noexecstack -ldl
21-L../obj32
22-o obj32/linkhuge_rw -Wl,--no-as-needed -lpthread -ldl -lhugetlbfs_privutils
23-Wl,--hugetlbfs-align obj32/linkhuge_rw.o obj32/testutils.o
24| i586-oe-linux-ld: internal error in do_write, at
25/home/jenkins/oe/world/shr-core/tmp-glibc/work/x86_64-oe-linux/binutils-cross-i586/2.25-r0/git/gold/output.cc:464
26| collect2: error: ld returned 1 exit status
27
28But, it works well with GNU linker. --hugetlbfs-align flag passes
29"-zcommon-page-size=$SLICE_SIZE -zmax-page-size=$SLICE_SIZE", that are supported by gold linker too.
30But, it looks gold linker deal with them in a different way from gnu linker for i586.
31
32The readelf shows the below result with GNU linker:
33
34Elf file type is EXEC (Executable file)
35Entry point 0x8048fbd
36There are 8 program headers, starting at offset 52
37
38Program Headers:
39 Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
40 PHDR 0x000034 0x08000034 0x08000034 0x00100 0x00100 R E 0x4
41 INTERP 0x048134 0x08048134 0x08048134 0x00013 0x00013 R 0x1
42 [Requesting program interpreter: /lib/ld-linux.so.2]
43 LOAD 0x000000 0x08000000 0x08000000 0x5a5bc 0x5a5bc R E 0x400000
44 LOAD 0x05a5bc 0x0845a5bc 0x0845a5bc 0x1028c 0x202cc RW 0x400000
45 DYNAMIC 0x05a5d0 0x0845a5d0 0x0845a5d0 0x000e8 0x000e8 RW 0x4
46 NOTE 0x048148 0x08048148 0x08048148 0x00044 0x00044 R 0x4
47 GNU_EH_FRAME 0x059e5c 0x08059e5c 0x08059e5c 0x0009c 0x0009c R 0x4
48 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
49
50"--relax" linker option doesn't solve this problem.
51Forced textsegment alignment to 0x08000000 with gold linker, the build will pass and
52readelf shows the same result with GNU linker:
53
54Elf file type is EXEC (Executable file)
55Entry point 0x8048fbd
56There are 8 program headers, starting at offset 52
57
58Program Headers:
59 Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
60 PHDR 0x000034 0x08000034 0x08000034 0x00100 0x00100 R E 0x4
61 INTERP 0x048134 0x08048134 0x08048134 0x00013 0x00013 R 0x1
62 [Requesting program interpreter: /lib/ld-linux.so.2]
63 LOAD 0x000000 0x08000000 0x08000000 0x5a5bc 0x5a5bc R E 0x400000
64 LOAD 0x05a5bc 0x0845a5bc 0x0845a5bc 0x1028c 0x202cc RW 0x400000
65 DYNAMIC 0x05a5d0 0x0845a5d0 0x0845a5d0 0x000e8 0x000e8 RW 0x4
66 NOTE 0x048148 0x08048148 0x08048148 0x00044 0x00044 R 0x4
67 GNU_EH_FRAME 0x059e5c 0x08059e5c 0x08059e5c 0x0009c 0x0009c R 0x4
68 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
69
70The fix just have impact on hugelink_rw test case, which needs --hugetlbfs-align flag.
71
72Signed-off-by: Yang Shi <yang.shi@linaro.org>
73Signed-off-by: Eric B Munson <emunson@mgebm.net>
74---
75 ld.hugetlbfs | 1 +
76 1 file changed, 1 insertion(+)
77
78diff --git a/ld.hugetlbfs b/ld.hugetlbfs
79index 4417442..32bc6fb 100755
80--- a/ld.hugetlbfs
81+++ b/ld.hugetlbfs
82@@ -98,6 +98,7 @@ if [ "$HTLB_ALIGN" == "slice" ]; then
83 # otherwise it will be NULL.
84 case "$EMU" in
85 armelf*_linux_eabi) HTLBOPTS="$HTLBOPTS -Ttext-segment=$SLICE_SIZE" ;;
86+ elf_i386) HTLBOPTS="$HTLBOPTS -Ttext-segment=0x08000000" ;;
87 esac
88 fi
89
90--
912.0.2
92
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
index 14c909e75..66fd8e21d 100644
--- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
+++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
@@ -3,14 +3,14 @@ HOMEPAGE = "https://github.com/libhugetlbfs/libhugetlbfs"
3LICENSE = "LGPLv2.1" 3LICENSE = "LGPLv2.1"
4LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1" 4LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1"
5 5
6DEPENDS = "sysfsutils perl" 6DEPENDS = "sysfsutils"
7RDEPENDS_${PN} += "bash perl python python-io python-lang python-subprocess python-resource ${PN}-perl" 7RDEPENDS_${PN} += "bash python python-io python-lang python-subprocess python-resource"
8RDEPENDS_${PN}-tests += "bash" 8RDEPENDS_${PN}-tests += "bash"
9 9
10PV = "2.20" 10PV = "2.21"
11PE = "1" 11PE = "1"
12 12
13SRCREV = "e44180072b796c0e28e53c4d01ef6279caaa2a99" 13SRCREV = "73d06e69108f231696e9c5c44f4b42690fc5d752"
14SRC_URI = " \ 14SRC_URI = " \
15 git://github.com/libhugetlbfs/libhugetlbfs.git;protocol=https \ 15 git://github.com/libhugetlbfs/libhugetlbfs.git;protocol=https \
16 file://skip-checking-LIB32-and-LIB64-if-they-point-to-the-s.patch \ 16 file://skip-checking-LIB32-and-LIB64-if-they-point-to-the-s.patch \
@@ -18,7 +18,6 @@ SRC_URI = " \
18 file://tests-Makefile-install-static-4G-edge-testcases.patch \ 18 file://tests-Makefile-install-static-4G-edge-testcases.patch \
19 file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \ 19 file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \
20 file://libhugetlbfs-elf_i386-avoid-search-host-library-path.patch \ 20 file://libhugetlbfs-elf_i386-avoid-search-host-library-path.patch \
21 file://Force-text-segment-alignment-to-0x08000000-for-i386-.patch \
22 file://0001-include-stddef.h-for-ptrdiff_t.patch \ 21 file://0001-include-stddef.h-for-ptrdiff_t.patch \
23 file://0002-Mark-glibc-specific-code-so.patch \ 22 file://0002-Mark-glibc-specific-code-so.patch \
24 file://0003-alloc.c-Avoid-sysconf-_SC_LEVEL2_CACHE_LINESIZE-on-l.patch \ 23 file://0003-alloc.c-Avoid-sysconf-_SC_LEVEL2_CACHE_LINESIZE-on-l.patch \
@@ -51,14 +50,6 @@ do_configure() {
51 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then 50 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
52 sed -i 's/CUSTOM_LDSCRIPTS = yes/CUSTOM_LDSCRIPTS = no/' Makefile 51 sed -i 's/CUSTOM_LDSCRIPTS = yes/CUSTOM_LDSCRIPTS = no/' Makefile
53 fi 52 fi
54
55 # fixup perl module directory hardcoded to perl5
56 sed -i 's/perl5/perl/g' Makefile
57
58 # fixup to install perl module under $(LIBDIR)/perl/${@get_perl_version(d)}/TLBC
59 # to avoid below error
60 # Can't locate TLBC/OpCollect.pm in @INC
61 sed -i '/^PMDIR/ s:perl:perl/${@get_perl_version(d)}:g' Makefile
62} 53}
63 54
64do_install() { 55do_install() {
@@ -69,11 +60,10 @@ do_install() {
69} 60}
70 61
71 62
72PACKAGES =+ "${PN}-perl ${PN}-tests " 63PACKAGES =+ "${PN}-tests "
73FILES_${PN} += "${libdir}/*.so" 64FILES_${PN} += "${libdir}/*.so"
74FILES_${PN}-dev = "${includedir}" 65FILES_${PN}-dev = "${includedir}"
75FILES_${PN}-dbg += "${libdir}/libhugetlbfs/tests/obj32/.debug ${libdir}/libhugetlbfs/tests/obj64/.debug" 66FILES_${PN}-dbg += "${libdir}/libhugetlbfs/tests/obj32/.debug ${libdir}/libhugetlbfs/tests/obj64/.debug"
76FILES_${PN}-perl = "${libdir}/perl"
77FILES_${PN}-tests += "${libdir}/libhugetlbfs/tests" 67FILES_${PN}-tests += "${libdir}/libhugetlbfs/tests"
78 68
79INSANE_SKIP_${PN} = "dev-so" 69INSANE_SKIP_${PN} = "dev-so"