Skip to content

Conversation

@dannf
Copy link
Contributor

@dannf dannf commented Feb 6, 2026

  • refactor: Move GCC specfile logic into new compiler_config.go module
  • feat(build): Add clang configuration file support for package metadata injection

dannf and others added 2 commits February 6, 2026 12:51
This is preparation for also adding clang configuration.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Signed-off-by: dann frazier <[email protected]>
…a injection

This adds Package Metadata ELF notes for binaries built with Clang, like
we already have for GCC. We do this by creating user configuration files
for clang that override the system configuration files.

We assume that there's a system configuration file for each supported version
of clang (provided by openssf-compiler-options in wolfi), so we scan for
those to determine which user configuration files are required.

If we find any clang system configuration files, we create a
~/.melange.clang.cfg file that adds the necessary linker config. We then
create a user config file counterpart for each system config file that
includes ~/.melange.clang.cfg *and* includes the system config file
that we've overridden, making sure we don't lose our hardening flags.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: dann frazier <[email protected]>
log := clog.FromContext(ctx)

systemConfigs, err := b.detectClangSystemConfigFiles()
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

just use a fixed list here

}

if len(systemConfigs) == 0 {
log.Debugf("no clang system config files detected, skipping user config file creation")
Copy link
Member

Choose a reason for hiding this comment

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

no, we always write.

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.

2 participants