Ensure flags destined for ld are properly passed
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 1 Dec 2016 16:28:47 +0000 (11:28 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 1 Dec 2016 16:28:47 +0000 (11:28 -0500)
GHC uses gcc, not ld, for linking. Consequently all flags to be
interpreted by ld need to be prefixed by -optl,-Wl on the GHC command
line.

Test Plan: Validate on OpenBSD

Reviewers: austin, rwbarton

Reviewed By: rwbarton

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2776

rules/distdir-way-opts.mk

index 6ae9807..602e6eb 100644 (file)
@@ -207,7 +207,7 @@ $1_$2_$3_ALL_LD_OPTS = \
 
 # Options for passing to GHC when we use it for linking
 $1_$2_$3_GHC_LD_OPTS = \
- $$(addprefix -optl, $$($1_$2_$3_ALL_LD_OPTS)) \
+ $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS)) \
  $$($1_$2_$3_MOST_HC_OPTS)
 
 $1_$2_$3_ALL_AS_OPTS = \