Comments (7)
Pasting an example of the error here for a quick reference:
In file included from /usr/include/sys/select.h:33,
from /usr/include/sys/types.h:196,
from /usr/include/sys/uio.h:22,
from lib/internal.h:29,
from lib/kcapi-sym.c:21:
/usr/include/bits/types/sigset_t.h:7:20: error: conflicting types for 'sigset_t'
typedef __sigset_t sigset_t;
^~~~~~~~
In file included from /usr/include/linux/signal.h:5,
from /usr/include/linux/aio_abi.h:32,
from lib/internal.h:26,
from lib/kcapi-sym.c:21:
/usr/include/asm/signal.h:16:23: note: previous declaration of 'sigset_t' was here
typedef unsigned long sigset_t;
^~~~~~~~
In file included from /usr/include/sys/select.h:37,
from /usr/include/sys/types.h:196,
from /usr/include/sys/uio.h:22,
from lib/internal.h:29,
from lib/kcapi-sym.c:21:
/usr/include/bits/types/struct_timeval.h:8:8: error: redefinition of 'struct timeval'
struct timeval
^~~~~~~
In file included from /usr/include/asm/signal.h:7,
from /usr/include/linux/signal.h:5,
from /usr/include/linux/aio_abi.h:32,
from lib/internal.h:26,
from lib/kcapi-sym.c:21:
/usr/include/linux/time.h:16:8: note: originally defined here
struct timeval {
^~~~~~~
from libkcapi.
I have contacted Chris Hellwig as he replied to a similar bug report: https://lkml.org/lkml/2018/7/8/142
from libkcapi.
from libkcapi.
Hi Stephan,
that's great! Hopefully it gets fixed in time before the final 4.18 release. In the meantime this patch can be used as a workaround (it is a horrible abuse of include guards, but it works...):
diff --git a/lib/internal.h b/lib/internal.h
index f9df585..b237822 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -23,7 +23,6 @@
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
-#include <linux/aio_abi.h>
#include <stdint.h>
#include <fcntl.h>
#include <sys/uio.h>
@@ -35,6 +34,11 @@
#include <limits.h>
#include <stdio.h>
+/* work around aio_abi.h pulling in headers that conflict with glibc typedefs */
+#define _UAPI_LINUX_SIGNAL_H
+#define _LINUX_SIGNAL_H
+
+#include <linux/aio_abi.h>
#include <linux/if_alg.h>
#include "atomic.h"
It seems that distros (or maybe Kbuild when doing make install...?) are fixing up the include guards in their kernel headers packages, so the patch may not work everywhere. On Fedora the include guard for <linux/signal.h>
is slightly different from upstream (_LINUX_SIGNAL_H
instead of _UAPI_LINUX_SIGNAL_H
), I didn't check other distros.
from libkcapi.
from libkcapi.
Fully agree, I posted it mainly in case some other distro package maintainer was looking for a quick&dirty temporary fix.
from libkcapi.
This issue has been resolved upstream in commit torvalds/linux@9ba546c (v4.18-rc6 and above) so it looks like we can close this.
from libkcapi.
Related Issues (20)
- Questions about dividing data into chunks HOT 5
- key size fixed at 32 bytes (need 52 for CAAM related "black" keys) HOT 3
- AEAD gcm(aes) decrypt failure HOT 15
- AF_ALG bind error HOT 1
- Kernel API patches Status HOT 3
- Specify key length for kcapi-enc HOT 2
- How to configure the cross compiler toolchain? HOT 1
- Where does the function `kcapi_md_final` implement ? HOT 1
- 1.4.0: test suite failis with `error: clang frontend command failed with exit code 139` HOT 19
- Is `kcapi_handle` thread-safe? HOT 4
- Does LibkcAPI support CFB1/CFB8? HOT 2
- vmsplice() with SPLICE_F_GIFT should not be used on memory allocated from the heap (ie. calloc) HOT 2
- Hang on read call in _kcapi_common_read_data
- Can't get `kcapi_akcipher_init` with `rsa` working locally HOT 6
- Why SHA2-256 is the only hash crypto primitive for KDF in linux kernel crypto? HOT 7
- speed-tests: Bench of Asymmetric Cryptographic Algorithms HOT 3
- coreutils, etc. symlinks created in $PREFIX/libexec/libkcapi HOT 3
- 1.4.0: sha*hmac binaries has been removed? 🤔 HOT 9
- DRBG CAVP Issue HOT 2
- Unable to build on busy box HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libkcapi.