[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

--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux