ola icon indicating copy to clipboard operation
ola copied to clipboard

ola: fix compilation with musl 1.2.3

Open neheb opened this issue 3 years ago • 7 comments

musl 1.2.3 defines NULL as nullptr. Cannot use reinterpret_cast with nullptr.

No idea why this is even here. NULL in C == 0.

neheb avatar Apr 13 '22 03:04 neheb

Similar to musl I could match is against the cplusplus version. But still. NULL is 0. I don't understand the point of the ifdef.

neheb avatar Apr 14 '22 18:04 neheb

The musl commit that breaks ola compilation is http://git.musl-libc.org/cgit/musl/commit/?id=98e688a9da5e7b2925dda17a2d6820dddf1fb287

neheb avatar Apr 14 '22 19:04 neheb

Made the change.

The longterm solution is to migrate this project to C++11. Newer protobuf requires it.

neheb avatar Apr 15 '22 00:04 neheb

travis failures seem unrelated:

/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status

neheb avatar Apr 15 '22 00:04 neheb

@peternewman, could you give this another look, please? Compilation failure against musl would also be a problem for Gentoo Linux (where we do have ola packaged as well). Thanks! I could investigate if I can add a github action that runs against musl ...

kripton avatar Mar 27 '24 21:03 kripton

@kripton absolutely. There’s a setup-alpine GitHub actions workflow than can be used.

btw, why does this project support less than C++11?

neheb avatar Mar 27 '24 21:03 neheb

Answered my own question:

C++ 11
------
As much as we'd like to start using C++11, Ubuntu 12.04 still comes with g++
4.6 which has partial support. Once 12.04 is end-of-lifed, we'll consider
using C++ 11 constructs.

12.04 is already EOL. Only 18.04 remains non EOL at LTS.

neheb avatar Mar 29 '24 22:03 neheb