[ ghc-Bugs-670756 ] package cc and ld opts inconsistent
SourceForge.net
noreply at sourceforge.net
Tue Feb 4 07:16:21 EST 2003
Bugs item #670756, was opened at 2003-01-19 18:59
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=670756&group_id=8032
Category: Driver
Group: 5.04.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Axel Simon (as49)
Assigned to: Nobody/Anonymous (nobody)
Summary: package cc and ld opts inconsistent
Initial Comment:
I try to create a package which passes
"--subsystem windows"
to the linker. As far as I understand it should be ok to have
extra_ld_opts = ["--subsystem windows"]
or, as ghc itself does it
extra_ld_opts = ["--subsystem", "windows"]
in the package description. However these flags are not
given to the linker. I tried
extra_cc_opts = ["-Wl,--subsystem", "-Wl,windows"]
but these flags are not passed to the C compiler either.
I finally succeeded with
extra_ld_opts = ["-Wl,--subsystem", "-Wl,windows"]
which I suspect fails when compiling with the native code
generator.
I am using the MSI of ghc 5.04.2.
Axel.
----------------------------------------------------------------------
>Comment By: Simon Marlow (simonmar)
Date: 2003-02-04 12:16
Message:
Logged In: YES
user_id=48280
extra_cc_opts gets passed to gcc when doing C
compilations (either Haskell compilations via C, or
compilation of plain C files).
extra_ld_opts gets passed to gcc when doing linking.
You can use -v to see what options are being passed to
which commands.
What exactly is wrong?
----------------------------------------------------------------------
Comment By: Axel Simon (as49)
Date: 2003-02-04 11:52
Message:
Logged In: YES
user_id=489164
I thought the linker is the linker and not the C compiler. With
this in mind I would have expected that
extra_ld_opts = ["--subsystem", "windows"]
winds up as -Wl,--subsystem -Wl,windows on the gcc
command line. Similarly, I expected
extra_cc_opts = ["-Wl,--subsystem", "-Wl,windows"]
to end up on the command line of gcc. Where do these flags
go to?
Furthermore, how am I to specify linker options if compilation
is not via C?
I find the behaviour just very confusing.
Axel.
----------------------------------------------------------------------
Comment By: Simon Marlow (simonmar)
Date: 2003-02-04 11:26
Message:
Logged In: YES
user_id=48280
The "linker" is in fact gcc, so when you add options to
extra_ld_opts they are passed on the gcc command line. If
you want to actually pass options to ld, then you need to use
the -Wl, prefix as you mentioned.
I don't understand your comments about extra_cc_opts - as
far as I can tell these are always passed to C compilations.
Could you give a specific example?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=670756&group_id=8032
More information about the Glasgow-haskell-bugs
mailing list