Author Topic: NASM can't read Cygwin paths?  (Read 11393 times)

Offline Reino

  • Jr. Member
  • *
  • Posts: 2
NASM can't read Cygwin paths?
« on: January 04, 2018, 12:17:08 AM »
Hello,

I'm using a cross-compile script, which uses Cygwin, MingW, GCC and NASM, to compile x264 and FFmpeg among other libraries.
I've always used Cygwin's NASM ("NASM version 2.10.05 compiled on Sep 11 2012"), untill not so long ago x264 changed to minimum required version of NASM to v2.13. I've successfully compiled NASM 2.13.02 myself by doing a simple ./configure and make, and with it I've successfully compiled x264.

Next I wanted to replace it for Cygwin's NASM to compile all other libraries with the latest NASM as well.
The following is an excerpt from FFmpeg's 'config.log':

Code: [Select]
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -D_WIN32_WINNT=0x0600 -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -march=pentium3 -O2 -mfpmath=sse -msse -DCACA_STATIC -DLIBTWOLAME_STATIC -march=pentium3 -O2 -mfpmath=sse -msse -std=c11 -fomit-frame-pointer -c -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.c
nasm -v
NASM version 2.10.05 compiled on Sep 11 2012
check_x86asm movbe ecx, [5]
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
    1    movbe ecx, [5]
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
nasm -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
check_x86asm vmovdqa32 [eax]{k1}{z}, zmm0
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
    1    vmovdqa32 [eax]{k1}{z}, zmm0
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
/cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S:1: error: parser: instruction expected
check_x86asm vextracti128 xmm0, ymm0, 0
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
    1    vextracti128 xmm0, ymm0, 0
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
check_x86asm vpmacsdd xmm0, xmm1, xmm2, xmm3
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
    1    vpmacsdd xmm0, xmm1, xmm2, xmm3
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
check_x86asm vfmaddps ymm0, ymm1, ymm2, ymm3
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
    1    vfmaddps ymm0, ymm1, ymm2, ymm3
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
check_x86asm CPU amdnop
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
    1    CPU amdnop
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.NvmIZN9O/test.S

No problem at all as you can see.
When I use NASM 2.13.02 however I'm getting:

Code: [Select]
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -D_WIN32_WINNT=0x0600 -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -march=pentium3 -O2 -mfpmath=sse -msse -DCACA_STATIC -DLIBTWOLAME_STATIC -march=pentium3 -O2 -mfpmath=sse -msse -std=c11 -fomit-frame-pointer -c -o /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/ffconf.Zrz2Fm8R/test.o /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/ffconf.Zrz2Fm8R/test.c
nasm -v
NASM version 2.13.02 compiled on Jan  2 2018
check_x86asm movbe ecx, [5]
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.S
    1    movbe ecx, [5]
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.S
nasm -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.S
nasm: fatal: unable to open output file `/cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.o'
nasm -v
NASM version 2.13.02 compiled on Jan  2 2018
check_x86asm movbe ecx, [5]
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.S
    1    movbe ecx, [5]
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.S
nasm -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.S
nasm: fatal: unable to open output file `/cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.Zrz2Fm8R/test.o'

It somehow can't open Cygwin paths... How is this possible? Is this something I forgot while compiling NASM 2.13.02?
NASM's 'configure' did warn me about:

Code: [Select]
checking for asciidoc... no
checking for xmlto... no
configure: WARNING: No asciidoc package found
configure: WARNING: No xmlto package found

but I don't know if those are important for this.

Offline Reino

  • Jr. Member
  • *
  • Posts: 2
Re: NASM can't read Cygwin paths?
« Reply #1 on: March 17, 2018, 09:02:19 PM »
This week I had another look at this.
To cross-compile on Windows I first install Cygwin. Then I use a MinGW build script to compile the latest GCC using Cygwin's compilers. And it's this latest GCC binary I'm using to compile everything that follows, including the latest NASM.
It suddenly occurred to me that in order for NASM to read Cygwin paths I had to compile NASM with Cygwin's GCC rather than MinGW's GCC.
And after having done so my hunch proved to be correct and FFmpeg's 'configure' was happy again:
Code: [Select]
nasm -v
NASM version 2.13.03 compiled on Mar 15 2018
test_x86asm movbe ecx, [5]
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
    1 movbe ecx, [5]
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
nasm -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
test_x86asm vmovdqa32 [eax]{k1}{z}, zmm0
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
    1 vmovdqa32 [eax]{k1}{z}, zmm0
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
test_x86asm vextracti128 xmm0, ymm0, 0
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
    1 vextracti128 xmm0, ymm0, 0
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
test_x86asm vpmacsdd xmm0, xmm1, xmm2, xmm3
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
    1 vpmacsdd xmm0, xmm1, xmm2, xmm3
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
test_x86asm vfmaddps ymm0, ymm1, ymm2, ymm3
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
    1 vfmaddps ymm0, ymm1, ymm2, ymm3
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
test_x86asm CPU amdnop
BEGIN /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
    1 CPU amdnop
END /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
nasm -f win32 -DPREFIX -Werror -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S
/cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.p7gxGA9N/test.S:1: error: unknown 'cpu' type 'amdnop'

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: NASM can't read Cygwin paths?
« Reply #2 on: March 17, 2018, 09:15:16 PM »
Okay. Thanks for the update, Reino.

Best,
Frank