g2p / bcache-tools

bcache-tools, part of the bcache hybrid storage project (features, debian packaging)
http://bcache.evilpiepirate.org/
GNU General Public License v2.0
119 stars 46 forks source link

build fail with gcc 7.3.1 on fedora 27 kernel 4.17.12 #30

Open jrgruher opened 6 years ago

jrgruher commented 6 years ago

[root@neonjoe2 ~]# git clone https://evilpiepirate.org/git/bcache-tools.git Cloning into 'bcache-tools'... remote: Counting objects: 1840, done. remote: Compressing objects: 100% (1119/1119), done. remote: Total 1840 (delta 1090), reused 1240 (delta 688) Receiving objects: 100% (1840/1840), 1.39 MiB | 4.56 MiB/s, done. Resolving deltas: 100% (1090/1090), done.

[root@neonjoe2 ~]# cd bcache-tools/

[root@neonjoe2 bcache-tools]# make cc -O2 -Wall -g pkg-config --cflags uuid blkid -c -o bcache.o bcache.c bcache.c:125:9: warning: ‘crc_table’ is static but used in inline function ‘crc64’ which is not static crc = crc_table[i] ^ (crc << 8); ^~~~~ cc -O2 -Wall -g pkg-config --cflags uuid blkid make-bcache.c bcache.o pkg-config --libs uuid blkid -o make-bcache /tmp/cc8aGXdX.o: In function write_sb': /root/bcache-tools/make-bcache.c:277: undefined reference tocrc64' collect2: error: ld returned 1 exit status make: *** [: make-bcache] Error 1 [root@neonjoe2 bcache-tools]# gcc --verion gcc: error: unrecognized command line option ‘--verion’; did you mean ‘--version’? gcc: fatal error: no input files compilation terminated.

[root@neonjoe2 bcache-tools]# gcc --version gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6) Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@neonjoe2 bcache-tools]# uname -a Linux neonjoe2 4.17.12-100.fc27.x86_64 #1 SMP Fri Aug 3 15:00:33 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@neonjoe2 bcache-tools]# cat /etc/os-release NAME=Fedora VERSION="27 (Server Edition)" ID=fedora VERSION_ID=27 PRETTY_NAME="Fedora 27 (Server Edition)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:27" HOME_URL="https://fedoraproject.org/" SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=27 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=27 PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" VARIANT="Server Edition" VARIANT_ID=server

kpcyrd commented 5 years ago

This patch resolves this issue:

--- 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;

Since this issue is quite old, is bcache-tools still maintained?

LyleLee commented 4 years ago

This patch resolves this issue:

--- 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;

Since this issue is quite old, is bcache-tools still maintained?

Work for me. Thanks!