Bug #12831
closedcompile failed on gcc-4.8 and boost-1.53
0%
Description
I pull the latest ceph master branch and compile , it's failed,
my configure cmd:
$ ./configure CC=/root/gcc-4.8/usr/local/bin/gcc CXX=/root/gcc-4.8/usr/local/bin/g++ --no-create --no-recursion
1)compile error output
libtool: link: warning: library `/root/gcc-4.8/usr/local/bin/../lib/gcc/x86_64-unknown-linux-
gnu/4.8.0/../../../../lib64/libstdc++.la' was moved.
libtool: link: warning: library `/root/gcc-4.8/usr/local/bin/../lib/gcc/x86_64-unknown-linux-
gnu/4.8.0/../../../../lib64/libstdc++.la' was moved.
/home/huangjun/ceph/src/.libs/librbd.so: undefined reference to `ceph::buffer::list::copy_in(unsigned int, unsigned int, char const*)'
collect2: error: ld returned 1 exit status
make3: * [rbd-replay] Error 1
make3: Leaving directory `/home/huangjun/ceph/src'
make2: * [all-recursive] Error 1
make2: Leaving directory `/home/huangjun/ceph/src'
tools/rados/PoolDump.o: In function `_ZN9RadosDump12write_simpleEhi.isra.161':
/home/huangjun/ceph/src/./tools/RadosDump.h:95: undefined reference to `ceph::buffer::list::iterator::copy_in
(unsigned int, char const*)'
tools/rados/PoolDump.o: In function `write_section<data_section>':
/home/huangjun/ceph/src/./tools/RadosDump.h:208: undefined reference to `ceph::buffer::list::iterator::copy_in
(unsigned int, char const*)'
tools/rados/PoolDump.o: In function `encode':
/home/huangjun/ceph/src/./tools/RadosDump.h:95: undefined reference to `ceph::buffer::list::iterator::copy_in
(unsigned int, char const*)'
tools/rados/PoolDump.o: In function `write_section<data_section>':
/home/huangjun/ceph/src/./tools/RadosDump.h:114: undefined reference to `ceph::buffer::list::iterator::copy_in
(unsigned int, char const*)'
tools/rados/PoolDump.o: In function `encode':
/home/huangjun/ceph/src/./tools/RadosDump.h:272: undefined reference to `ceph::buffer::list::iterator::copy_in
(unsigned int, char const*)'
tools/rados/PoolDump.o:/home/huangjun/ceph/src/./tools/RadosDump.h:114: more undefined references to
`ceph::buffer::list::iterator::copy_in(unsigned int, char const*)' follow
./.libs/libradosstriper.so: undefined reference to `ceph::buffer::ptr::zero()'
collect2: error: ld returned 1 exit status
make3: * [rados] Error 1
make3: Waiting for unfinished jobs....
make3: Leaving directory `/home/huangjun/ceph/src'
make2: ** [all-recursive] Error 1
make2: Leaving directory `/home/huangjun/ceph/src'
PS:
we defined like this:
void buffer::list::iterator::copy_in(unsigned len, const char *src, bool crc_reset = true)
but it called:
ceph::buffer::list::iterator::copy_in(unsigned int, char const*)
2) compile warning
os/Transaction.cc: In member function ‘void ObjectStore::Transaction::_build_actions_from_tbl()’:
os/Transaction.cc:287:33: warning: ‘void ObjectStore::Transaction::collection_move(coll_t, coll_t, const
ghobject_t&)’ is deprecated (declared at os/ObjectStore.h:1245) [-Wdeprecated-declarations]
collection_move(ncid, ocid, oid);
Updated by Loïc Dachary over 8 years ago
- Status changed from New to Rejected
I verified it works with gcc-4.8 and boost-1.53, the problem comes from your environment.
Updated by hongwei bi over 8 years ago
About the compile warning :
2) compile warning
os/Transaction.cc: In member function ‘void ObjectStore::Transaction::_build_actions_from_tbl()’:
os/Transaction.cc:287:33: warning: ‘void ObjectStore::Transaction::collection_move(coll_t, coll_t, const
ghobject_t&)’ is deprecated (declared at os/ObjectStore.h:1245) [-Wdeprecated-declarations]
collection_move(ncid, ocid, oid);
The warning message appeared because We use collection_move which has deprecated attribute. So I offer two solutions:
1 add #pragma GCC diagnostic ignored "-Wdeprecated-declarations" in Transaction.cc, as the following patch:
--- a/src/os/Transaction.cc
+++ b/src/os/Transaction.cc@ -284,7 +284,10
@ void ObjectStore::Transaction::_build_actions_from_tbl()
assert(ocid2 ocid);
assert(oid2 oid);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
collection_move(ncid, ocid, oid);
+#pragma GCC diagnostic pop
2 just add some code comments in ObjectStore.h, as the following patch:
--- a/src/os/ObjectStore.h
++ b/src/os/ObjectStore.h@ -1244,6 +1244,11
@ public:
}
data.ops+;
}
/**
+ * Note: here we use deprecated attribute, so there will be a
+ * warning when compile the code.
+ */
void collection_move(coll_t cid, coll_t oldcid, const ghobject_t& oid)