[Bug libstdc++/35942] Self Reference In Dynamic Linked Library builds for building Cross-Compiler
--- Comment #7 from earthengine at gmail dot com 2008-10-22 10:31 --- Hi, We have found the reason of this problem. The GCC 4.3+ serials can automaticaly detect the --build parameter (i686-pc-linux-gnu, or something like that). However, the previous version will use --host parameter if it has been specified. In some case (especially mutilib-systems) when using configuring without --build, then the build system will wrongly detect the --build parameter, which will cause the libstdc++ to be detected should use a pre-build version. This causes many problems. We have solve it with explicitly specify the --build parameter. This should be written to the manual, and then this issue can be closed. Thank you. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35942
[Bug libstdc++/35942] Self Reference In Dynamic Linked Library builds for building Cross-Compiler
--- Comment #8 from earthengine at gmail dot com 2008-10-22 10:53 --- Let me explain it more clearly. Suppose I am building a toolchain to be running on a x86 Linux machine, and it will generate code for mips Linux. With gcc 4.2.x, I can use --host=i686-pc-linux-gnu --target=mips-linux-gnu and it will work on both x86-64 marchines as well because the 4.2.x build system will use i686-pc-linux-gnu as the --build parameter, and then it will be a case of normal cross compile. However, the previous configuration does not work under 4.3+. The reason is under 4.3+ the build system will detect the --build parameter as well, so the configuration will become --build=x86_64-unknown-linux-gnu --host=i686-pc-linux-gnu --target=mips-linux-gnu This is a Canadian cross compile! Usually, to complete a Canadian cross compile, we need the libstdc++ for mips-linux-gnu already because it can not depending on the just-compiled compiler (it would not run on the build machine) to compile this library. This is why we have this problem. The solution is to explicitly use --build=i686-pc-linux-gnu --host-pc-linux-gnu --target=mips-linux-gnu to force a normal cross compile. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35942
[Bug libstdc++/35942] Self Reference In Dynamic Linked Library builds for building Cross-Compiler
--- Comment #13 from earthengine at gmail dot com 2009-02-10 12:48 --- > whereas the --build part used to not be necessary. (Although I suppose > omitting > both host and build flags might work too, or just supplying > --host=x86_64-unknown-linux-gnu when compiling on x86_64 so that auto-detected > --build will be filled in equivalently.) No, you are wrong. If use --host=x86_64-unknown-linux-gnu and omitting the --build flag, in some machine the detected --build flag in 4.3.x is --build=core2-unknown-linux-gnu and in this case it is still a canadian cross build. I have seen it before. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35942
[Bug libstdc++/35942] New: Self Reference In Dinamic Linked Library builds for building Cross-Compiler
While building a cross-compiler, the the libstdc++-v3 includes a copy of Libtool script, which includes a reference to libstdc++ itself. This prevent the user to build a new compiler without existing libstdc++ for the target triplet. The following is a patch that tested to be working for this problem, but I think it should be done in a better way. ###BEGIN OF PATCH CODE## diff -Naur gcc-4.3-20080410.orig/libstdc++-v3/src/Makefile.in gcc-4.3-20080410/libstdc++-v3/src/Makefile.in --- gcc-4.3-20080410.orig/libstdc++-v3/src/Makefile.in 2008-03-01 05:26:50.0 +1100 +++ gcc-4.3-20080410/libstdc++-v3/src/Makefile.in 2008-04-14 23:16:35.0 +1000 @@ -212,6 +212,7 @@ LIBS = @LIBS@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIBTOOLLINK = @[EMAIL PROTECTED] LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ @@ -472,7 +473,7 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \ +CXXLINK = $(LIBTOOLLINK) --tag CXX --mode=link $(CXX) \ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ debugdir = debug @@ -536,7 +537,8 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES) +libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES) + sed '/postdeps=/[EMAIL PROTECTED]@\-lm@' `echo $(LIBTOOL) | cut -d\ -f2` > `echo $(LIBTOOLLINK) | cut -d\ -f2` $(CXXLINK) -rpath $(toolexeclibdir) $(libstdc___la_LDFLAGS) $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD) $(LIBS) mostlyclean-compile: ###END OF PATCH CODE## -- Summary: Self Reference In Dinamic Linked Library builds for building Cross-Compiler Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: earthengine at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35942
[Bug libstdc++/35942] Self Reference In Dynamic Linked Library builds for building Cross-Compiler
--- Comment #3 from earthengine at gmail dot com 2008-04-25 11:53 --- (In reply to comment #1) > Since there is no 4.3.1 release, only 4.3.0, can I assume you mean 4.3.0 for > the "Reported Against" field? > > libtool issues should be fixed in libtool if possible, and not hacked around > in > src/Makefile.am. Editing src/Makefile.in is incorrect, as this is a generated > file. > I tested with a snapshot gcc-4.3-20080410, and the internal version is 4.3.1 This is why I reported this issue with 4.3.1 I post the hacked code is only for you to find out what happen I meet. I also know that the files are generated, but I am new to gcc source code and I need time to find out which file should be update. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35942
[Bug libstdc++/35942] Self Reference In Dynamic Linked Library builds for building Cross-Compiler
--- Comment #5 from earthengine at gmail dot com 2008-04-25 14:12 --- (In reply to comment #4) > Please post the link commands that expose the self reference > (the libtool --mode=link stuff and whatever it generates). > Also how exactly you configure GCC. Also please post > cd $host/libstdc++-v3 && ./libtool --tag=CXX --config > > Thanks. > Error Report- libtool: link: x86_64-unknown-linux-gnu-g++ -shared -nostdlib /mnt/clfs/usr/lib/../lib64/crti.o /cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/crtbeginS.o .libs/bitmap_allocator.o .libs/pool_allocator.o .libs/mt_allocator.o .libs/codecvt.o .libs/compatibility.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/functexcept.o .libs/hash.o .libs/hash_c++0x.o .libs/globals_io.o .libs/hashtable.o .libs/hashtable_c++0x.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/debug_list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/ios-inst.o .libs/iostream-inst.o .libs/istream-inst.o .libs/istream.o .libs/locale-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/streambuf.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o .libs/parallel_list.o .libs/parallel_settings.o -Wl,--whole-archive ../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a -Wl,--no-whole-archive -L/cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1 -L/cross-tools/bin/../lib/gcc -L/cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../x86_64-unknown-linux-gnu/lib/../lib64 -L/mnt/clfs/lib/../lib64 -L/mnt/clfs/usr/lib/../lib64 -L/cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../x86_64-unknown-linux-gnu/lib -L/mnt/clfs/lib -L/mnt/clfs/usr/lib -lstdc++ -lm -lc -lgcc_s /cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/crtendS.o /mnt/clfs/usr/lib/../lib64/crtn.o -Wl,-O1 -Wl,-z -Wl,relro -Wl,--gc-sections -Wl,--version-script=libstdc++-symbols.ver -Wl,-soname -Wl,libstdc++.so.6 -o .libs/libstdc++.so.6.0.10 /cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lstdc++ --Configure & build script- CLFS_TAEGET=x86_64-unknown-linux-gnu CLFS_HOST=x86_64-cross-linux-gnu CLFS=/mnt/clfs AR=ar CXX_FOR_TARGET="$CLFS_TARGET-g++" CC_FOR_TARGET="$CLFS_TARGET-gcc" ../gcc-4.3-20080417/configure --prefix=${CLFS}/cross-tools \ --host=${CLFS_HOST} --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} --disable-nls --enable-shared \ --enable-languages=c,c++ --enable-__cxa_atexit \ --enable-c99 --enable-long-long --enable-threads=posix \ --with-gmp=$CLFS/cross-tools --with-mpfr=$CLFS/cross-tools && #I have only a static built gcc and if use it to build libgcc will fail make all-gcc && make install-gcc && #I do not have the share library installed, which is needed to built libstdc++ make all-target-libgcc && make install-target-libgcc && #the error is on the make command make && make install --Output of Libtool config # Which release of libtool.m4 was used? macro_version=2.1a macro_revision=1.2435 # Whether or not to build shared libraries. build_libtool_libs=yes # Whether or not to build static libraries. build_old_libs=yes # What type of objects to build. pic_mode=default # Whether or not to optimize for fast installation. fast_install=yes # The host system. host_alias=x86_64-unknown-linux-gnu host=x86_64-unknown-linux-gnu host_os=linux-gnu # The build system. build_alias=x86_64-unknown-linux-gnu build=x86_64-unknown-linux-gnu build_os=linux-gnu # A sed program that does not truncate output. SED="/bin/sed" # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # A grep program that handles long lines. GREP="grep" # An ERE matcher. EGREP="grep -E" # A literal string matcher. FGREP="grep -F" # A BSD- or MS-compatible name lister. NM="/cross-tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../x86_64-unknown-linux-gnu/bin/nm" # Whether we need soft or hard links. LN_S="ln -s" # What is the maximum length of a command? max_cmd_len=98304 # Object file suffix (normally "o"). objext=o # Executable file suffix (normally ""). exeext= # whether the shell understands "unset". lt_unset=unset # turn