Skip to content

Conversation

perazz
Copy link
Member

@perazz perazz commented Sep 8, 2025

On macOS, if there is no library, fpm install fails for monolithic builds with the error:

  install_name_tool: changing install names or rpaths can't be redone for: ./installed/bin/executable (for architecture arm64) because larger updated load commands do not fit (the
  program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)

This occurs because:

  1. The installer always tries to add rpath entries (@executable_path/../lib and @executable_path) to all executables on macOS
  2. Header padding flags (-Wl,-headerpad,0x200) were only applied to executables in non-monolithic builds
  3. Monolithic builds (default when no library configuration is specified) produced executables without sufficient header space for install_name_tool to modify

Issue is fixed by always ensuring the necessary header padding also in monolithic executables.

@perazz perazz requested a review from Copilot September 8, 2025 20:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a macOS installation error for monolithic builds by ensuring proper header padding for all executables. The issue occurred when install_name_tool couldn't modify monolithic executables due to insufficient header space.

  • Moves header padding flags from non-monolithic builds only to all executables
  • Ensures monolithic builds have adequate header space for install_name_tool modifications

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@perazz perazz merged commit 0cb3f00 into fortran-lang:main Sep 8, 2025
27 checks passed
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.

1 participant