链接器 (ld) 无法生成输出文件?
我在 Mac 上尝试构建 Chromium 时遇到奇怪的错误。我已将问题跟踪到以下代码块,该代码块位于名为
NEW_OBJECT="${OBJECT}.new"
ld -o "${NEW_OBJECT}" -r "${OBJECT}" \
-exported_symbols_list /dev/null -keep_private_externs
mv "${NEW_OBJECT}" "${OBJECT}"
该脚本在最后一行失败,其中 mv
声明文件 ${NEW_OBJECT}
不存在。 ${NEW_OBJECT}
应该是由上面的链接器命令创建的,但由于某种原因这没有发生。链接器不会生成新文件,但也不会打印任何错误或警告。
我知道链接器本身没有问题——当我在终端中运行类似的命令时,它们工作正常。该问题一定与脚本执行的环境有关。
有谁知道为什么这个链接器命令不能正常工作?
I'm getting a strange error while trying to build Chromium on Mac. I've tracked the problem down to the following block of code, which is in a script called adjust_visibility.sh.
NEW_OBJECT="${OBJECT}.new"
ld -o "${NEW_OBJECT}" -r "${OBJECT}" \
-exported_symbols_list /dev/null -keep_private_externs
mv "${NEW_OBJECT}" "${OBJECT}"
The script fails on the last line, where mv
claims that the file ${NEW_OBJECT}
doesn't exist. ${NEW_OBJECT}
should have been created by the linker command right above, but for some reason this isn't happening. The linker doesn't produce the new file, but it also doesn't print any errors or warnings.
I know there's no problem with the linker itself -- when I run similar commands in the terminal they work fine. The problem must have something to do with the environment that the script's executing in.
Does anyone have any idea why this linker command isn't working properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论