* AW: AIX link error with g++ 4.4.0 [not found] <3DD4561E58DC6D4690B05037024D58490320DCE9@m-s-app130.global.fjh.com> @ 2009-06-10 9:26 ` Fehringer Franz 2009-06-10 15:32 ` Ian Lance Taylor 0 siblings, 1 reply; 3+ messages in thread From: Fehringer Franz @ 2009-06-10 9:26 UTC (permalink / raw) To: gcc-help, gcc _____________________________________________ Von: Fehringer Franz Gesendet: Mittwoch, 10. Juni 2009 10:55 An: 'gcc-help@gnu.org'; 'gcc@gnu.org' Betreff: AIX link error with g++ 4.4.0 Hello all, I have exactly the same error like described in http://gcc.gnu.org/ml/gcc-help/2009-05/msg00323.html namely collect2: library libstdc++ -lsupc++ not found I have a POWER6 with AIX 6.1.2, for the build --disable-shared was used (i think this is the reason why this error does not show up in regular shared library builds). When i invoke g++ with both -v and -save-temps and then invoke the final collect2 step manually (using cut and paste) the link succeeds. According to my investigations, the reason for this kind of failure is * collect2 is executed via execvp in gcc.c resp. pex-unix.c * the link line (i.e. the collect2 invocation) contains -lstdc++ -lsupc++ since we are in the C++ realm. * The error now is, that -lstdc++ -lsupc++ is given in the execvp argument vector as one argument instead two separate arguments. * As a result the call to resolve_lib_name in collect2.c fails, since it can handle only one -lxxx per call and not multiple ones. Should i file a bug report and is there an easy resolution? Best regards Franz ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: AW: AIX link error with g++ 4.4.0 2009-06-10 9:26 ` AW: AIX link error with g++ 4.4.0 Fehringer Franz @ 2009-06-10 15:32 ` Ian Lance Taylor 2009-06-10 15:44 ` Dave Korn 0 siblings, 1 reply; 3+ messages in thread From: Ian Lance Taylor @ 2009-06-10 15:32 UTC (permalink / raw) To: Fehringer Franz; +Cc: gcc-help, gcc "Fehringer Franz" <Franz.Fehringer@fja.com> writes: > I have exactly the same error like described in > http://gcc.gnu.org/ml/gcc-help/2009-05/msg00323.html > namely > collect2: library libstdc++ -lsupc++ not found > I have a POWER6 with AIX 6.1.2, for the build --disable-shared was used > (i think this is the reason why this error does not show up in regular > shared library builds). > When i invoke g++ with both -v and -save-temps and then invoke the final > collect2 step manually (using cut and paste) the link succeeds. > According to my investigations, the reason for this kind of failure is > * collect2 is executed via execvp in gcc.c resp. pex-unix.c > * the link line (i.e. the collect2 invocation) contains -lstdc++ > -lsupc++ since we are in the C++ realm. > * The error now is, that -lstdc++ -lsupc++ is given in the execvp > argument vector as one argument instead two separate arguments. > * As a result the call to resolve_lib_name in collect2.c fails, > since it can handle only one -lxxx per call and not multiple ones. > Should i file a bug report and is there an easy resolution? Please never send e-mail to both gcc-help@gcc.gnu.org and gcc@gcc.gnu.org. This message is only appropriate for gcc-help@gcc.gnu.org. Thanks. The bug is in the way that gcc/gpg++spec.c uses LIBSTDCXX_STATIC, or possibly in the way that macro is defined in gcc/config/rs6000/aix.h. I don't see a simple fix. Please do file a bug, per http://gcc.gnu.org/bugs.html. Thanks. Ian ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: AW: AIX link error with g++ 4.4.0 2009-06-10 15:32 ` Ian Lance Taylor @ 2009-06-10 15:44 ` Dave Korn 0 siblings, 0 replies; 3+ messages in thread From: Dave Korn @ 2009-06-10 15:44 UTC (permalink / raw) To: Ian Lance Taylor; +Cc: Fehringer Franz, gcc-help, gcc [-- Attachment #1: Type: text/plain, Size: 905 bytes --] Ian Lance Taylor wrote: > "Fehringer Franz" <Franz.Fehringer@fja.com> writes: > >> I have exactly the same error like described in >> http://gcc.gnu.org/ml/gcc-help/2009-05/msg00323.html >> namely >> collect2: library libstdc++ -lsupc++ not found > The bug is in the way that gcc/gpg++spec.c uses LIBSTDCXX_STATIC, or > possibly in the way that macro is defined in gcc/config/rs6000/aix.h. I > don't see a simple fix. This is something I hacked together a while ago vs. 4.3.2 when I discovered you couldn't add -lsupc++ to LIBSTDCXX_STATIC because it counts as a single word in argv. (I later decided I didn't need to do this anyway, can't remember why I thought I needed to.) It's unconditional and would need to be made so but I think it would be the basis of a solution. Franz, you could attach it to the bug report when you file it, it might be useful to somebody. cheers, DaveK [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: g++spec-patch.diff --] [-- Type: text/x-c; name="g++spec-patch.diff", Size: 2077 bytes --] diff -purN -x CYGWIN-PATCHES -x 'aclocal.m4*' -x autom4te.cache -x config.cache -x config.log -x config.status -x config.h -x config.h.in -x ABOUT-NLS -x Makefile.in.in -x Makevars.template -x '*SlackBuild*' -x '*.egg-info' -x '*.class' -x '*.pyc' -x '*.mo' -x '*.gmo' -x '*.orig' -x '*.rej' -x '*.spec' -x '*.temp' -x '*~' -x '*.stackdump' -x COPYING -x INSTALL -x compile -x config-ml.in -x config.guess -x config.sub -x depcomp -x elisp-comp -x install-sh -x libtool.m4 -x ltoptions.m4 -x ltsugar.m4 -x ltversion.m4 -x 'lt~obsolete.m4' -x ltmain.sh -x mdate-sh -x missing -x mkinstalldirs -x py-compile -x symlink-tree -x texinfo.tex -x ylwrap -x config.rpath -x configure -x omf.make -x xmldocs.make -x gnome-doc-utils.make -x gnome-doc-utils.m4 -x intltool.m4 -x intltool-extract -x intltool-extract.in -x intltool-merge -x intltool-merge.in -x intltool-update -x intltool-update.in origsrc/gcc-4.3.2/gcc/cp/g++spec.c src/gcc-4.3.2/gcc/cp/g++spec.c --- origsrc/gcc-4.3.2/gcc/cp/g++spec.c 2007-08-06 12:10:19.000000000 +0100 +++ src/gcc-4.3.2/gcc/cp/g++spec.c 2008-09-08 01:42:32.968750000 +0100 @@ -44,6 +44,9 @@ along with GCC; see the file COPYING3. #ifndef LIBSTDCXX_PROFILE #define LIBSTDCXX_PROFILE LIBSTDCXX #endif +#ifndef LIBSUPCXX +#define LIBSUPCXX "-lsupc++" +#endif void lang_specific_driver (int *in_argc, const char *const **in_argv, @@ -257,7 +260,7 @@ lang_specific_driver (int *in_argc, cons #endif /* Make sure to have room for the trailing NULL argument. */ - num_args = argc + added + need_math + shared_libgcc + (library > 0) + 1; + num_args = argc + added + need_math + shared_libgcc + (library > 0 ? 2 : 0) + 1; arglist = XNEWVEC (const char *, num_args); i = 0; @@ -319,6 +322,10 @@ lang_specific_driver (int *in_argc, cons if (arglist[j][0] != '-' || arglist[j][1] == 'l') added_libraries++; j++; + arglist[j] = LIBSUPCXX; + if (arglist[j][0] != '-' || arglist[j][1] == 'l') + added_libraries++; + j++; } if (saw_math) arglist[j++] = saw_math; ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-10 15:44 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <3DD4561E58DC6D4690B05037024D58490320DCE9@m-s-app130.global.fjh.com> 2009-06-10 9:26 ` AW: AIX link error with g++ 4.4.0 Fehringer Franz 2009-06-10 15:32 ` Ian Lance Taylor 2009-06-10 15:44 ` Dave Korn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).