Created attachment 102573 [details] KDECompilerSettings: Ensure POSIX correctness When building on non-glibc Unix platforms, such as Solaris, NetBSD, and Linux/musl or Linux/uclibc, multiple components of KF5 fail to build. This is because -std=iso9899:1990 is specified (for strict C90 compliance) but _XOPEN_SOURCE is not defined, so none of the POSIX interfaces are exported. I have seen this reported in at least: * kscreenlocker * plasma-workspace The attached patch resolves this issue on all our build boxes; additionally, applying it to my glibc builder did not change the already working result.
Just checked and this still applies cleanly to 5.38.0, and is still needed.
Please submit patches via https://phabricator.kde.org/differential/diff/create/
We have recently made changes to individual KF5 modules to allow them to build with musl (on Alpine). So for KF5 at least this should no longer be necessary. The patches were applied to each specific KF5 module rather than unconditionally requesting POSIX defines. Have you tried this on FreeBSD? That OS in particular gave us issues with those modifications, because FreeBSD will normally export symbols by default *except* for when you use one of those feature test macros; then it *disables everything* not in ISO C and then enables the features given by the macro you use. For the KF5 modules that actually used symbols that were only in BSD, fixing the missing POSIX symbols had the effect of breaking the BSD symbols.
Git commit 6684cb99bdf408fc491e547393dbd7aac4d151f2 by David Faure, on behalf of A. Wilcox. Committed on 31/08/2018 at 08:26. Pushed by dfaure into branch 'master'. Add _XOPEN_SOURCE to C definitions When building on non-glibc Unix platforms, such as Solaris, NetBSD, and Linux/musl or Linux/uclibc, multiple components of KF5 fail to build. This is because -std=iso9899:1990 is specified (for strict C90 compliance) but _XOPEN_SOURCE is not defined, so none of the POSIX interfaces are exported. I have seen this reported in at least: * kinit * kscreenlocker * plasma-workspace The attached patch resolves this issue on all our build boxes; additionally, applying it to my glibc builder did not change the already working result. Differential Revision: https://phabricator.kde.org/D8256 M +3 -0 kde-modules/KDECompilerSettings.cmake https://commits.kde.org/extra-cmake-modules/6684cb99bdf408fc491e547393dbd7aac4d151f2
Patch broke FreeBSD compilation, reverted.