From: SF/projects/mingw n. l. <min...@li...> - 2012-06-13 11:15:53
|
Bugs item #3534844, was opened at 2012-06-13 04:09 Message generated for change (Comment added) made by legends2k You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3534844&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: MinGW Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Sundaram Ramaswamy (legends2k) Assigned to: Nobody/Anonymous (nobody) Summary: DLL generated with -pg option in 4.7 is buggy Initial Comment: > gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-w64-mingw32/4.7.0/lto-wrapp er.exe Target: i686-w64-mingw32 Configured with: ../..//mingw-src/gcc-4.7.0/configure --host=i686-w64-mingw32 -- build=i686-w64-mingw32 --target=i686-w64-mingw32 --enable-targets=all --enable-m ultilib --prefix=/mingw-gcc-4.7.0-x32 --with-sysroot=/mingw-gcc-4.7.0-x32 --with -tune=generic --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes - -with-host-libstdcxx='-static -lstdc++' --enable-shared --enable-static --enable -threads=posix --enable-libgomp --enable-lto --enable-graphite --enable-cloog-ba ckend=isl --enable-checking=release --enable-fully-dynamic-string --enable-versi on-specific-runtime-libs --enable-sjlj-exceptions --disable-ppl-version-check -- disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug -- disable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disab le-werror --disable-symvers --with-gmp=/mingw-gcc-4.7.0-libs-x32 --with-mpfr=/mi ngw-gcc-4.7.0-libs-x32 --with-mpc=/mingw-gcc-4.7.0-libs-x32 --with-ppl=/mingw-gc c-4.7.0-libs-x32 --with-cloog=/mingw-gcc-4.7.0-libs-x32 --with-libiconv --with-p kgversion='MinGW-builds: https://sourceforge.net/projects/mingwbuilds/' --with-b ugurl=https://sourceforge.net/projects/mingwbuilds/ CFLAGS='-O2 -pipe -fomit-fra me-pointer -momit-leaf-frame-pointer -I/mingw-gcc-4.7.0-libs-x32/include' CXXFLA GS='-O2 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer' CPPFLAGS= LDFLAGS= '-pipe -s -L/mingw-gcc-4.7.0-libs-x32/lib' Thread model: posix gcc version 4.7.0 (MinGW-builds: https://sourceforge.net/projects/mingwbuilds/) libsimple.c 's contents: __declspec(dllexport) int add2Ints(int a, int b) { return a + b; } _________ > gcc -c libsimple.c > gcc -pg -mdll -o libsimple.dll libsimple.o gave me a DLL. Test program testlib.c #include <windows.h> int main() { int ret = -1; HINSTANCE hInst = LoadLibrary(L"libsimple.dll"); if (hInst) { ret = FreeLibrary(hInst); } return ret; } _________ compiles fine with gcc -g -o testlib.exe -DUNICODE testlib.c When testlib.exe is run, the FreeLibrary call hangs. I confirmed this in gdb. The same DLL when linked without the -pg option works fine. Linking the DLL with just -g or just -p works fine too. Now on MinGW 4.6.1 I've tried the same exercise and there -pg, -p or -g all the three works fine. ---------------------------------------------------------------------- >Comment By: Sundaram Ramaswamy (legends2k) Date: 2012-06-13 04:15 Message: To reproduce the issue, extract the attached Test.7z and run test.bat with MinGW 4.7's bin in %PATH%. See the issue, now try the same with MinGW 4.6.1 and see that the issue isn't there. ---------------------------------------------------------------------- Comment By: Sundaram Ramaswamy (legends2k) Date: 2012-06-13 04:12 Message: > ld -v GNU ld (GNU Binutils) 2.22.52.20120417 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3534844&group_id=2435 |