2022-01-22 10:57:31 +00:00
|
|
|
# This file is part of the package-notes package.
|
|
|
|
#
|
2022-01-14 17:50:39 +00:00
|
|
|
# Add an ELF note with information about the package the code was compiled for.
|
|
|
|
# See https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects
|
|
|
|
# for details.
|
2022-01-22 10:57:31 +00:00
|
|
|
#
|
|
|
|
# To opt out of the use of this feature completely, include this in
|
|
|
|
# the spec file:
|
|
|
|
#
|
2022-08-04 23:36:28 +00:00
|
|
|
# %undefine _package_note_flags
|
2022-01-22 10:57:31 +00:00
|
|
|
#
|
2022-01-24 12:07:46 +00:00
|
|
|
# Which linker will be used? This should be either "bfd", "gold", or
|
2022-08-04 23:36:28 +00:00
|
|
|
# "mold". Unfortunately "lld" does not support the --package-metadata flag so
|
|
|
|
# the note insertion is disabled when using it.
|
2022-01-25 17:19:07 +00:00
|
|
|
#
|
|
|
|
# (The default linker for clang on armv7hl is lld.)
|
|
|
|
%_package_note_linker %["%_target_cpu" == "armv7hl" && "%{toolchain}" == "clang" ? "lld" : "bfd"]
|
2022-01-22 10:57:31 +00:00
|
|
|
|
2022-08-04 23:36:28 +00:00
|
|
|
# These are defined for backwards compatibility. Do not use.
|
|
|
|
%_package_note_file 1
|
|
|
|
%_generate_package_note_file %{nil}
|
2022-01-22 10:57:31 +00:00
|
|
|
|
2022-01-24 12:07:46 +00:00
|
|
|
# Overall status: 1 if looks like we can insert the note, 0 otherwise
|
2022-08-04 23:36:28 +00:00
|
|
|
%_package_note_status %[0%{?_package_note_file:1} && 0%{?name:1} && "%_target_cpu" != "noarch" && "%_package_note_linker" != "lld" ? 1 : 0]
|
2022-01-24 12:07:46 +00:00
|
|
|
|
2022-08-04 23:36:28 +00:00
|
|
|
# The linker flags to be passed to the compiler to insert the notes section will be created by the spec file,
|
|
|
|
# to avoid issues with quoting and escaping across different build systems and shells.
|
|
|
|
%_package_note_flags %[%_package_note_status?"-specs=/usr/lib/rpm/redhat/redhat-package-notes":""]
|
2022-01-14 17:50:39 +00:00
|
|
|
|
2022-08-04 23:36:28 +00:00
|
|
|
# Passing linker flags inline via -Xlinker causes autotools failures, as libtool eats the escaped quotes
|
|
|
|
#%_package_note_json %(%{_rpmconfigdir}/generate-rpm-note.sh %name %version %_arch)
|
|
|
|
#%_package_note_flags %[%_package_note_status?"%_package_note_json":""]
|