[go: up one dir, main page]

Menu

#268 Bad ldd output for mingw32 binaries

1.0
closed
nobody
None
2017-02-03
2016-06-13
matlo
No

Hello,

Using msys64 on Windows 7 x64 and Windows 10 x64, the ouput of the ldd command is bad for mingw32 binaries:

$ ldd /mingw32/bin/gcc.exe
gcc.exe: fatal error: no input files
compilation terminated.
ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x77c50000)
ntdll.dll => /c/windows/SysWOW64/ntdll.dll (0x77e30000)
wow64.dll => /c/windows/SYSTEM32/wow64.dll (0x753d0000)
wow64win.dll => /c/windows/SYSTEM32/wow64win.dll (0x75370000)
wow64cpu.dll => /c/windows/SYSTEM32/wow64cpu.dll (0x75360000)
??? => ??? (0x776b0000)
kernel32.dll => /c/windows/syswow64/kernel32.dll (0x75fb0000)
??? => ??? (0x776b0000)
??? => ??? (0x77b50000)
kernel32.dll => /c/windows/syswow64/kernel32.dll (0x75fb0000)
KERNELBASE.dll => /c/windows/syswow64/KERNELBASE.dll (0x762a0000)
SYSFER.DLL => /c/windows/SysWOW64/SYSFER.DLL (0x752f0000)
msvcrt.dll => /c/windows/syswow64/msvcrt.dll (0x763a0000)
libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x64b40000)

For mingw64 binaries the output is correct:

$ ldd /mingw64/bin/gcc.exe
ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x77c50000)
kernel32.dll => /c/windows/system32/kernel32.dll (0x776b0000)
KERNELBASE.dll => /c/windows/system32/KERNELBASE.dll (0x7fefe160000)
SYSFER.DLL => /c/windows/System32/SYSFER.DLL (0x75430000)
msvcrt.dll => /c/windows/system32/msvcrt.dll (0x7feffe70000)
libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x64940000)

With msys32 the output is correct:

$ ldd /mingw32/bin/gcc.exe
ntdll.dll => /c/windows/SysWOW64/ntdll.dll (0x77e30000)
kernel32.dll => /c/windows/syswow64/kernel32.dll (0x75fb0000)
KERNELBASE.dll => /c/windows/syswow64/KERNELBASE.dll (0x762a0000)
SYSFER.DLL => /c/windows/SysWOW64/SYSFER.DLL (0x752f0000)
msvcrt.dll => /c/windows/syswow64/msvcrt.dll (0x763a0000)
libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x64b40000)

Discussion

  • David Macek

    David Macek - 2016-06-13

    Yes, there's no WoW-redirection support in ldd. You could report this to the Cygwin project (check for existing reports first), but honestly, I don't think there will be enough motivation for anyone to implement such a thing.

    You could also try the mingw-w64-i686-ntldd package, maybe it will suit your purpose.

     
  • matlo

    matlo - 2016-06-14

    I was under the impression that it worked at some point.
    I've been using ldd for almost a year to automatically add libraries into an installer.
    Maybe I've been lucky until now...

    Thanks for pointing out ntldd, it looks like it will handle the task.

     
  • David Macek

    David Macek - 2016-06-14

    Would you be willing to share your scripts? Distributing dynamically-linked software built with mingw-w64 is not exactly easy, as you probably agree, and it'd be nice to have some ready-to-use solution to point people to.

     
  • David Macek

    David Macek - 2017-02-03
    • status: open --> closed
     
  • David Macek

    David Macek - 2017-02-03

    Closing. New tickets can be filed at GitHub.