Skip to content

Commit 2394a9f

Browse files
committed
yum: Disable package-note-file to remove unnecessary linker flag (#877)
The user can refer the Ruby configure results through `RbConfig::CONFIG`. `RbConfig::CONFIG` is mainly used when installing gems which has C extension. If flags remain that use linker scripts that do not exist in the user's environment, it causes errors when user install the gem. When creating a package using `fluent-package.spec.in`, the environment variable `LDFLAGS` was automatically set as follows. ``` LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/root/rpmbuild/BUILD/fluent-package-6.0.0/.package_note-fluent-package-6.0.0-1.amzn2023.x86_64.ld' ``` Ruby's `configure` refers to the environment variable `LDFLAGS`, and it expands into `RbConfig::CONFIG`. Fix fluent-plugins-nursery/fluent-plugin-node-exporter-metrics#21 Fix #590 --------- Signed-off-by: Shizuo Fujita <[email protected]>
1 parent 712cff4 commit 2394a9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fluent-package/yum/fluent-package.spec.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ The stable distribution of Fluentd, formerly known as td-agent.
138138
%if %{use_scl_ruby}
139139
. /opt/rh/rh-ruby%{scl_ruby_ver}/enable
140140
%endif
141+
142+
# Disable package-note-file which embeds build environment path
143+
# in LDFLAGS. It blocks build process with third-party gems which
144+
# requires compile procedure.
145+
%undefine _package_note_file # For AmazonLinux 2023
146+
%undefine _package_note_flags # For RHEL 10
147+
141148
rake build:rpm_config FLUENT_PACKAGE_STAGING_PATH=%{buildroot} NO_VAR_RUN=1
142149
rake build:all FLUENT_PACKAGE_STAGING_PATH=%{buildroot} PATH="$HOME/.cargo/bin:$PATH"
143150
mkdir -p %{buildroot}%{_mandir}/man1

0 commit comments

Comments
 (0)