[英]What's the difference between GHC's -c and -no-link options?
帮助说:
-c Do not link
和
-no-link Omit linking
我知道-c
完全阻止链接部分。 但是如果我指定-no-link
什么区别? 链接阶段实际上除了链接之外还做了什么吗?
更新:有趣的是, -no-link
在GHC 6.12中已被弃用,但在GHC 7中未被推荐 。
AFAK -c
不处理依赖项。 例如
Main.hs:
module Main
where
import Test
main :: IO ()
main = test
Test.hs:
module Test
where
test :: IO ()
test = print 123
尝试使用-c
进行编译:
$ ghc -c Main.hs
Main.hs:5:1:
Failed to load interface for `Test'
Use -v to see a list of the files searched for.
使用-no-link
:
$ ghc -no-link Main.hs
[1 of 2] Compiling Test ( Test.hs, Test.o )
[2 of 2] Compiling Main ( Main.hs, Main.o )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.