]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
ltmain.in: Avoid using deprecated MSVC -o option
authorOlly Betts <olly@survex.com>
Tue, 12 May 2026 02:20:54 +0000 (05:20 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Wed, 3 Jun 2026 17:41:53 +0000 (20:41 +0300)
Microsoft deprecated -o and MSVC emits a warning when used:

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release

The replacement when linking an executable is `-Fe`.

Reported: https://savannah.gnu.org/patch/?10570

* build-aux/ltmain.in: Replace -o with -Fe for MSVC compiler.

build-aux/ltmain.in

index 70d0e111091c39440b67db6e559660c8db3e8e27..3c30492bf631183d08f7aea096a8576dc4c79304 100644 (file)
@@ -8907,7 +8907,13 @@ func_mode_link ()
            # compiling, it, like the target executable, must be
            # executed on the $host or under an emulation environment.
            $opt_dry_run || {
-             $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+             func_cc_basename "$LTCC"
+             case $func_cc_basename_result in
+               cl|cl.exe)
+                 $LTCC $LTCFLAGS -Fe$cwrapper $cwrappersource ;;
+               *)
+                 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource ;;
+             esac
              $STRIP $cwrapper
            }