Linking fails on alpine 3.15
alpharde opened this issue · comments
Client version: N/A
Server OS: Alpine Linux 3.15
Cuberite Commit id: a8ef9d1
[100%] Linking CXX executable Server/Cuberite
/build/cuberite/lib/fmt/include/fmt/format-inl.h: In function 'snprintf_float.constprop':
/usr/include/fortify/stdio.h:95: error: inlining failed in call to 'always_inline' 'snprintf': function body can be overwritten at link time
95 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, const char *__f, ...)
|
/build/cuberite/lib/fmt/include/fmt/format-inl.h:2535:36: note: called from here
2535 | ? snprintf_ptr(begin, capacity, format, precision, value)
| ^
/usr/include/fortify/stdio.h:95: error: inlining failed in call to 'always_inline' 'snprintf': function body can be overwritten at link time
95 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, const char *__f, ...)
|
/build/cuberite/lib/fmt/include/fmt/format-inl.h:2536:36: note: called from here
2536 | : snprintf_ptr(begin, capacity, format, value);
| ^
make[3]: *** [/tmp/ccekIFfA.mk:338: /tmp/Cuberite.kFgmnd.ltrans112.ltrans.o] Error 1
make[3]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/Cuberite.dir/build.make:937: Server/Cuberite] Error 1
I fired up a virtual machine with alpine (5.15.38-1-virt) then tried to compile.
I got no error whatsoever by following the compile instruction (I had to install make cmake git g++ gcc python3 lua perl)
how do you proceeded ? maybe you can give more info about what you did so far ?
I can compile this just fine on Alpine Linux edge, just as I've always could really. Try a clean build and please provide the steps you've followed.
I had a minimal VM with only git make cmake clang python3 perl bash build-base
however it worked just now so nevermind me. Weird.
Intermittent compiler bug, some sort of broken interaction between interprocedural optimisation (LTO) and system headers: pybind/pybind11#1650
It's good it works most of the time though! If anyone finds it refuses to compile try turning advanced optimisations off when compiling Cuberite: cmake -DWHOLE_PROGRAM_OPTIMISATION=No .