'nasm with long (or absolute) path unable to open output file (on cygwin)

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)



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 matzeri