Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Ability to provide custom ld and gc flags #11996

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Dainerx
Copy link

@Dainerx Dainerx commented Dec 30, 2024

Description

The primary purpose of this PR is to provide greater flexibility in how OTEL binaries are built, enabling the inclusion of debugging symbols when needed, without always stripping them by default.

Currently, debugging symbols are only retained when debug_compilation=true. However, this approach also disables all compiler inlining and optimizations (gcflags=all=-N -l) to ensure an exact match between written and executed code, resulting in a significant increase in CPU consumption. There are scenarios where we want binaries with debugging symbols and DWARF information while still allowing the compiler to optimize and inline. This PR addresses that need by introducing configurable GCFlags.

ocb --ldflags="" --gcflags="" --config=builder-config.yaml

Link to tracking issue

Fixes #58

Testing

Manual

Override LDflags:

image

Override both

image

Documentation

README file updated.

--

Backward compatibility concerns:

  • As of today, passing cfg.LDFlags will append to LD flags that are by default to -s -w.

Questions:

  • Should we deprecate DebugCompilation property?

@Dainerx Dainerx requested a review from a team as a code owner December 30, 2024 17:52
@Dainerx Dainerx requested a review from jpkrohling December 30, 2024 17:52
@Dainerx Dainerx force-pushed the builder/ld-gc-flags branch from 9889e99 to a6d8bb0 Compare December 31, 2024 14:37
@Dainerx Dainerx changed the title [#58] Ability to provide custom ld and gc flags [chore] Ability to provide custom ld and gc flags Dec 31, 2024
@Dainerx Dainerx force-pushed the builder/ld-gc-flags branch from c3b79eb to ee35153 Compare December 31, 2024 16:18
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.

Enabling debug symbols
1 participant