diff options
author | Kai Kang <kai.kang@windriver.com> | 2013-08-13 17:57:49 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-16 11:18:07 +0100 |
commit | ecfe97741fc93dd856e424492d5ade4902671c7f (patch) | |
tree | 8c65747ff8532fe2a4e504a2ae8e8fad0344b07d /meta/recipes-devtools | |
parent | c46300e08cb483ae2acd6219edc79a614820fb6f (diff) | |
download | poky-ecfe97741fc93dd856e424492d5ade4902671c7f.tar.gz |
dpkg: fix include header caused compile error
Build dpkg-native on Fedora 19, it fails with:
/usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’:
/usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with
abs(long long __x) { return __builtin_llabs (__x); }
^
/usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here
abs(long __i) { return __builtin_labs(__i); }
^
That because header cstdlib is included in a 'extern "C"' block that gcc
4.8 doesn't support. Fix it by move the header file out of the 'extern "C"'
block.
(From OE-Core master rev: 7de61ecc3efc43c625dde9a66f5c05e980a82e34)
(From OE-Core rev: 0e60a468c1a81642d4319c0831dafd2f6fa43d86)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch | 40 | ||||
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg_1.16.9.bb | 4 |
2 files changed, 43 insertions, 1 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch new file mode 100644 index 0000000000..e73311c294 --- /dev/null +++ b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | dpkg defines: | ||
4 | #define DPKG_BEGIN_DECLS extern "C" { | ||
5 | |||
6 | That makes header cstdlib included in a extern "C" block which is not supported | ||
7 | by gcc 4.8. It fails on Fedora 19: | ||
8 | |||
9 | /usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’: | ||
10 | /usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with | ||
11 | abs(long long __x) { return __builtin_llabs (__x); } | ||
12 | ^ | ||
13 | /usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here | ||
14 | abs(long __i) { return __builtin_labs(__i); } | ||
15 | ^ | ||
16 | |||
17 | Move include gettext.h out of the extern "C" block to fix this issue. | ||
18 | |||
19 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
20 | |||
21 | --- dpkg-1.17.1/lib/dpkg/i18n.h.orig 2013-08-13 17:31:28.870935573 +0800 | ||
22 | +++ dpkg-1.17.1/lib/dpkg/i18n.h 2013-08-13 17:31:37.893065249 +0800 | ||
23 | @@ -23,8 +23,6 @@ | ||
24 | |||
25 | #include <dpkg/macros.h> | ||
26 | |||
27 | -DPKG_BEGIN_DECLS | ||
28 | - | ||
29 | /** | ||
30 | * @defgroup i18n Internationalization support | ||
31 | * @ingroup dpkg-internal | ||
32 | @@ -33,6 +31,8 @@ | ||
33 | |||
34 | #include <gettext.h> | ||
35 | |||
36 | +DPKG_BEGIN_DECLS | ||
37 | + | ||
38 | /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h | ||
39 | * which gets pulled by gettext.h only includes it if building optimized. */ | ||
40 | #include <locale.h> | ||
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.16.9.bb b/meta/recipes-devtools/dpkg/dpkg_1.16.9.bb index 9ae4042dae..151fb69497 100644 --- a/meta/recipes-devtools/dpkg/dpkg_1.16.9.bb +++ b/meta/recipes-devtools/dpkg/dpkg_1.16.9.bb | |||
@@ -6,7 +6,9 @@ SRC_URI += "file://noman.patch \ | |||
6 | file://check_version.patch \ | 6 | file://check_version.patch \ |
7 | file://preinst.patch \ | 7 | file://preinst.patch \ |
8 | file://fix-timestamps.patch \ | 8 | file://fix-timestamps.patch \ |
9 | file://remove-tar-no-timestamp.patch" | 9 | file://remove-tar-no-timestamp.patch \ |
10 | file://fix-abs-redefine.patch \ | ||
11 | " | ||
10 | 12 | ||
11 | SRC_URI[md5sum] = "4df9319b2d17e19cdb6fe94dacee44da" | 13 | SRC_URI[md5sum] = "4df9319b2d17e19cdb6fe94dacee44da" |
12 | SRC_URI[sha256sum] = "73cd7fba4e54acddd645346b4bc517030b9c35938e82215d3eeb8b4e7af26b7a" | 14 | SRC_URI[sha256sum] = "73cd7fba4e54acddd645346b4bc517030b9c35938e82215d3eeb8b4e7af26b7a" |