linux-crypto.c uses an obsolete macro
contrib/linux-crypto.c
uses the obsoleted macro __linux
. Other sections of the code use the proper macro __linux__
. Using the Predef wiki and GCC-HOWTO as reference.
Observed on RHEL7 PPC64, gcc-8.5.0-16.el8_7.ppc64le:
[25/54] cc -Ilibrist.so.4.2.0.p -I. -I.. -I../src -Iinclude/librist -I../include/librist -Iinclude -I../include -Icontrib -I../contrib -I/usr/include/cjson -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c99 -D_GNU_SOURCE -DLINUX_CRYPTO -Wshadow -pedantic-errors -Wundef -Werror=vla -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wunused-parameter -Wmaybe-uninitialized -Wno-error=deprecated-declarations -fvisibility=hidden -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -funwind-tables -fstack-clash-protection -fPIC -pthread -MD -MQ librist.so.4.2.0.p/contrib_linux-crypto.c.o -MF librist.so.4.2.0.p/contrib_linux-crypto.c.o.d -o librist.so.4.2.0.p/contrib_linux-crypto.c.o -c ../contrib/linux-crypto.c
FAILED: librist.so.4.2.0.p/contrib_linux-crypto.c.o
cc -Ilibrist.so.4.2.0.p -I. -I.. -I../src -Iinclude/librist -I../include/librist -Iinclude -I../include -Icontrib -I../contrib -I/usr/include/cjson -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c99 -D_GNU_SOURCE -DLINUX_CRYPTO -Wshadow -pedantic-errors -Wundef -Werror=vla -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wunused-parameter -Wmaybe-uninitialized -Wno-error=deprecated-declarations -fvisibility=hidden -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -funwind-tables -fstack-clash-protection -fPIC -pthread -MD -MQ librist.so.4.2.0.p/contrib_linux-crypto.c.o -MF librist.so.4.2.0.p/contrib_linux-crypto.c.o.d -o librist.so.4.2.0.p/contrib_linux-crypto.c.o -c ../contrib/linux-crypto.c
../contrib/linux-crypto.c:228: error: ISO C forbids an empty translation unit [-Wpedantic]
#endif
This is the obvious fix:
diff -ur librist-v0.2.7/contrib/linux-crypto.c librist-v0.2.7-linux_macro/contrib/linux-crypto.c
--- librist-v0.2.7/contrib/linux-crypto.c 2022-03-20 08:15:44.000000000 +0100
+++ librist-v0.2.7-linux_macro/contrib/linux-crypto.c 2023-01-23 15:59:06.615570512 +0100
@@ -8,7 +8,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#ifdef __linux
+#ifdef __linux__
#include "linux-crypto.h"
struct linux_crypto {