代码之家  ›  专栏  ›  技术社区  ›  Eli

强制gcc使用一个链接器而不是另一个链接器

  •  1
  • Eli  · 技术社区  · 14 年前

    最近我一直在做OSX。事情一直很顺利,直到不知何故 ld 上了我的系统现在 gcc 不会用的 dyld *.dylib 格式,而ld完全忽略了它的存在。如果我 mv ld起始 PATH ,gcc只是抱怨找不到ld。

    4 回复  |  直到 14 年前
        1
  •  1
  •   Paul Rubel    13 年前

    您可以尝试一些gcc选项。从 man page

    -c  Compile or assemble the source files, but do not link.  The linking
        stage simply is not done.  The ultimate output is in the form of an
        object file for each source file.
    

        2
  •  1
  •   nicomen    14 年前

    把ld和dyld联系起来有帮助吗?

    mv /usr/bin/ld /usr/bin/ld.old
    ln -s /usr/bin/dyld /usr/bin/ld
    

        3
  •  0
  •   pnkfelix    11 年前

    这不是你要问的问题,但我得换个话题 ld.gold -fuse-ld=gold gcc的选项非常有用。

        4
  •  -2
  •   RzR    13 年前

    看看 -Xlinker 选项

    man gcc

    您可以使用一些详细的选项进行双重检查,如 -v