Menu

#3686 Snapshot doesn't run, misses DLLs

closed-fixed
None
other
7
2024-11-06
2023-12-13
No

Really simple:

  1. Download installer per https://sourceforge.net/projects/sdcc/: https://sourceforge.net/projects/sdcc/files/snapshot_builds/i586-mingw32msvc-setup/sdcc-20231213-14532-setup.exe/download
  2. Execute installer
  3. Attempt to start sdcc.exe
  4. Get hit with "Can't find libgcc_s_sjlj-1.dll" error per attached screenshot.

Copying that file from the latest stable x64 SDCC release into the same folder as sdcc.exe also doesn't work, the application will report error 0xc000007b then. This DLL seems from something with the MinGW compiler per https://stackoverflow.com/questions/12921911/mingw-libgcc-s-sjlj-1-dll-is-missing.

1 Attachments

Related

Bugs: #3714
Wiki: SDCC 4.5.0 Release

Discussion

  • Philipp Klaus Krause

    Looking at https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html I think including the DLL would make more sense than linking the GCC lib statically (apparently some C++ exceptions do not work with static linking).

     
  • Philipp Klaus Krause

    Hmm. sdcc/support/scripts/sdcc.nsi has this line:

    sdcc.nsi:  File "${SDCC_ROOT}\bin\libgcc_s_*-1.dll"
    

    That looks like it is meant for this DLL?

     
  • Philipp Klaus Krause

    Trying to build a 32-bit Windows snapshot locally, on my laptop, I ran into multiple issues, including this line:

    cp: der Aufruf von stat für '/usr/lib/gcc/i686-w64-mingw32/12-win32/libgcc_s_dw2-1.dll' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
    

    So something tries to get the DLL from the directory where GCC 12 had it, but my system has GCC 13 installed, and the DLL is actually in /usr/lib/gcc/i686-w64-mingw32/13-win32/libgcc_s_dw2-1.dll. While that is a different DLL, I wonder is the problems could be related.

     

    Last edit: Philipp Klaus Krause 2023-12-20
  • Philipp Klaus Krause

    I can reproduce the bug using current x86 snapshots installer on Windows 10 in a VM. Attemptiong to run sdcc results in error messages about both libgcc_s_sjlj-1.dll and libstdc++-6.dll. On the other hand, I see no such problem when using the current amd64 snapshots installer.

     
  • Philipp Klaus Krause

    @epetrich, AFAIK you are running the hardware that builds the 32-Bit snapshots. Do you have an idea what could have caused this problem?

     
  • Erik Petrich

    Erik Petrich - 2023-12-21

    I had to upgrade to a much newer cross compiler earlier this year to support a change that needed some newer C/C++ feature. Previously the 32-bit Windows snapshot was built with mingw32 and the 64-bit Windows snapshot was built with mingw-w64. Currently both are built with mingw-w64. I'm a little surprised that the regression tests are running without including these DLLs in the SDCC installer package, but I suppose wine is finding them somehow.

    To fix this, it looks like we will need to update sdcc-build/lib/bootstrap.mk to copy the DLLs into bin for both 32-bit and 64-bit rather than just 64-bit and then similarly update sdcc/support/scripts/sdcc.nsi to install the DLLs for both 32-bit and 64-bit rather than just 64-bit.

     
    • Philipp Klaus Krause

      Thanks. I made the change to bootstrap.mk in the nativecrosstools branch, and it works for me there for the .zip (I see the .dll files in there). I haven't gotten further yet.
      But this might still be good enough to try the fix in trunk next.

       

      Last edit: Philipp Klaus Krause 2024-01-09
    • Philipp Klaus Krause

      @epetrich: What would be the path to the two DLLs to use in bootstrap.mk for trunk?

       
      • Erik Petrich

        Erik Petrich - 2024-01-12

        I think ideally we would parse the output from calling gcc with --print-search-dirs to find its library directory so that it works with any version, but for now I have manually copied the .dll files to where bootstrap.mk is expecting them.

         
        • Philipp Klaus Krause

          Parsing sounds like a good long-term solution. Would be helpful for the nativecrosstools branch (and to reduce the diff between trunk and nativecrosstools): currently the paths there are hardcoded for GCC 13 on Debian, and won't even work with GCC 12 on Debian.

           
          • Philipp Klaus Krause

            An alternative might be to link statically. Anyway, I asked the MinGW people about the recommended approach: https://sourceforge.net/p/mingw-w64/support-requests/195/

             
  • Philipp Klaus Krause

     
  • Philipp Klaus Krause

    Using the current nativecrosstools branch, I was able to build a 32-bit Windows snapshot and installer last night, and run the regression tests. Today I verified that that installer installs SDCC in a Windows 10 VM, and it works for me there without any errors about missing DLLs.

     
  • Philipp Klaus Krause

    I've tried to make a fix in [r14600]. Though I'm not sure about the source paths in sdcc-build/lib/bootstrap.mk (previous testing was in the nativecrosstools branch, which by its nature needs to have different source paths there).

     

    Related

    Commit: [r14600]

    • Philipp Klaus Krause

      Looks like current snapshots 32-bit installers do install libgcc_s_sjlj-1.dll, so this is fixed now.

       
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     

Log in to post a comment.

MongoDB Logo MongoDB