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

Lwip issue with camkes and odroidc2 #7

Closed
no00237 opened this issue Mar 30, 2021 · 8 comments
Closed

Lwip issue with camkes and odroidc2 #7

no00237 opened this issue Mar 30, 2021 · 8 comments
Assignees

Comments

@no00237
Copy link

no00237 commented Mar 30, 2021

Trying to build a camkes application with a component that tries to use the lwip library results in this error message:

FAILED: client.instance.bin
: && /usr/bin/ccache /usr/bin/aarch64-linux-gnu-gcc --sysroot=/home/nkem/Documents/Test2/build -march=armv8-a+crc -D__KERNEL_64__ -g -D__KERNEL_64__ -static -nostdlib -z max-page-size=0x1000 -static -nostdlib -u _camkes_start -e _camkes_start -Wl,--script=/home/nkem/Documents/Test2/build/client/linker.lds -Wl,-umuslcsys_init_muslc /home/nkem/Documents/Test2/build/lib/crt0.o /home/nkem/Documents/Test2/build/lib/crti.o /usr/lib/gcc-cross/aarch64-linux-gnu/7/crtbegin.o CMakeFiles/client.instance.bin.dir/apps/lwip_test/components/Client/src/main.c.obj CMakeFiles/client.instance.bin.dir/client/camkes.c.obj CMakeFiles/client.instance.bin.dir/client/camkes.environment.c.obj CMakeFiles/client.instance.bin.dir/client/eth_drv_seL4Ethdriver_0.c.obj -Wl,--start-group -lgcc -lgcc_eh libsel4/libsel4.a sel4runtime/libsel4runtime.a camkes-tool/libsel4camkes/libsel4camkes.a seL4_libs/libsel4sync/libsel4sync.a util_libs/libutils/libutils.a seL4_libs/libsel4vka/libsel4vka.a seL4_libs/libsel4utils/libsel4utils.a seL4_libs/libsel4bench/libsel4bench.a seL4_libs/libsel4platsupport/libsel4platsupport.a util_libs/libplatsupport/libplatsupport.a seL4_libs/libsel4vspace/libsel4vspace.a seL4_libs/libsel4muslcsys/libsel4muslcsys.a -llwip seL4_libs/libsel4utils/libsel4utils.a seL4_libs/libsel4platsupport/libsel4platsupport.a sel4runtime/libsel4runtime.a util_libs/libplatsupport/libplatsupport.a util_libs/libfdt/libfdt.a -Wl,--undefined=arm_gic_ptr,--undefined=tegra_ictlr_ptr,--undefined=arm_gicv3_ptr,--undefined=fsl_avic_ptr,--undefined=ti_omap3_ptr seL4_libs/libsel4simple-default/libsel4simple-default.a seL4_libs/libsel4vspace/libsel4vspace.a seL4_libs/libsel4simple/libsel4simple.a seL4_libs/libsel4vka/libsel4vka.a util_libs/libelf/libelf.a util_libs/libcpio/libcpio.a -Wl,-u -Wl,__vsyscall_ptr seL4_libs/libsel4debug/libsel4debug.a projects_libs/libvirtqueue/libvirtqueue.a libsel4/libsel4.a util_libs/libutils/libutils.a musllibc/build-temp/stage/lib/libc.a -Wl,--end-group /usr/lib/gcc-cross/aarch64-linux-gnu/7/crtend.o /home/nkem/Documents/Test2/build/lib/crtn.o -o client.instance.bin && :
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: cannot find -llwip
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@nomadeel
Copy link

Can you show the CMakeLists.txt file of the application that you are trying to build?

@no00237
Copy link
Author

no00237 commented Mar 31, 2021

This is the CMakeLists.txt file of a client component I tried to make. I tried using how the picoserver example app was built as an idea as I couldn't find any recent lwip examples but I'm pretty sure I may just be missing something critical.


cmake_minimum_required(VERSION 3.7.2)

project(ComponentProver C)

DeclareCAmkESComponent(
Client
SOURCES
src/main.c
LIBS
lwip
)


Am I just missing something like this for Lwip as I didn't see anything like it in the apps I had found that used lwip:
set(LibPicotcp ON CACHE BOOL "" FORCE)

@nomadeel
Copy link

nomadeel commented Apr 1, 2021

Yeah the LibLwip CMake 'set' should be inside the CMakeLists.txt file of your application.

So, something like set(LibLwip ON CACHE BOOL "" FORCE).

@no00237
Copy link
Author

no00237 commented Apr 1, 2021

So I did try to try that but then I got issues with the lwipopts.h file not being included and from looking around I found the file in util_libs but I still get this issue.

[2/257] Building C object util_libs/li.../lwip/src/apps/snmp/snmp_netconn.c.obj
FAILED: util_libs/liblwip/CMakeFiles/lwip.dir/home/nkem/Documents/Test2/projects/lwip/src/apps/snmp/snmp_netconn.c.obj
/usr/bin/ccache /usr/bin/gcc --sysroot=/home/nkem/Documents/Test2/build -I/home/nkem/Documents/Test2/projects/lwip/src/include -I/home/nkem/Documents/Test2/projects/util_libs/liblwip/include -I/home/nkem/Documents/Test2/projects/util_libs/liblwip/include/lwip -Imusllibc/build-temp/stage/include -m64 -march=nehalem -D__KERNEL_64__ -g -nostdinc -fno-pic -fno-pie -fno-stack-protector -fno-asynchronous-unwind-tables -ftls-model=local-exec -mtls-direct-seg-refs -m64 -march=nehalem -D__KERNEL_64__ -std=gnu11 -MD -MT util_libs/liblwip/CMakeFiles/lwip.dir/home/nkem/Documents/Test2/projects/lwip/src/apps/snmp/snmp_netconn.c.obj -MF util_libs/liblwip/CMakeFiles/lwip.dir/home/nkem/Documents/Test2/projects/lwip/src/apps/snmp/snmp_netconn.c.obj.d -o util_libs/liblwip/CMakeFiles/lwip.dir/home/nkem/Documents/Test2/projects/lwip/src/apps/snmp/snmp_netconn.c.obj -c /home/nkem/Documents/Test2/projects/lwip/src/apps/snmp/snmp_netconn.c
In file included from /home/nkem/Documents/Test2/projects/lwip/src/include/lwip/apps/snmp_opts.h:40:0,
from /home/nkem/Documents/Test2/projects/lwip/src/apps/snmp/snmp_netconn.c:35:
/home/nkem/Documents/Test2/projects/lwip/src/include/lwip/opt.h:51:10: fatal error: lwipopts.h: No such file or directory
#include "lwipopts.h"
^~~~~~~~~~~~
compilation terminated.

@nomadeel
Copy link

nomadeel commented Apr 9, 2021

For that, you need to copy the default lwipopts.h file inside the utils_libs/liblwip/default_opts/ folder and paste it to your application's folder. Afterwards, inside the application's CMakeLists.txt file, you'll need to use the AddLWIPConfiguration CMake function in util_libs/liblwip/lwip_helpers.cmake to point to the directory that contains the pasted lwipopts.h file.

@kent-mcleod
Copy link
Member

@no00237 there's this old PR that provides an example lwip application: seL4/camkes#13
It might help guide you.

@kent-mcleod
Copy link
Member

And here is another lwipopts.h that was used in a different echo server example: https://github.com/SEL4PROJ/camkes-apps-ethernet-demo-x86--devel/blob/master/lwipopts.h

@kent-mcleod
Copy link
Member

Closing due to inactivity. Feel free to reopen.

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

3 participants