From 8d00754229423723a6ce256608eb793ca4766ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Tue, 21 Nov 2023 11:26:30 +0200 Subject: macros: set -g when building Vala applications From https://src.fedoraproject.org/rpms/redhat-rpm-config/c/d097058 Set -g when building Vala applications This requires the build system support VALAFLAGS. At least Meson and Automake do. Using -g is desired because it allows us to see Vala source files and line numbers in backtraces when possible, falling back to generated C code otherwise. Line numbers for generated C are almost always less useful when debugging crashes. --- NEWS | 1 + macros.in | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0068a70..227afd1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- macros: set -g when building Vala applications - macros: make _FORTIFY_SOURCE flags configurable via %_fortify_level variable - macros: undefine _FORTIFY_SOURCE before defining it to avoid build warnings on some packages defining it already diff --git a/macros.in b/macros.in index 79c5327..5c55eb3 100644 --- a/macros.in +++ b/macros.in @@ -206,6 +206,9 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} - # the corresponding variable names. %build_fflags %{optflags} %{?_fmoddir:-I%_fmoddir} +# Vala compiler flags. This is used to set VALAFLAGS. +%build_valaflags -g + # Some linkers default to a build-id algoritim that is not supported by rpmbuild, # so we need to specify the right algorithm to use. %_build_id_flags -Wl,--build-id=sha1 @@ -221,7 +224,7 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} - %ldflags %build_ldflags # Expands to shell code to seot the compiler/linker environment -# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have +# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, VALAFLAGS, LDFLAGS if they have # not been set already. RPM_OPT_FLAGS and RPM_LD_FLAGS have already # been set implicitly at the start of the %%build section. # LT_SYS_LIBRARY_PATH is used by libtool script. @@ -230,6 +233,7 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} - CXXFLAGS="${CXXFLAGS:-%{build_cxxflags}}" ; export CXXFLAGS ; \ FFLAGS="${FFLAGS:-%{build_fflags}}" ; export FFLAGS ; \ FCFLAGS="${FCFLAGS:-%{build_fflags}}" ; export FCFLAGS ; \ + VALAFLAGS="${VALAFLAGS:-%{build_valaflags}}" ; export VALAFLAGS ; \ LDFLAGS="${LDFLAGS:-%{build_ldflags}}" ; export LDFLAGS ; \ LT_SYS_LIBRARY_PATH="${LT_SYS_LIBRARY_PATH:-%_libdir:}" ; export LT_SYS_LIBRARY_PATH -- cgit v1.2.1