Git Product home page Git Product logo

Comments (7)

WOnder93 avatar WOnder93 commented on August 22, 2024

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.

smuellerDD avatar smuellerDD commented on August 22, 2024

I have contacted Chris Hellwig as he replied to a similar bug report: https://lkml.org/lkml/2018/7/8/142

from libkcapi.

smuellerDD avatar smuellerDD commented on August 22, 2024

from libkcapi.

WOnder93 avatar WOnder93 commented on August 22, 2024

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.

smuellerDD avatar smuellerDD commented on August 22, 2024

from libkcapi.

WOnder93 avatar WOnder93 commented on August 22, 2024

Fully agree, I posted it mainly in case some other distro package maintainer was looking for a quick&dirty temporary fix.

from libkcapi.

WOnder93 avatar WOnder93 commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.