[PATCH 1/4] bcache-tools: change bcache.c:crc64() to non-inline function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bcache.o is used as a static lib but not explicitly compile and linked as
position independent code. The only routine in bcache.c is inline function
crc64(). For gcc 7.X this inline function will be optimized out in such
situation, and when linking bcache.o to make-bcache or bcache-show-super
there will be an error "no reference to crc64()".

The simplest way to fix the compiling failure is to change crc64() to be
a non-inline function, then there will be an entry of crc64() in symbols
table of bcache.o.

Signed-off-by: Coly Li <colyli@xxxxxxx>
---
 bcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bcache.c b/bcache.c
index 8f37445..8b4b986 100644
--- a/bcache.c
+++ b/bcache.c
@@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = {
 	0x9AFCE626CE85B507ULL
 };
 
-inline uint64_t crc64(const void *_data, size_t len)
+uint64_t crc64(const void *_data, size_t len)
 {
 	uint64_t crc = 0xFFFFFFFFFFFFFFFFULL;
 	const unsigned char *data = _data;
-- 
2.16.2




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux