具有长(或绝对)路径的 nasm 无法打开输出文件(在 cygwin 上)

发布于 2025-01-14 09:11:12 字数 1323 浏览 3 评论 0原文

我花了很多时间,无法理解为什么 nasm“无法打开输出文件”。

如果我从包含我的 asm 文件的文件夹中调用 nasm,它可以工作(使用相对路径),但不能使用绝对路径:

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe /cygdrive/c/Perso/Code/boringssl/crypto/chacha/chacha.asm
/cygdrive/c/Perso/Code/boringssl/crypto/chacha/chacha.asm: fatal: unable to open output file `/cygdrive/c/Perso/Code/boringssl/crypto/chacha/chacha'

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe chacha.asm  
 >>>> This will work     

我尝试使用一些相对路径,发现

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe ../../../../../../c/Perso/Code/boringssl/crypto/chacha/chacha.asm
../../../../../../c/Perso/Code/boringssl/crypto/chacha/chacha.asm: fatal: unable to open output file `../../../../../../c/Perso/Code/boringssl/crypto/chacha/chacha'

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe ../../../../../Perso/Code/boringssl/crypto/chacha/chacha.asm  
 >>>> This will work  

我无法使其使用绝对路径,即使使用“ /tmp/chacha.asm"

我也尝试使用 2 个不同版本的 cygwin 但结果相同。

我的 nasm 版本是“NASM 版本 2.15.05 于 2020 年 8 月 28 日编译”

我无法弄清楚 nasm 需要使用绝对路径(或大的相对路径)

I spend a lot of time and can't understand why nasm "unable to open output file".

If I call nasm from the folder containing my asm file it works (with relative path) but won't work with absolute path :

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe /cygdrive/c/Perso/Code/boringssl/crypto/chacha/chacha.asm
/cygdrive/c/Perso/Code/boringssl/crypto/chacha/chacha.asm: fatal: unable to open output file `/cygdrive/c/Perso/Code/boringssl/crypto/chacha/chacha'

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe chacha.asm  
 >>>> This will work     

I try with some relative path and find this

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe ../../../../../../c/Perso/Code/boringssl/crypto/chacha/chacha.asm
../../../../../../c/Perso/Code/boringssl/crypto/chacha/chacha.asm: fatal: unable to open output file `../../../../../../c/Perso/Code/boringssl/crypto/chacha/chacha'

XXX@YYY /cygdrive/c/Perso/Code/boringssl/crypto/chacha
$ /cygdrive/c/Program\ Files/NASM/nasm.exe ../../../../../Perso/Code/boringssl/crypto/chacha/chacha.asm  
 >>>> This will work  

I can't make it work with absolute path, even with "/tmp/chacha.asm"

I also try with 2 different version of cygwin but same results.

My nasm version is "NASM version 2.15.05 compiled on Aug 28 2020"

I can't figure out what nasm need to work with an absolute path (or big relative path)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ら栖息 2025-01-21 09:11:12

您正在使用 Windows NASM,因此它无法将 cygwin 特定路径理解为
/cygdrive/c/Perso/Code/boringssl/crypto/chacha

或者您使用 Windows PATH 或使用 Cygwin NASM 包

https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fnasm%2Fnasm-2.13.01-1&grep=nasm

You are using a Windows NASM, as such it can NOT understand cygwin specific path as
/cygdrive/c/Perso/Code/boringssl/crypto/chacha

Or you use Windows PATH or you use the Cygwin NASM package

https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fnasm%2Fnasm-2.13.01-1&grep=nasm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文