From 38fc865990beea7c98687d904af1832ff3da4c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 20 Jan 2022 20:31:57 +0100 Subject: [PATCH] ELF notes: rework the description of disabling I changed the definitions in package-notes to not do anything if %_package_note_file is undefined. The other macros won't work if it is not defined anyway, so this is quite natural. With this, undefining %_package_note_file becomes the most comprehensive mechanism to disable the feature. (Undefining %_package_note_flags still works so backwards compat is preserved.) The new mechanism will work once https://src.fedoraproject.org/rpms/package-notes/pull-request/1 is merged. But I don't think it is necessary to add a version requirement here, since we're only providing the docs here. --- buildflags.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/buildflags.md b/buildflags.md index ba0310a..d874277 100644 --- a/buildflags.md +++ b/buildflags.md @@ -254,13 +254,19 @@ generated when `%set_build_flags` is called. The linker option that injects the linker script is added to `%{build_ldflags}` via the `%{_package_note_flags}` macro. -To opt out of the use of the linker script, include this in the spec file: +To opt out of the use of this feature completely, the best way is to +undefine the first macro. Include this in the spec file: - %undefine _package_note_flags + %undefine _package_note_file -To opt out of generation of the linker script, include this in the spec file: +The other macros can be undefined too to replace parts of the functionality. +If `%_generate_package_note_file` is undefined, the linker script will not +be generated, but the link flags may still refer to it. This may be useful +if the default generation method is insufficient and a different mechanism +will be used to generate `%_package_note_file`. If `%_package_note_flags` +is undefined, the linker argument that injects the script will not be added +to `%build_ldfags`, but the linker script would still be generated. - %undefine _generate_package_note_file ### Post-build ELF object processing