summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2011-12-06 10:04:32 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-12 21:50:18 +0000
commit800f7e43523ed6156e2dde3b928aae8c10f2ee7e (patch)
treecbf4e29d3e3094dda1374af7fcee766af46e09e6 /meta/recipes-extended
parent3424702c09218acf4f3c265f427c4a7ab129bce9 (diff)
downloadpoky-800f7e43523ed6156e2dde3b928aae8c10f2ee7e.tar.gz
pax: fix compilation with x32 toolchain
off_t is 8byte for x32. We need to check both _FILE_OFFSET_BITS and size of off_t to see if file offset is 64bit. This patch adds AC_CHECK_SIZEOF(off_t) and checks SIZEOF_OFF_T == 8. (From OE-Core rev: 4c2ec631bf2b9581233a470c415f4d5cfe59a2a4) Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch185
-rw-r--r--meta/recipes-extended/pax/pax_3.4.bb5
2 files changed, 188 insertions, 2 deletions
diff --git a/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch b/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
new file mode 100644
index 0000000000..11dfa0f30f
--- /dev/null
+++ b/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
@@ -0,0 +1,185 @@
1UpstreamStatus: Pending
2
3Author: H.J. Lu <hjl.tools@gmail.com>
4Date: Tue Dec 6 10:34:53 2011 -0800
5
6 Fix pax-3.4 build for x32
7
8 off_t is 8byte for x32. We need to check both _FILE_OFFSET_BITS and
9 size of off_t to see if file offset is 64bit. This patch adds
10 AC_CHECK_SIZEOF(off_t) and checks SIZEOF_OFF_T == 8.
11
12Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/06
13
14Index: pax-3.4/configure.in
15===================================================================
16--- pax-3.4.orig/configure.in
17+++ pax-3.4/configure.in
18@@ -33,4 +33,7 @@ dnl Checks for header files.
19 dnl Checks for typedefs, structures, and compiler characteristics.
20 AC_C_CONST
21
22+AC_CHECK_SIZEOF(off_t)
23+AC_CHECK_SIZEOF(long)
24+
25 AC_OUTPUT([Makefile lib/Makefile src/Makefile])
26Index: pax-3.4/src/ar_io.c
27===================================================================
28--- pax-3.4.orig/src/ar_io.c
29+++ pax-3.4/src/ar_io.c
30@@ -378,7 +378,8 @@ ar_close(void)
31 * could have written anything yet.
32 */
33 if (frmt == NULL) {
34-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
35+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
36+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
37 (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
38 #else
39 (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
40@@ -391,7 +392,8 @@ ar_close(void)
41
42 if (strcmp(NM_CPIO, argv0) == 0)
43 (void)fprintf(listf,
44-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
45+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
46+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
47 "%qu blocks\n",
48 #else
49 "%lu blocks\n",
50@@ -399,7 +401,8 @@ ar_close(void)
51 (rdcnt ? rdcnt : wrcnt) / 5120);
52 else if (strcmp(NM_TAR, argv0) != 0)
53 (void)fprintf(listf,
54-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
55+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
56+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
57 "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
58 #else
59 "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
60Index: pax-3.4/src/cpio.c
61===================================================================
62--- pax-3.4.orig/src/cpio.c
63+++ pax-3.4/src/cpio.c
64@@ -218,7 +218,8 @@ rd_ln_nm (ARCHD *arcn)
65 */
66 if ((arcn->sb.st_size == 0) ||
67 (arcn->sb.st_size >= (off_t) sizeof(arcn->ln_name))) {
68-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
69+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
70+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
71 paxwarn (1, "Cpio link name length is invalid: %qu",
72 arcn->sb.st_size);
73 #else
74Index: pax-3.4/src/gen_subs.c
75===================================================================
76--- pax-3.4.orig/src/gen_subs.c
77+++ pax-3.4/src/gen_subs.c
78@@ -133,7 +133,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
79 * print device id's for devices, or sizes for other nodes
80 */
81 if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
82-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
83+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
84+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
85 (void) fprintf (fp, "%4lu,%4lu ", (unsigned long) MAJOR (sbp->st_rdev),
86 (unsigned long) MINOR (sbp->st_rdev));
87 #else
88@@ -142,7 +143,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
89 #endif
90 else
91 {
92-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
93+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
94+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
95 (void) fprintf (fp, "%9qu ", sbp->st_size);
96 #else
97 (void) fprintf (fp, "%9lu ", sbp->st_size);
98@@ -334,7 +336,8 @@ ul_asc (u_long val, char *str, int len,
99 return (0);
100 }
101
102-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
103+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
104+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
105 /*
106 * asc_uqd()
107 * convert hex/octal character string into a u_quad_t. We do not have to
108Index: pax-3.4/src/options.c
109===================================================================
110--- pax-3.4.orig/src/options.c
111+++ pax-3.4/src/options.c
112@@ -1545,7 +1545,8 @@ str_offt (char *val)
113 char *expr;
114 off_t num, t;
115
116-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
117+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
118+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
119 num = strtoq (val, &expr, 0);
120 if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
121 #else
122Index: pax-3.4/src/tar.c
123===================================================================
124--- pax-3.4.orig/src/tar.c
125+++ pax-3.4/src/tar.c
126@@ -58,7 +58,8 @@
127 static unsigned long tar_chksm (char *, int);
128 static char *name_split (char *, int);
129 static int ul_oct (u_long, char *, int, int);
130-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
131+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
132+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
133 static int uqd_oct (u_quad_t, char *, int, int);
134 #endif
135
136@@ -196,7 +197,8 @@ ul_oct (u_long val, register char *str,
137 return (0);
138 }
139
140-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
141+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
142+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
143 /*
144 * uqd_oct()
145 * convert an u_quad_t to an octal string. one of many oddball field
146@@ -427,7 +429,8 @@ tar_rd (ARCHD *arcn, char *buf)
147 0xfff);
148 arcn->sb.st_uid = (uid_t) asc_ul (hd->uid, sizeof (hd->uid), OCT);
149 arcn->sb.st_gid = (gid_t) asc_ul (hd->gid, sizeof (hd->gid), OCT);
150-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
151+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
152+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
153 arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
154 #else
155 arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
156@@ -659,7 +662,8 @@ tar_wr (register ARCHD * arcn)
157 * data follows this file, so set the pad
158 */
159 hd->linkflag = AREGTYPE;
160-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
161+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
162+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
163 if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
164 sizeof (hd->size), 1))
165 #else
166@@ -834,7 +838,8 @@ ustar_rd (ARCHD *arcn, char *buf)
167 */
168 arcn->sb.st_mode = (mode_t) (asc_ul (hd->mode, sizeof (hd->mode), OCT) &
169 0xfff);
170-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
171+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
172+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
173 arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
174 #else
175 arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
176@@ -1081,7 +1086,8 @@ ustar_wr (register ARCHD * arcn)
177 else
178 hd->typeflag = REGTYPE;
179 arcn->pad = TAR_PAD (arcn->sb.st_size);
180-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
181+#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
182+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
183 if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
184 sizeof (hd->size), 3))
185 {
diff --git a/meta/recipes-extended/pax/pax_3.4.bb b/meta/recipes-extended/pax/pax_3.4.bb
index e9c70d6fda..0c10688feb 100644
--- a/meta/recipes-extended/pax/pax_3.4.bb
+++ b/meta/recipes-extended/pax/pax_3.4.bb
@@ -10,10 +10,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4b0b674dfdc56daa3832d4069b820ea0 \
10 file://lib/vis.h;endline=40;md5=b283f759abd4a5ad7e014b80f51fc053" 10 file://lib/vis.h;endline=40;md5=b283f759abd4a5ad7e014b80f51fc053"
11 11
12SECTION = "base" 12SECTION = "base"
13PR = "r1" 13PR = "r2"
14 14
15SRC_URI = "ftp://ftp.suse.com/pub/people/kukuk/pax/pax-${PV}.tar.bz2 \ 15SRC_URI = "ftp://ftp.suse.com/pub/people/kukuk/pax/pax-${PV}.tar.bz2 \
16 file://fix_for_compile_with_gcc-4.6.0.patch" 16 file://fix_for_compile_with_gcc-4.6.0.patch \
17 file://pax-3.4_fix_for_x32.patch"
17 18
18SRC_URI[md5sum] = "fbd9023b590b45ac3ade95870702a0d6" 19SRC_URI[md5sum] = "fbd9023b590b45ac3ade95870702a0d6"
19SRC_URI[sha256sum] = "ac3c06048e02828077cf7757d3d142241429238893b91d529af29a2e8cc5623b" 20SRC_URI[sha256sum] = "ac3c06048e02828077cf7757d3d142241429238893b91d529af29a2e8cc5623b"