summaryrefslogtreecommitdiffstats
path: root/meta-filesystems
diff options
context:
space:
mode:
authorJianchuan Wang <jianchuan.wang@windriver.com>2015-07-29 10:46:59 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-08-18 11:38:02 +0200
commit8979be15071a7c6f53371d0cbe209362c9620a45 (patch)
tree339aa343efb0f35647ba2bc81de3929eccc34d68 /meta-filesystems
parent175fb665516874a0b196efd9a77795ee70083c68 (diff)
downloadmeta-openembedded-8979be15071a7c6f53371d0cbe209362c9620a45.tar.gz
xfsprogs: Uprev to 3.2.3 version
In the v3.2.3, the libhandle.so/libhandle.a paths have changed so that We need not rm them in the install processing. Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-filesystems')
-rw-r--r--meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch170
-rw-r--r--meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.2.3.bb (renamed from meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.1.11.bb)10
2 files changed, 173 insertions, 7 deletions
diff --git a/meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch b/meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch
new file mode 100644
index 000000000..b204195bf
--- /dev/null
+++ b/meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch
@@ -0,0 +1,170 @@
1From e58cb210a7c15352040a411d11a8383eac0defda Mon Sep 17 00:00:00 2001
2From: Jianchuan Wang <jianchuan.wang@windriver.com>
3Date: Tue, 30 Sep 2014 12:16:17 +0800
4Subject: [PATCH] xfsprogs: generate crctable which is moved into runtime from
5 compile
6
7After upgraded, There is a compile error except x86,
8Because crc32.c need two arraies crc32table_le and crc32ctable_le from crc32table.h,
9which are generated by gen_crc32table.c relative to different platforms.
10For this, move the function implementation from gen_crc32table.c to crc.c
11
12Upstream-Status: Pending
13
14Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
15---
16 libxfs/Makefile | 23 ++----------------
17 libxfs/crc32.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
18 2 files changed, 75 insertions(+), 23 deletions(-)
19
20diff --git a/libxfs/Makefile b/libxfs/Makefile
21index ae15a5d..7670159 100644
22--- a/libxfs/Makefile
23+++ b/libxfs/Makefile
24@@ -10,7 +10,7 @@ LT_CURRENT = 0
25 LT_REVISION = 0
26 LT_AGE = 0
27
28-HFILES = xfs.h init.h xfs_dir2_priv.h crc32defs.h crc32table.h
29+HFILES = xfs.h init.h xfs_dir2_priv.h crc32defs.h
30 CFILES = cache.c \
31 crc32.c \
32 init.c kmem.c logitem.c radix-tree.c rdwr.c trans.c util.c \
33@@ -43,7 +43,6 @@ CFILES = cache.c \
34 CFILES += $(PKG_PLATFORM).c
35 PCFILES = darwin.c freebsd.c irix.c linux.c
36 LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
37-LSRCFILES += gen_crc32table.c
38
39 #
40 # Tracing flags:
41@@ -61,25 +60,7 @@ LTLIBS = $(LIBPTHREAD) $(LIBRT)
42 # don't try linking xfs_repair with a debug libxfs.
43 DEBUG = -DNDEBUG
44
45-LDIRT = gen_crc32table crc32table.h crc32selftest
46-
47-default: crc32selftest ltdepend $(LTLIBRARY)
48-
49-crc32table.h: gen_crc32table.c
50- @echo " [CC] gen_crc32table"
51- $(Q) $(CC) $(CFLAGS) -o gen_crc32table $<
52- @echo " [GENERATE] $@"
53- $(Q) ./gen_crc32table > crc32table.h
54-
55-# The selftest binary will return an error if it fails. This is made a
56-# dependency of the build process so that we refuse to build the tools on broken
57-# systems/architectures. Hence we make sure that xfsprogs will never use a
58-# busted CRC calculation at build time and hence avoid putting bad CRCs down on
59-# disk.
60-crc32selftest: gen_crc32table.c crc32table.h crc32.c
61- @echo " [TEST] CRC32"
62- $(Q) $(CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
63- $(Q) ./$@
64+default: ltdepend $(LTLIBRARY)
65
66 include $(BUILDRULES)
67
68diff --git a/libxfs/crc32.c b/libxfs/crc32.c
69index 0f847d2..be5fbc3 100644
70--- a/libxfs/crc32.c
71+++ b/libxfs/crc32.c
72@@ -55,8 +55,6 @@ typedef __u32 u64;
73 # define tobe(x) (x)
74 #endif
75
76-#include "crc32table.h"
77-
78 #if CRC_LE_BITS > 8 || CRC_BE_BITS > 8
79
80 /* implements slicing-by-4 or slicing-by-8 algorithm */
81@@ -183,13 +181,86 @@ u32 __pure crc32c_le(u32 crc, unsigned char const *p, size_t len)
82 return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE);
83 }
84 #else
85+
86+#include <stdio.h>
87+#include "crc32defs.h"
88+#include <inttypes.h>
89+
90+#define ENTRIES_PER_LINE 4
91+
92+#if CRC_LE_BITS > 8
93+# define LE_TABLE_ROWS (CRC_LE_BITS/8)
94+# define LE_TABLE_SIZE 256
95+#else
96+# define LE_TABLE_ROWS 1
97+# define LE_TABLE_SIZE (1 << CRC_LE_BITS)
98+#endif
99+
100+#if CRC_BE_BITS > 8
101+# define BE_TABLE_ROWS (CRC_BE_BITS/8)
102+# define BE_TABLE_SIZE 256
103+#else
104+# define BE_TABLE_ROWS 1
105+# define BE_TABLE_SIZE (1 << CRC_BE_BITS)
106+#endif
107+
108+static uint32_t crc32table_le[LE_TABLE_ROWS][256];
109+static uint32_t crc32ctable_le[LE_TABLE_ROWS][256];
110+
111+static uint32_t crc32table_le_init = 0;
112+static uint32_t crc32ctable_le_init = 0;
113+
114+/*
115+ * big endian ordered CRC not used by XFS.
116+static uint32_t crc32table_be[BE_TABLE_ROWS][256];
117+ */
118+
119+/**
120+ * crc32init_le() - allocate and initialize LE table data
121+ *
122+ * crc is the crc of the byte i; other entries are filled in based on the
123+ * fact that crctable[i^j] = crctable[i] ^ crctable[j].
124+ *
125+ */
126+static void crc32init_le_generic(const uint32_t polynomial,
127+ uint32_t (*tab)[256])
128+{
129+ unsigned i, j;
130+ uint32_t crc = 1;
131+
132+ tab[0][0] = 0;
133+
134+ for (i = LE_TABLE_SIZE >> 1; i; i >>= 1) {
135+ crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0);
136+ for (j = 0; j < LE_TABLE_SIZE; j += 2 * i)
137+ tab[0][i + j] = crc ^ tab[0][j];
138+ }
139+ for (i = 0; i < LE_TABLE_SIZE; i++) {
140+ crc = tab[0][i];
141+ for (j = 1; j < LE_TABLE_ROWS; j++) {
142+ crc = tab[0][crc & 0xff] ^ (crc >> 8);
143+ tab[j][i] = crc;
144+ }
145+ }
146+}
147+
148 u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
149 {
150+ if (crc32table_le_init == 0) {
151+ crc32init_le_generic(CRCPOLY_LE, crc32table_le);
152+ crc32table_le_init == 1;
153+ }
154+
155 return crc32_le_generic(crc, p, len,
156 (const u32 (*)[256])crc32table_le, CRCPOLY_LE);
157 }
158 u32 __pure crc32c_le(u32 crc, unsigned char const *p, size_t len)
159 {
160+ if (crc32ctable_le_init == 0) {
161+ crc32init_le_generic(CRC32C_POLY_LE, crc32ctable_le);
162+ crc32ctable_le_init == 1;
163+ }
164+
165 return crc32_le_generic(crc, p, len,
166 (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE);
167 }
168--
1691.9.1
170
diff --git a/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.1.11.bb b/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.2.3.bb
index fcf8f12bb..8df7bc12e 100644
--- a/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.1.11.bb
+++ b/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.2.3.bb
@@ -7,12 +7,13 @@ LIC_FILES_CHKSUM = "file://doc/COPYING;md5=dbdb5f4329b7e7145de650e9ecd4ac2a"
7DEPENDS = "util-linux" 7DEPENDS = "util-linux"
8 8
9SRC_URI = "ftp://oss.sgi.com/projects/xfs/cmd_tars/${BP}.tar.gz \ 9SRC_URI = "ftp://oss.sgi.com/projects/xfs/cmd_tars/${BP}.tar.gz \
10 file://xfsprogs-generate-crctable-which-is-moved-into-runti.patch \
10 file://remove-install-as-user.patch \ 11 file://remove-install-as-user.patch \
11 file://drop-configure-check-for-aio.patch \ 12 file://drop-configure-check-for-aio.patch \
12" 13"
13 14
14SRC_URI[md5sum] = "de9f1f45026c2f4e0776058d429ff4b6" 15SRC_URI[md5sum] = "9f383e36682709e62b12c125e5d8b895"
15SRC_URI[sha256sum] = "adf4980177b5c890c1ca86b9c0e3e4d69a3f95bfc01746844280c2393cf4d6be" 16SRC_URI[sha256sum] = "7a5124a880997939551b519610a2e54bd4cd0b0adfd563ce3f4de30827109ac9"
16 17
17inherit autotools-brokensep 18inherit autotools-brokensep
18 19
@@ -48,9 +49,4 @@ do_install () {
48 oe_runmake install 49 oe_runmake install
49 # needed for xfsdump 50 # needed for xfsdump
50 oe_runmake install-dev 51 oe_runmake install-dev
51 rm ${D}${base_libdir}/libhandle.a
52 rm ${D}${base_libdir}/libhandle.la
53 rm ${D}${base_libdir}/libhandle.so
54 rm ${D}${libdir}/libhandle.so
55 ln -s ../..${base_libdir}/libhandle.so.1 ${D}${libdir}/libhandle.so
56} 52}