seL4 / seL4-CAmkES-L4v-dockerfiles

Dockerfiles defining the dependencies required to build seL4, CAmkES, and L4v.
12 stars 39 forks source link

Camkes VM Linux Dependency #84

Closed j1mst1x closed 2 months ago

j1mst1x commented 3 months ago

The docker container is missing the 32 bit libstdc++ for compiling the poke module in Camkes VM Linux Tutorial. (Error at the end)

I was able to fix the error by installing lib32stdc++-10-dev, command below.

$ sudo apt install lib32stdc++-10-dev

Originally I was going to submit a pull request proposing an update to scripts/camkes.sh, but when I modify the shell script and rebuild the container, the new libraries are still absent. Would someone with a better understanding of the build system look at this please? Thank you in advance. :-)

Steps to reproduce: 1) Build build-system docker container 2) git clone tutorials 3) $ ./init --tut camkes-vm-linux --solution 4) enter solution's build directory 5) $ ninja Should fail with the error below. 6) sudo apt install lib32stdc++-10-dev 7) $ ninja 8) Build should now complete

Related issue: https://github.com/seL4/sel4-tutorials/issues/99

Error:

- [polly] Used toolchain: Linux / gcc / PIC / c++11 support / 32 bit
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ - broken
CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/usr/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /host/sel4-tutorials-manifest/camkes-vm-linuxay_d0gp7_build/poke-module/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_a618a && [1/2] Building CXX object CMakeFiles/cmTC_a618a.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_a618a
    FAILED: cmTC_a618a 
    : && /usr/bin/g++ -m32 -fPIC -std=c++11  CMakeFiles/cmTC_a618a.dir/testCXXCompiler.cxx.o -o cmTC_a618a   && :
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.so when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a when searching for -lstdc++
    /usr/bin/ld: cannot find -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.so when searching for -lstdc++
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.

-- Configuring incomplete, errors occurred!
lsf37 commented 3 months ago

Might be a few days, but I will have a look at this one and see if I can get it to work.

Ivan-Velickovic commented 3 months ago

We removed libstdc++-10-dev in https://github.com/seL4/seL4-CAmkES-L4v-dockerfiles/pull/65. We probably should not have done that by the looks of it.

lsf37 commented 3 months ago

I've reverted that part of the change of PR #65 now in #85, but haven't tested it yet.