Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile failed using OpenWRT, have to change CMakefiles.txt #1018

Open
1 of 2 tasks
jannson opened this issue Jul 28, 2023 · 2 comments
Open
1 of 2 tasks

Cross compile failed using OpenWRT, have to change CMakefiles.txt #1018

jannson opened this issue Jul 28, 2023 · 2 comments

Comments

@jannson
Copy link

jannson commented Jul 28, 2023

Describe the bug

I can build package from source in OpenWRT SDK.

To Reproduce
Steps to reproduce the behavior:

  1. Use 'I wrote a makefile for Openwrt: https://gist.github.com/jannson/d0bc34ce9319c0c217343fccb820e720'
  2. Run 'build in OpenWRT SDK, using command: make package/example/themis/{clean,prepare,compile} V=s'
  3. See the following error:
make[5]: Entering directory '/xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/themis-1.0'
[  0%] Building C object CMakeFiles/soter.dir/src/soter/ed25519/fe_0.c.o
In file included from /xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/themis-1.0/src/soter/ed25519/fe_0.c:1:0:
/xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/themis-1.0/src/soter/ed25519/fe.h:7:10: fatal error: soter/soter_api.h: No such file or directory
 #include <soter/soter_api.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [CMakeFiles/soter.dir/build.make:82: CMakeFiles/soter.dir/src/soter/ed25519/fe_0.c.o] Error 1

Expected behavior
Should build OK using cmake

Environment (please complete the following information):

  • OS: [OS name and version, e.g. iOS 13]
  • Hardware: [32-bit/64-bit, or mobile device name and version]
  • Themis version: [e.g. 0.12.0]
  • Installation way:
    • via package manager
    • built from source

Additional context

Add a new line after https://github.com/cossacklabs/themis/blob/master/CMakeLists.txt#L3, which is:

include_directories(include)

Then we can passthough.

@jannson jannson changed the title Build failed using OpenWRT, have to change CMakefiles.txt Cross compile failed using OpenWRT, have to change CMakefiles.txt Jul 28, 2023
@jannson
Copy link
Author

jannson commented Jul 28, 2023

Addition, The Verbose of cmake gcc command:

/xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_musl.Linux-x86_64/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.5.0_musl/bin/aarch64-openwrt-linux-musl-gcc -DDNIST_STS_E
XE_PATH=tests/soter/nist-sts -I/xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/themis-1.0/src -Os -pipe -mcpu=c
ortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_mus
l.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/themis-1.0:themis-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -std=gnu99 -o CMakeFil
es/soter.dir/src/soter/ed25519/fe_0.c.o -c /xxx/openwrt-sdk-21.02.3-realtek-rtd129x_gcc-7.5.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/themis-1.0/src/soter
/ed25519/fe_0.c 

@Lagovas
Copy link
Collaborator

Lagovas commented Jul 28, 2023

Actually, we test and document installation using make, not cmake. For now, we don't test builds by cmake. CMakeLists.txt was added for IDE support (eg CLion) that worked only with CMakeLists.txt as source of project files.
So, for now the main approach (officially suggested) is tobuild from sources using make instead of cmake according to the docs.
Feel free to create PR with changes in CMakeLists.txt & tests the verifies building with cmake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants