Git Product home page Git Product logo

Comments (4)

smuellerDD avatar smuellerDD commented on August 22, 2024

Am Dienstag, 7. Juli 2015, 14:29:05 schrieb fijam:

Hi fijam,

Perhaps I am doing something silly, but I can't figure it out.

gcc --version
gcc (Debian 4.9.2-10) 4.9.2

uname -a
Linux 4.0.0-2-kirkwood #1 Debian 4.0.7-1 (2015-07-06) armv5tel GNU/Linux

make:
https://gist.github.com/fijam/72c6c347b2a3705c59bf

Well, there seems to be multiple answers to it:

  1. Did you change the Makefile? It looks like it as it includes the kernel
    headers directly which is not advisable. It should always include the C-lib
    headers from /usr/include.
  2. If you use the kernel headers, was the kernel configured? It seems not as
    the compile breaks at the asm part where asm-generic/types.h and its dependent
    headers want to define u64 or s64. The used header seems to be not applicable
    for the ARM system.

The best is to use an unchanged Makefile and to have C-lib headers installed
for compilation.


Reply to this email directly or view it on GitHub:
#1

Ciao
Stephan

from libkcapi.

fijam avatar fijam commented on August 22, 2024

Hi and thanks for the quick reply.

Sorry for not mentioning it earlier, but I modified the file to include asm/page.h and added the path to kernel headers as otherwise the build fails with:

https://gist.github.com/fijam/accae4d7dc6f334b4fc3

I thought PAGE_SIZE is only provided by page.h from the kernel, but it seems that was the wrong assumption?

from libkcapi.

smuellerDD avatar smuellerDD commented on August 22, 2024

Am Mittwoch, 8. Juli 2015, 00:53:56 schrieb fijam:

Hi fijam,

Hi and thanks for the quick reply.

Sorry for not mentioning it earlier, but I modified the file to include
<asm/page.h> and added the path to kernel headers as otherwise the build
fails with:

gcc -Wextra -Wall -pedantic -Wno-overlength-strings -pie -fPIE -O2 -g
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -fwrapv --param
ssp-buffer-size=4 -I../lib -c -o kcapi-main.o kcapi-main.c kcapi-main.c:
In function ‘cavs_sym’:
kcapi-main.c:408:39: error: ‘PAGE_SIZE’ undeclared (first use in this
function) if (posix_memalign((void )&outbuf, PAGE_SIZE, outbuflen))
^
kcapi-main.c:408:39: note: each undeclared identifier is reported only once
for each function it appears in kcapi-main.c: In function ‘cavs_sym_stream’:
kcapi-main.c:488:39: error: ‘PAGE_SIZE’ undeclared (first use in this
function) if (posix_memalign((void *)&outbuf, PAGE_SIZE, outbuflen))
^
kcapi-main.c: In function ‘cavs_aead’:
kcapi-main.c:626:39: error: ‘PAGE_SIZE’ undeclared (first use in this
function) if (posix_memalign((void *)&outbuf, PAGE_SIZE, outbuflen))
^
kcapi-main.c: In function ‘cavs_aead_stream’:
kcapi-main.c:780:39: error: ‘PAGE_SIZE’ undeclared (first use in this
function) if (posix_memalign((void *)&outbuf, PAGE_SIZE, outbuflen))
^
kcapi-main.c: In function ‘cavs_aead_large’:
kcapi-main.c:989:42: error: ‘PAGE_SIZE’ undeclared (first use in this
function) if (posix_memalign((void *)&test.assoc, PAGE_SIZE, (16 *
PAGE_SIZE))) ^
: recipe for target 'kcapi-main.o' failed
make: *
* [kcapi-main.o] Error 1

I thought PAGE_SIZE is only provided by page.h from the kernel, but it seems
that was the wrong assumption?

Rule of thumb: never link with the kernel includes directly. And if you must,
then only with the uapi/ includes.

I am wondering why your Clib does not define it. Can you please grep your
/usr/include tree to see where it is? If you find it, can you please let me
know which include must be pulled?

In any case, it is better to take this one definition out of the kernel and
into a private header file.


Reply to this email directly or view it on GitHub:
#1 (comment)

Ciao
Stephan

from libkcapi.

fijam avatar fijam commented on August 22, 2024

Apparently the PAGE_SIZE macro is not available on my platform. As a workaround I added

#define PAGE_SIZE sysconf(_SC_PAGESIZE)

and now it builds correctly.

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.