flatpak-builder fails cmake setup

Lothar Scholz scholz.lothar at gmail.com
Wed Jun 29 05:30:02 UTC 2022


I try to compile a very simple cmake based example file.
But i'm not getting far because cmake terminates almost immediately
with it's second compiler check program. Any ideas what is wrong?

And i know how to open a shell in the runtime, but how can i open a
shell inside the build sandbox of the module to debug this?

My Manifest file:
===============================================================
app-id: app.filesqueezer.example
runtime: org.fedoraproject.Platform/x86_64/f36
sdk: org.fedoraproject.Sdk/x86_64/f36

command: example
finish-args:
  - --socket=wayland
  - --socket=fallback-x11
  - --socket=x11

modules:
  - name: example-program
    buildsystem: cmake
    builddir: true
    sources:
      - type: dir
        path: .

===============================================================

And here is the output:

===============================================================
Downloading sources
Initializing build dir
Committing stage init to cache
Starting build of app.filesqueezer.example
========================================================================
Building module example-program in
/home/llothar/Downloads/temp/.flatpak-builder/build/example-program-1
========================================================================
-- The C compiler identification is GNU 12.1.1
-- The CXX compiler identification is GNU 12.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /run/build/example-program/_flatpak_build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_1e899/fast &&
/usr/bin/gmake  -f CMakeFiles/cmTC_1e899.dir/build.make
CMakeFiles/cmTC_1e899.dir/build
    gmake[1]: Entering directory
'/run/build/example-program/_flatpak_build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_1e899.dir/testCCompiler.c.o
    /usr/bin/cc   -O2 -flto=auto -ffat-lto-objects -fexceptions -g
-grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
 -m64  -mtune=generic -fasynchronous-unwind-tables
-fstack-clash-protection -fcf-protection  -o
CMakeFiles/cmTC_1e899.dir/testCCompiler.c.o -c
/run/build/example-program/_flatpak_build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_1e899
    /usr/bin/cmake -E cmake_link_script
CMakeFiles/cmTC_1e899.dir/link.txt --verbose=1
    /usr/bin/cc -O2 -flto=auto -ffat-lto-objects -fexceptions -g
-grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
 -m64  -mtune=generic -fasynchronous-unwind-tables
-fstack-clash-protection -fcf-protection  -L/app/lib -Wl,-z,relro
-Wl,--as-needed  -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1
-Wl,-dT,/builddir/build/BUILD/.package_note-flatpak-runtime-config-36-1.module_f36+14437+3886a164.x86_64.ld
 CMakeFiles/cmTC_1e899.dir/testCCompiler.c.o -o cmTC_1e899
    /usr/bin/ld: cannot open linker script file
/builddir/build/BUILD/.package_note-flatpak-runtime-config-36-1.module_f36+14437+3886a164.x86_64.ld:
No such file or directory
    collect2: error: ld returned 1 exit status
    gmake[1]: *** [CMakeFiles/cmTC_1e899.dir/build.make:99: cmTC_1e899] Error 1
    gmake[1]: Leaving directory
'/run/build/example-program/_flatpak_build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_1e899/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
See also "/run/build/example-program/_flatpak_build/CMakeFiles/CMakeOutput.log".
See also "/run/build/example-program/_flatpak_build/CMakeFiles/CMakeError.log".
Error: module example-program: Der Kindprozess wurde mit Status 1 beendet


More information about the Flatpak mailing list