Skip to content

Conversation

@Watson1978
Copy link
Contributor

Backport #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


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]>
@Watson1978 Watson1978 added this to the 5.0.8 milestone Sep 24, 2025
@Watson1978 Watson1978 requested review from daipom and kenhys September 24, 2025 05:24
Copy link
Contributor

@kenhys kenhys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@kenhys kenhys merged commit cbcaf9e into fluent-package-v5 Sep 24, 2025
152 of 160 checks passed
@kenhys kenhys deleted the backport-pr877 branch September 24, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants