SRU: Fix mismatched extern "C" block for aarch64
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Fix Released
|
Medium
|
|||
gcc-9 (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Focal |
Fix Released
|
High
|
Unassigned | ||
Impish |
Fix Released
|
High
|
Unassigned | ||
Jammy |
Fix Released
|
High
|
Unassigned | ||
gcc-9-cross (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Description ]
Compile on focal fails with:
/<<PKGBUILDDIR>
363 | template<void (*CRC32)(uint64_t*, uint8_t const**)>
| ^~~~~~~~
In file included from /<<PKGBUILDDIR>
/usr/lib/
33 | extern "C" {
| ^~~~~~~~~~
This is fixed here:
https:/
[ Test Case ]
Compiling ceph for the yoga cloud archive fails with the error above and will be successful with the patch applied.
[ Regression Potential ]
This is actually fixing a regression. The patch that is picked has already landed upstream. It is also architecture specific, only seen on arm64.
Changed in gcc-9 (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
description: | updated |
Changed in gcc-9 (Ubuntu Impish): | |
status: | New → Triaged |
Changed in gcc-9 (Ubuntu Focal): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in gcc-9 (Ubuntu Impish): | |
importance: | Undecided → High |
tags: | added: patch |
Changed in gcc-9-cross (Ubuntu Jammy): | |
status: | New → Fix Released |
summary: |
- Fix mismatched extern "C" block for aarch64 + SRU: Fix mismatched extern "C" block for aarch64 |
description: | updated |
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Build rocksdb with GCC 9.4.0: /github. com/facebook/ rocksdb. git
# git clone https:/
# cd rocksdb
# make static_lib
Log as below: ======= ======= ======= ======= ======= ======= === cc:371: 1: error: template with C linkage crc32c_ arm64.h: 16,
from util/crc32c.cc:21: gcc/aarch64- linux-gnu/ 9/include/ arm_acle. h:33:1: note: ‘extern "C"’ linkage started here cc:503: 13: error: conflicting declaration of ‘std::string rocksdb: :crc32c: :IsFastCrc32Sup ported( )’ with ‘C’ linkage orted() { ~~~~~~~ ~~~~~~ crc32c. h:20:20: note: previous declaration with ‘C++’ linkage orted() ; ~~~~~~~ ~~~~~~ cc:1277: 10: error: conflicting declaration of ‘uint32_t rocksdb: :crc32c: :Extend( uint32_ t, const char*, size_t)’ with ‘C’ linkage crc32c. h:25:17: note: previous declaration with ‘C++’ linkage cc:1283: 1: error: expected ‘}’ at end of input crc32c_ arm64.h: 16,
from util/crc32c.cc:21: gcc/aarch64- linux-gnu/ 9/include/ arm_acle. h:33:12: note: to match this ‘{’ ======= ======= ======= ======= ======= ======= ======= ===
=======
$DEBUG_LEVEL is 0
CC util/crc32c.o
util/crc32c.
371 | template<void (*CRC32)(uint64_t*, uint8_t const**)>
| ^~~~~~~~
In file included from ./util/
/usr/lib/
33 | extern "C" {
| ^~~~~~~~~~
util/crc32c.
503 | std::string IsFastCrc32Supp
| ^~~~~~~
In file included from util/crc32c.cc:12:
./util/
20 | extern std::string IsFastCrc32Supp
| ^~~~~~~
util/crc32c.
1277 | uint32_t Extend(uint32_t crc, const char* buf, size_t size) {
| ^~~~~~
In file included from util/crc32c.cc:12:
./util/
25 | extern uint32_t Extend(uint32_t init_crc, const char* data, size_t n);
| ^~~~~~
util/crc32c.
1283 | } // namespace ROCKSDB_NAMESPACE
| ^
In file included from ./util/
/usr/lib/
33 | extern "C" {
| ^
Makefile:2272: recipe for target 'util/crc32c.o' failed
make: *** [util/crc32c.o] Error 1
=======
The latest patch of GCC 9.4.0 release: https:/ /github. com/gcc- mirror/ gcc/commit/ 6f06be1769d4535 9940c60517f9d55 bedd3cb1f4# diff-64cabf812b 3706ffd3c5ab7c6 048c3617a406f02 9631d0427d3cfb8 96fd8dbf3R32 introduce a lonely induce that build issue:
#ifdef __cplusplus
extern "C" {
#endif