Re: tag inference broken?
On Sun, 2003-12-07 at 23:18, Peter O'Gorman wrote: Scott James Remnant wrote: | On Sat, 2003-12-06 at 15:14, Peter O'Gorman wrote: |Looks like it is simply infering too early in link mode. | | | Yeah, my last patch moved the code to before the rest of the argument | parsing to make -shared, -static and -all-static work with a tagged | configuration. | Actually, I fixed it much more simply by changing the case $base_compile to case $base_compile $@ in both places in link mode. That'd work too, as far as I can see the loop just sticks every $arg into $base_compile anyway. Hell, we could probably get away with the following patch and that'd probably result in exactly the same thing, there's nothing that breaks out of that loop. Scott -- Have you ever, ever felt like this? Had strange things happen? Are you going round the twist? --- ltmain.in.orig 2003-12-17 23:21:55.0 + +++ ltmain.in 2003-12-17 23:22:30.0 + @@ -856,7 +856,7 @@ ;; esac libtool_args=$nonopt -base_compile=$nonopt +base_compile=$nonopt $@ compile_command=$nonopt finalize_command=$nonopt @@ -906,7 +906,7 @@ # Only attempt this if the compiler in the base link # command doesn't match the default compiler. if test -n $available_tags test -z $tagname; then - case $base_compile in + case $base_compile in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. $CC * | $CC * | `$echo $CC` * | `$echo $CC` *) ;; @@ -917,7 +917,7 @@ if grep ^# ### BEGIN LIBTOOL TAG CONFIG: $z$ $0 /dev/null; then # Evaluate the configuration. eval `${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' $0` - case $base_compile in + case $base_compile in $CC * | $CC * | `$echo $CC` * | `$echo $CC` *) # The compiler in $compile_command matches # the one in the tagged configuration. @@ -985,7 +985,6 @@ # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg=$1 - base_compile=$base_compile $arg shift case $arg in *[\[\~\#\^\\*\(\)\{\}\|\;\\\?\'\ \ ]*|*]*|) signature.asc Description: This is a digitally signed message part ___ Libtool mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/libtool
Re: tag inference broken?
On Sat, 2003-12-06 at 15:14, Peter O'Gorman wrote: Albert Chin wrote: | On Sat, Dec 06, 2003 at 10:57:52PM +0900, Peter O'Gorman wrote: | |Okay, I must be stupid, the tag inference goes like this: |case $base_compile in | | Before the case, what is the output of: | echo .$CC. And things begin to make a little more sense, with echo .$CC. and echo .$base_compile. before the case statement in both compile and link modes, I get the following output # comments added: .gcc -arch ppc -arch i386. # This is .$CC. .gcc. # And .$base_compile. libtool: link: unable to infer tagged configuration libtool: link: specify a tag with `--tag' make[1]: *** [libltdl.la] Error 1 make: *** [all] Error 2 Looks like it is simply infering too early in link mode. Yeah, my last patch moved the code to before the rest of the argument parsing to make -shared, -static and -all-static work with a tagged configuration. Here's a patch you might want to try; it moves the tagged config inference to beneath the argument parsing again. I also had to move the handling of those three arguments to beneath it as well, even though for some reason they were separate (I couldn't find a reason for this anymore...) Anyway, this probably breaks everything, but try it anyway :-) Scott -- Have you ever, ever felt like this? Had strange things happen? Are you going round the twist? diff -ruNp libtool-CVS~/ChangeLog libtool-CVS/ChangeLog --- libtool-CVS~/ChangeLog 2003-11-30 17:13:29.0 + +++ libtool-CVS/ChangeLog 2003-12-07 18:59:19.0 + @@ -0,0 +1,7 @@ +2003-12-07 Scott James Remnant [EMAIL PROTECTED] + + * ltmain.in: Move the code to infer the tagged configuration in + link mode until after the argument parsing again, so $base_compile + contains the complete command line. Move the code to handle -shared, + -static and -all-static until after this. + diff -ruNp libtool-CVS~/ltmain.in libtool-CVS/ltmain.in --- libtool-CVS~/ltmain.in 2003-11-26 15:20:42.0 + +++ libtool-CVS/ltmain.in 2003-12-07 18:54:43.0 + @@ -900,87 +900,7 @@ EOF thread_safe=no vinfo= vinfo_number=no - -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the --tag command line option. -# Only attempt this if the compiler in the base link -# command doesn't match the default compiler. -if test -n $available_tags test -z $tagname; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - $CC * | $CC * | `$echo $CC` * | `$echo $CC` *) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep ^# ### BEGIN LIBTOOL TAG CONFIG: $z$ $0 /dev/null; then - # Evaluate the configuration. - eval `${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' $0` - case $base_compile in - $CC * | $CC * | `$echo $CC` * | `$echo $CC` *) - # The compiler in $compile_command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the --tag command - # line option must be used. - if test -z $tagname; then - $echo $modename: unable to infer tagged configuration - $echo $modename: specify a tag with \`--tag' 12 - exit 1 -# else -# $echo $modename: using $tagname tagged configuration - fi - ;; - esac -fi - -# We need to know -static, to get the right output filenames. -for arg -do - case $arg in - -shared) - if test $build_libtool_libs != yes; then - $echo $modename: can not build a shared library 12 - $echo Fatal configuration error. 12 - exit 1 - fi - build_old_libs=no - break - ;; - -all-static | -static) - if test X$arg = X-all-static; then - if test $build_libtool_libs = yes test -z $link_static_flag; then - $echo $modename: warning: complete static linking is impossible in this configuration 12 - fi - if test -n $link_static_flag; then - dlopen_self=$dlopen_self_static - # See comment for -static flag below, for more details. - compile_command=$compile_command $link_static_flag - finalize_command=$finalize_command $link_static_flag - fi - else - if test -z $pic_flag test -n $link_static_flag; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac -done - -# See if our shared archives depend on static archives. -test -n $old_archive_from_new_cmds build_old_libs=yes +later= # Go through the arguments,
Re: tag inference broken?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Scott James Remnant wrote: | On Sat, 2003-12-06 at 15:14, Peter O'Gorman wrote: |Looks like it is simply infering too early in link mode. | | | Yeah, my last patch moved the code to before the rest of the argument | parsing to make -shared, -static and -all-static work with a tagged | configuration. | Actually, I fixed it much more simply by changing the case $base_compile to case $base_compile $@ in both places in link mode. Not sure which solution is better, I'll try yours when I get the chance. I am not convinced at all that this is your fault either, I never tried setting CC to a program with args before, it may have been broken for a while. Peter - -- Peter O'Gorman - http://www.pogma.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iQCVAwUBP9O1TriDAg3OZTLPAQJxNwP+Lr31iwN1SCAHJv5FjqwXpv1vf8imrwN6 iRnEcj3IVWuJLGFomucF4UIBKs55B8e8LsEQgUy5wfIEYviE//pvmQcpTDUb8fEQ HZWJlk6rtUStzjX6Dr7NJekiLTesWbJfYd4UWOtFaoVWwGmnxvSFmiDw4lf+55xm q0HuL+NQAjs= =ufFT -END PGP SIGNATURE- ___ Libtool mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/libtool
Re: tag inference broken?
On Sat, Dec 06, 2003 at 10:57:52PM +0900, Peter O'Gorman wrote: Okay, I must be stupid, the tag inference goes like this: case $base_compile in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. $CC * | $CC * | `$echo $CC` * | `$echo $CC` *) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. Now, $CC is allowed to be a program name with arguments (isn't it?), but at this point $base_compile only contains the program name gcc in my case, so when I set CC to (on darwin) gcc -arch ppc -arch i386 and set CXX to g++ -arch ppc -arch i386 I expected (without having looked at the code) tag inference to work. It doesn't of course. Before the case, what is the output of: echo .$CC. -- albert chin ([EMAIL PROTECTED]) ___ Libtool mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/libtool
Re: tag inference broken?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Albert Chin wrote: | On Sat, Dec 06, 2003 at 10:57:52PM +0900, Peter O'Gorman wrote: | |Okay, I must be stupid, the tag inference goes like this: |case $base_compile in | | Before the case, what is the output of: | echo .$CC. And things begin to make a little more sense, with echo .$CC. and echo .$base_compile. before the case statement in both compile and link modes, I get the following output # comments added: /bin/sh ../libtool --mode=compile gcc -arch ppc -arch i386 - -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c -o ltdl.lo `test -f 'ltdl.c' || echo './'`ltdl.c .gcc -arch ppc -arch i386. # This is .$CC. . gcc -arch ppc -arch i386 -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c. # This is .$base_compile. mkdir .libs ~ gcc -arch ppc -arch i386 -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c ltdl.c - -fno-common -DPIC -o .libs/ltdl.o ~ gcc -arch ppc -arch i386 -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c ltdl.c - -o ltdl.o /dev/null 21 /bin/sh ../libtool --mode=link gcc -arch ppc -arch i386 -g -O2 -o libltdl.la -rpath /usr/local/lib -no-undefined -version-info 4:0:1 ltdl.lo -ldl .gcc -arch ppc -arch i386. # This is .$CC. .gcc. # And .$base_compile. libtool: link: unable to infer tagged configuration libtool: link: specify a tag with `--tag' make[1]: *** [libltdl.la] Error 1 make: *** [all] Error 2 Looks like it is simply infering too early in link mode. Peter - -- Peter O'Gorman - http://www.pogma.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iQCVAwUBP9HyOLiDAg3OZTLPAQJRYAQAvPtRKJMpnA9fpTTsjP5QziY4GfLHkgsS HSJtJJaa8Apx0cTqTeKR+1SPO+VzecrYVAntwj0Tb80aYRAN/kgMNbN7OblMLDnv 5AMQTeFSibUF1LJCHFbNYDU+5qDwrrNHoKJfFgURbznlBG6H6QGBOWlwQPgrQJ4a cYf/Ldy7VUM= =wwRD -END PGP SIGNATURE- ___ Libtool mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/libtool