Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149414 - [cross-mingw32/gcc] libstdc++_pic.a fails to generate with gcc 3.4.6-r2
Summary: [cross-mingw32/gcc] libstdc++_pic.a fails to generate with gcc 3.4.6-r2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 154895 (view as bug list)
Depends on: 149538
Blocks:
  Show dependency tree
 
Reported: 2006-09-28 06:48 UTC by Roberto Castagnola
Modified: 2006-11-12 20:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cross-mingw32-info.log (cross-mingw32-info.log,3.98 KB, text/x-log)
2006-09-28 06:51 UTC, Roberto Castagnola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Castagnola 2006-09-28 06:48:43 UTC
I have tried to create mingw32 cross-compiler using crossdev-0.9.17 and gcc-3.4.6-r2 with this command:
crossdev mingw32 --gcc 3.4.6-r2 -v

Unfortunately, it fails to emerge cross-gcc-stage2 when doing 'make install':

/bin/install -c .libs/libstdc++.lai /mnt/gentoo/2006.0/var/tmp/cross/mingw32/portage/gcc-3.4.6-r2/image//usr/mingw32/lib/libstdc++.la
/bin/install -c .libs/libstdc++.a /mnt/gentoo/2006.0/var/tmp/cross/mingw32/portage/gcc-3.4.6-r2/image//usr/mingw32/lib/libstdc++.a
mingw32-ranlib /mnt/gentoo/2006.0/var/tmp/cross/mingw32/portage/gcc-3.4.6-r2/image//usr/mingw32/lib/libstdc++.a
chmod 644 /mnt/gentoo/2006.0/var/tmp/cross/mingw32/portage/gcc-3.4.6-r2/image//usr/mingw32/lib/libstdc++.a
libtool: install: warning: remember to run `libtool --finish /usr/mingw32/lib'
mingw32-ar cru libstdc++_pic.a .libs/*.o ../libsupc++/*.o
mingw32-ar: .libs/*.o: No such file or directory
make[3]: *** [install-exec-local] Error 1
make[3]: Leaving directory `/mnt/gentoo/2006.0/var/tmp/cross/mingw32/portage/gcc-3.4.6-r2/work/build/mingw32/libstdc++-v3/src'


Proposed patch:
-------------------------------------------------------------------------------------
--- gcc-3.4.6.orig/libstdc++-v3/src/Makefile.in
+++ gcc-3.4.6/libstdc++-v3/src/Makefile.in
@@ -713,7 +713,7 @@

 install-exec-local:
 ifeq ($(enable_shared),yes)
-       $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
+       $(AR) cru libstdc++_pic.a $(wildcard .libs/*.o) $(top_builddir)/libsupc++/*.o
        $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
 endif

-------------------------------------------------------------------------------------

Both sys-devel/gcc-3.4.6-r2 and cross-mingw32/gcc-3.4.6-r2 works with this patch.
Comment 1 Roberto Castagnola 2006-09-28 06:51:04 UTC
Created attachment 98315 [details]
cross-mingw32-info.log

If needed
Comment 2 SpanKY gentoo-dev 2006-09-28 07:34:43 UTC
no, that patch will create an incorrect libstdc++_pic.a
Comment 3 Roberto Castagnola 2006-09-28 10:00:09 UTC
Reading dev-util/xmingw-gcc ebuild I found out that it always use '--disable-shared' when configuring gcc.
Should this option fix the problem?
Comment 4 Roberto Castagnola 2006-09-29 09:41:41 UTC
Since cross-mingw32/gcc-4.1.1-r1 emerge creating libstdc++_pic.a, I have checked his log files and finally I have found a bug I have just reported (see Bug 149538)
Fixing this bug will probally break cross-mingw32/gcc-4.1.1-r1 in the same manner I have reported for 3.4.6 version.
I think we don't need to create shared library for mingw32 as his target should be to create program that use only native windows library.
Using '--disable-shared' when configuring gcc will avoid to create libstdc++_pic.a library fixing this problem.
If this could be the solution, this is my proposed patch for toolchain.eclass:

--- /usr/portage/eclass/toolchain.eclass        2006-09-28 14:06:06.000000000 +0200
+++ toolchain.eclass    2006-09-29 16:13:48.000000000 +0200
@@ -1267,6 +1267,7 @@
                        *-klibc)    needed_libc=klibc;;
                        *-uclibc*)  needed_libc=uclibc;;
                        avr)        confgcc="${confgcc} --enable-shared --disable-threads";;
+                       mingw*)     confgcc="${confgcc} --disable-shared";;
                esac
                if [[ -n ${needed_libc} ]] ; then
                        if ! has_version ${CATEGORY}/${needed_libc} ; then
Comment 5 SpanKY gentoo-dev 2006-10-01 15:55:43 UTC
fixed in cvs
Comment 6 SpanKY gentoo-dev 2006-11-12 20:15:17 UTC
*** Bug 154895 has been marked as a duplicate of this bug. ***