aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2020-05-21 13:12:20 +0300
committerJani Välimaa <wally@mageia.org>2020-05-21 13:12:20 +0300
commit0d75d27d98117e9d5c799b39b0f8aad0cdf69735 (patch)
tree00a70210fd3e0e8d8b742b84c006aefca1e4a943
parent05a9a6455465ab7da58e37d9d5832ff2eb1c57a0 (diff)
downloadrpm-setup-0d75d27d98117e9d5c799b39b0f8aad0cdf69735.tar
rpm-setup-0d75d27d98117e9d5c799b39b0f8aad0cdf69735.tar.gz
rpm-setup-0d75d27d98117e9d5c799b39b0f8aad0cdf69735.tar.bz2
rpm-setup-0d75d27d98117e9d5c799b39b0f8aad0cdf69735.tar.xz
rpm-setup-0d75d27d98117e9d5c799b39b0f8aad0cdf69735.zip
build macros: add _legacy_common_support macro for adding -fcommon to compiler flags
Since version 10, gcc defaults to '-fno-common': https://gcc.gnu.org/gcc-10/porting_to.html#common Builds may fail with 'multiple definition of ...' errors. As a short term workaround for such failure, it is possible to add '-fcommon' to the flags by defining '%_legacy_common_support'. %define _legacy_common_support 1 Properly fixing the failure is always preferred!
-rw-r--r--NEWS2
-rw-r--r--build.macros.in2
2 files changed, 2 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6d27add..cd60c11 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-
+- build macros: add _legacy_common_support macro for adding -fcommon to compiler flags
- build.macros: run /usr/lib/rpm/check-buildroot at end of %install scriptlet
via __arch_install_post
diff --git a/build.macros.in b/build.macros.in
index 07f4364..7a15019 100644
--- a/build.macros.in
+++ b/build.macros.in
@@ -192,7 +192,7 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} -
%Werror_cflags -Wformat -Werror=format-security
%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags}
-%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags}
+%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags}%{?_legacy_common_support: -fcommon}
%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags}
# Servers opt flags.