Skip to content

Adding an explicit pgma flag for interaction with GHC#11764

Draft
zlonast wants to merge 3 commits intohaskell:masterfrom
zlonast:zlonast/pgma-option
Draft

Adding an explicit pgma flag for interaction with GHC#11764
zlonast wants to merge 3 commits intohaskell:masterfrom
zlonast:zlonast/pgma-option

Conversation

@zlonast
Copy link
Copy Markdown
Collaborator

@zlonast zlonast commented Apr 24, 2026

Add an explicit pgma flag to Cabal's GHC invocation logic. Pass the assembler
program explicitly to GHC. This change allows users to specify a custom as
program to compile assembly manually.

Main idea #9801 (comment)

IMHO, cc-options (and ld-options and cpp-options and ...) should be always passed when invoking GHC, similarly as ghc-options should be always used when invoking ghc - regardless of what is the intention of a particular GHC-call. GHC might use or not use the options, Cabal cannot know and should not guess.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@zlonast zlonast force-pushed the zlonast/pgma-option branch from 1313108 to e0528df Compare April 24, 2026 18:32
@zlonast zlonast changed the title Add explicit pgma flag for GHC invocation Adding an explicit pgma flag for interaction with GHC Apr 24, 2026
@zlonast zlonast force-pushed the zlonast/pgma-option branch 3 times, most recently from 2d33730 to fb6a169 Compare April 24, 2026 19:31
@zlonast zlonast force-pushed the zlonast/pgma-option branch from fb6a169 to 32c3c4e Compare April 25, 2026 08:58
@zlonast
Copy link
Copy Markdown
Collaborator Author

zlonast commented Apr 25, 2026

Apparently if I pass gcc instead of as I get a bunch of warnings, I think it's a ghc bug.

https://gitlab.haskell.org/ghc/ghc/-/issues/27216

[127 of 148] Compiling Distribution.Simple.GHC ( ... ) [Source file changed]
clang: warning: argument unused during compilation: '-fno-common' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-U PIC' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-D PIC' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-fno-common' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-U PIC' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-D PIC' [-Wunused-command-line-argument]

[1 of 1] Compiling Main ( ... ) [Missing object file]
nasm: fatal: unrecognised output format no-common' - use -hf for a list Usage: nasm [-@ response_file] [options...] [--] filename For additional help: nasm -h [run|topics|all|-option] <no location info>: error: as-wrapper.sh' failed in phase `Assembler'. (Exit code: 1)

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