Comments (4)
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.2uname -a
Linux 4.0.0-2-kirkwood #1 Debian 4.0.7-1 (2015-07-06) armv5tel GNU/Linux
Well, there seems to be multiple answers to it:
- 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. - 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.
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.
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 1I 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.
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)
- 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.