"The procedure entry point __divmoddi4 could not be located in the dynamic link library libgcc_s_dw2-1.dll"

muff diver muff.diver@india.com
Sat Sep 16 17:06:00 GMT 2017


Hello,

TL;DR - (Q1) How can I repair my gcc-6.4.0 installation without having to rebuild it? | (Q2) Why is my [prefix]/include directory empty?


Please, can anybody help me fix my gcc-6.4.0 installation? 

There seems to be several different problems. For example, during "make" and "make install", I saw tons of -L, -B and -I switches that pointed at non-existent locations.  configure was given  "--prefix=/gcc-6.4.0-i686-w64-mingw32". So during make, I would see stuff like...

_______________________________________________________________________________

"... -L/gcc-6.4.0-i686-w64-mingw32/i686-w64-mingw32/lib -L/gcc-6.4.0-i686-w64-mingw32/mingw/lib -isystem /gcc-6.4.0-i686-w64-mingw32/i686-w64-mingw32/include -isystem /gcc-6.4.0-i686-w64-mingw32/mingw/include -B/gcc-6.4.0-i686-w64-mingw32/i686-w64-mingw32/bin/ -B/gcc-6.4.0-i686-w64-mingw32/i686-w64-mingw32/lib/ -isystem /gcc-6.4.0-i686-w64-mingw32/i686-w64-mingw32/include -isystem /gcc-6.4.0-i686-w64-mingw32/i686-w64-mingw32/sys-include ..."

_______________________________________________________________________________


The thing is, none of those paths existed during the compile/build processes. And none of those paths were created _after_ the installation completed. What _does_ exist is 

_______________________________________________________________________________

[prefix]/bin/...
[prefix]/include [empty!]
[prefix]/lib/gcc/i686-w64-mingw32/6.4.0/...
[prefix]/lib/gcc/i686-w64-mingw32/lib/...
[prefix]/libexec/gcc/i686-w64-mingw32/6.4.0...
[prefix]/share/...
_______________________________________________________________________________

After the installation completed, my [prefix]/include folder is empty. But the local "Installing GCC: Final installation" doc in gcc-6.4.0/INSTALL says, "Headers for the C++ and Java libraries are installed in prefix/include".

There are also problems with gcj (gcj being the only reason I endured the two day ordeal). But, I won't go into those gcj problems here.

I would feel like I haven't wasted several days of my life if — at the very least — I were able to compile a "Hello World" exe with the g++ I just built.

I have read several older messages [http://bit.ly/LiuHaoEtAl] that discuss "___divmoddi4" and "___udivmoddi4" being new functions added to libgcc in GCC 7. If I understand those older messages correctly, I'm guessing the other posters' solution was to rebuild gcc for x86_64(?)

The _only_ reason that I built gcc-6.4.0 in the first place, is because I need gcj. And gcj cannot be built for x86_64 if I understand correctly. In any case, given that it took 2 days to build this installation, I would rather not have to go through the stress of yet another painfully slow build [for some reason, parallel jobs (-jN) always result in race conditions that break my build].

This is my setup...
_______________________________________________________________________________

OS: Windows 7 Professional 64 bit
Shell: MSYS2 32 bit
GCC Tool Chain: mingw-w64-i686-toolchain

$ gcc -v
$ Using built-in specs.
COLLECT_GCC=Z:\msys64\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=Z:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.2.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-7.2.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 7.2.0 (Rev1, Built by MSYS2 project)
_______________________________________________________________________________


Using the above setup, I managed to install gcc-6.4.0 from source with the following commands...

_______________________________________________________________________________

$ ../gcc-6.4.0/configure target=i686-w64-mingw32 --prefix=/gcc-6.4.0-i686-w64-mingw32 --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --enable-languages=java --enable-java --enable-shared --enable-static --enable-threads=win32 --disable-sjlj-exceptions --enable-libgomp --with-libiconv --with-libiconv-prefix=/tmp/gcc --enable-libstdcxx-debug --disable-win32-registry --disable-werror --enable-version-specific-runtime-libs --enable-libjava --enable-libgcj --enable-libgcj-sublibs --enable-libgomp --enable-libgcj-multifile --disable-multilib --with-dwarf2 --enable-libstdcxx-time=yes --with-antlr-jar=/z/development/gcc-6.4.0/src/build/../antlr-4.7-complete.jar --with-ecj-jar=/z/development/gcc-6.4.0/src/build/../ecj.jar --enable-bootstrap

$ make && make install

_______________________________________________________________________________


Here's what I did after the apparently successful installation of gcc-6.4.0 to z:/msys64/gcc-6.4.0-i686-w64-mingw32/ 

1. Open a Windows cmd prompt
2. cd z:\development\gcc-6.4.0\i.give.up ("Hello.cpp" located here)
3. set PATH=.;Z:\msys64\gcc-6.4.0-i686-w64-mingw32\bin;Z:\msys64\mingw32\bin;c:\Windows\System32;c:\Windows;c:\Windows\System32\Wbem;c:\Windows\System32\WindowsPowerShell\v1.0\
4. set GCC_EXEC_PREFIX=Z:\msys64\gcc-6.4.0-i686-w64-mingw32\lib\gcc\
5. TYPE Hello.cpp
========================= contents of Hello.cpp ================================
#include <iostream>

using namespace std;

int main( ){
  cout << "Goddamnit! Work!!!!!" << endl;
  return 0;
}
=========================== compile Hello.cpp ==================================

6. g++ -v -s -g -O2 -o HelloGCC640mingw32.exe Hello.cpp 

=========================== output of g++ -v ===================================
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=Z:/msys64/gcc-6.4.0-i686-w64-mingw32/lib/gcc/../../libexec/gcc/i686-w64-mingw32/6.4.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-6.4.0/configure target=i686-w64-mingw32 --prefix=/gcc-6.4.0-i686-w64-mingw32 --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --enable-languages=java --enable-java --enable-shared --enable-static --enable-threads=win32 --disable-sjlj-exceptions --enable-libgomp --with-libiconv --with-libiconv-prefix=/tmp/gcc --enable-libstdcxx-debug --disable-win32-registry --disable-werror --enable-version-specific-runtime-libs --enable-libjava --enable-libgcj --enable-libgcj-sublibs --enable-libgomp --enable-libgcj-multifile --disable-multilib --with-dwarf2 --enable-libstdcxx-time=yes --with-antlr-jar=/z/development/gcc-6.4.0/src/build/../antlr-4.7-complete.jar --with-ecj-jar=/z/development/gcc-6.4.0/src/build/../ecj.jar --enable-bootstrap
Thread model: win32
gcc version 6.4.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-s' '-g' '-O2' '-o' 'HelloGCC640mingw32.exe' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro' Z:/msys64/gcc-6.4.0-i686-w64-mingw32/lib/gcc/../../libexec/gcc/i686-w64-mingw32/6.4.0/cc1plus.exe -quiet -v -iprefix Z:\msys64\gcc-6.4.0-i686-w64-mingw32\lib\gcc\i686-w64-mingw32/6.4.0/ -U_REENTRANT Hello.cpp -quiet -dumpbase Hello.cpp -mtune=generic -march=pentiumpro -auxbase Hello -g -O2 -version -o C:\Users\WILLIA~1\AppData\Local\Temp\ccvpi6tV.s

=========================== Here's the problem... ==============================
cc1plus.exe - Entry Point Not Found

The procedure entry point __divmoddi4 could not be located in the dynamic link library libgcc_s_dw2-1.dll

================================================================================

That attempt to compile Hello.cpp resulted in "cc1plus.exe" throwing up an error dialog with the above message about "__divmoddi4" not located in "libgcc_s_dw2-1.dll".

"libgcc_s_dw2-1.dll" does exist. It is in my PATH. So I examined the symbol table...

7. objdump -t Z:\msys64\gcc-6.4.0-i686-w64-mingw32\bin\libgcc_s_dw2-1.dll


================ found a "___udivmoddi4" but no "___divmoddi4" =================
...
File 
[1781](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 1) 0x00006960 ___udivmoddi4
... (see attachment for the full objdump output)

================================================================================

The attached tar ball contains...

a. output of objdump libgcc_s_dw2-1.dll
b. stdout from the final 1.5 hours of "make install"
c. config.log files for libgcc and others


I had assumed it would be OK to build gcc-6.4.0 using a gcc-7.2.0 toolchain . Live and learn, I guess :¬(

TIA.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: entry.point.__divmoddi4.could.not.be.located.tar.gz
Type: application/x-gzip
Size: 269682 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20170916/a01e1238/attachment.bin>


More information about the Gcc-help mailing list