FS#69945 - [mutter] C++ dependencies are compiled without optimizations enabled
Attached to Project:
Arch Linux
Opened by Leonard Hecker (lhecker) - Thursday, 11 March 2021, 12:14 GMT
Last edited by Jan Alexander Steffens (heftig) - Thursday, 11 March 2021, 14:00 GMT
Opened by Leonard Hecker (lhecker) - Thursday, 11 March 2021, 12:14 GMT
Last edited by Jan Alexander Steffens (heftig) - Thursday, 11 March 2021, 14:00 GMT
|
Details
Description:
While compiling mutter using its PKGBUILD I noticed messages like the following: [871/873] Generating Meta-7.gir with a custom command ... /usr/include/features.h:397:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] This leads me to believe that CPPFLAGS should be specified in build(). I personally simply set CPPFLAGS="$CFLAGS" and the issues went away. Additional info: * The commit hash was replaced with the following (upcoming 3.8.4): https://gitlab.gnome.org/GNOME/mutter/-/tree/30c542ddc3f73aa625c5f88167da6700c45b9f33 * No other modifications to PKGBUILD * The meson documentation additionally suggests to me that --buildtype=release should be set Steps to reproduce: Simply try to compile mutter using the official PKGBUILD file. |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Thursday, 11 March 2021, 14:00 GMT
Reason for closing: Not a bug
Thursday, 11 March 2021, 14:00 GMT
Reason for closing: Not a bug
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
I experimented with setting CPPFLAGS="$CPPFLAGS ${CXXFLAGS/-O2/-O3}" in PKGBUILD and it lead to a successful build as well.
If I'm not mistaken this shows that mutter's meson build system doesn't support CXXFLAGS and only CPPFLAGS.
Does this issue also apply to other gnome packages?
If so: How should we solve this? Should the default /etc/makepkg.conf be changed? Or should we fix the gnome PKGBUILD files?
We've got a proposed change to buildflags that moves the define to CFLAGS/CXXFLAGS and will eliminate this warning: https://gitlab.archlinux.org/archlinux/rfcs/-/merge_requests/3