Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / openclonk packaging for Buildroot
- - By kubu [fr] Date 2017-07-16 14:43
Hi all,

I'm packaging openclonk in Buildroot [1] and I would like to give some feedback about some issues I had.

Buildroot is doing automated cross-compilation only and we don't rely on the packages installed on the build machine (host).
If a tool is required on the host, Buildroot build a host variant (host-openclonk) before building the target variant (openclonk).

Buildroot will create two build directories (one for the host and one for the target):

All binaries, headers and libraries for the host are installed in:

All binaries, headers and libraries for the target are installed in:

(staging is used for cross-compiling, so no package build directory are used by other packages for their build)

All binaries and libraries for the target are installed in:

The first issue is building c4group tool for the host (using host-openclonk package) without requiring all other
dependencies (X11, GTK, SDL/SDL2, openGL etc). Currently there is no way to build only c4group.
On master there is a new HEADLESS_ONLY option that help but the openclonk-server is still build.
Also it's not clear to me what's the dependencies of c4group.

I backported some patches on stable-7 branch to add HEADLESS_ONLY option and I was able to build c4group.
The Cmake build system generate NativeToolsExport.cmake file that's expected to be used while cross-compiling
but it's not installed in output/host/...

Buildroot install c4group for the host in:

Now openclonk for the target is build but the CMake build system expect a path to NativeToolsExport.cmake file.
It's unusual practice for cross-compiling to provide a path to a .cmake file, instead the we should simply
provide the path to output/host/bin/c4group.
Even if we know that NativeToolsExport.cmake is present in output/build/host-openclonk-7.0/, it's not a good
practice to set -DIMPORT_NATIVE_TOOLS="output/build/host-openclonk-7.0/NativeToolsExport.cmake".
For now, I don't have the choice and I cheated by doing so.

The build continue but stop due to link issue with libmisc and libc4script:

    [...]/host/bin/x86_64-linux-g++ --sysroot=[...]sysroot
    -std=gnu++14 -Wall -Wextra -Wredundant-decls -Wendif-labels
    -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self
    -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor
    -Woverloaded-virtual  -DNDEBUG
    -rdynamic CMakeFiles/c4group.dir/src/c4group/C4GroupMain.cpp.o
    -o c4group
    -Wl,-rpath,/home/naourr/buildroot-test/test/openclonk/build/openclonk-7.0: -lz -lpthread -lrt : undefined reference to « C4LangStringTable::Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const » : undefined reference to « C4LangStringTable::system_string_table »

That because these libraries must be build statically (STATIC key word must be used)
"add_library(libmisc STATIC ...)"

With that fixed, openclonk build fine but the build log is very noisy due to Wmisleading-indentation and Wimplicit-fallthrough introduced since gcc 6.

I pushed a branch with all my changes but it's still a WIP.

Otherwise I'm able to start openclonk on the target, see [3] :)

Thank for openclonk, I hope this feed back can help.

Best regards,

Parent - - By Caesar Date 2017-07-17 01:52
Hm, I'm not really sure about the static libraries, but I think the changes are sane…

It looks like you're shooting fish on that picture, I like it.
Parent - - By kubu [fr] Date 2017-07-17 21:06
Hi Caesar,

Do you want me to create a pull request on github ?
For now I only tested over the stable-7 branch, I don't think these changes are ok for this version...
I should rebase this work on master.

Btw, do you plan to release OC 8 in near future ?

I'm shooting the red fish, I'm still angry against them (deep sea mining) :)

Parent - By Caesar Date 2017-07-21 14:44

>pull request

Hm, yeah, I guess that would be convenient.


uhm… we kind of had this "one release a year" thing, but that's overdue for half a year already… I'm not exactly active, either, so I don't know.
Up Topic Development / Developer's Corner / openclonk packaging for Buildroot

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill