GNU bug report logs -
#74175
libtool mishandles some compiler flags when used with MSVC tools
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#74175: libtool mishandles some compiler flags when used with MSVC tools
which was filed against the libtool package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 74175 <at> debbugs.gnu.org.
--
74175: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74175
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
On 13/11/2024 21:59, Ileana Dumitrescu wrote:
> Hi Kirill,
>
> On 02/11/2024 09:17, Kirill Makurin wrote:
>> The encountered bugs are as follows:
>>
>> 1. When libtool is used with MSVC tools, libtool's link step
>> mishandles compiler flags like`-Wl` and `-Xlinker`. For example, `-
>> Wl,- def:FILENAME` becomes plain `-def:FILENAME` when libtool invokes
>> the compiler*. (as seen in make-msvc.txt)
This part of the bug report has a patch applied [1] in the development
branch now, which should migrate to master after some more time. MSVC
building and testing has greatly improved, so I will hopefully get
another stable release with these fixes out in a couple months.
[1]https://cgit.git.savannah.gnu.org/cgit/libtool.git/commit/?h=development&id=4ded381a6f09cb761a05403450b5e34fec945f5a
--
Ileana Dumitrescu
GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354
[OpenPGP_0x6570EA01146F7354.asc (application/pgp-keys, attachment)]
[OpenPGP_signature.asc (application/pgp-signature, attachment)]
[Message part 6 (message/rfc822, inline)]
[Message part 7 (text/plain, inline)]
Hello,
I have encountered a few bugs with libtool when it is used with MSVC tools.
I have written a simple dummy project which should demonstrate the bugs. I uploaded the archive to Google Drive: https://drive.google.com/drive/folders/1DPJTid8PG6JjR7MHKKoz_i2QQTRGh8EO
The `configure`, `Makefile.in` etc. were generated from Msys2 environment with Autoconf 2.72, Automake 1.17 and libtool 2.5.3.
When built with MSVC tools, it will 1) produce a warning from the compiler (cl.exe) about unrecognized option and 2) fail with error from the linker (link.exe) about missing input file.
I also attached two files containing output from make for comparison. One when used with MSVC tools and another when used with GNU tools.
The encountered bugs are as follows:
1. When libtool is used with MSVC tools, libtool's link step mishandles compiler flags like`-Wl` and `-Xlinker`. For example, `-Wl,-def:FILENAME` becomes plain `-def:FILENAME` when libtool invokes the compiler*. (as seen in make-msvc.txt)
2. When producing a DLL, libtool passes `-Fe FILENAME` directly to the compiler*. The space between `-Fe` and `FILENAME` prevents cl.exe (and clang-cl.exe) from treating FILENAME as an output file, but rather as an input file.
* the compiler in question is `path/to/compile cl.exe` which should handle the usual `-o FILENAME` and flags like `-Wl` correctly with cl.exe
The second bug does not appear when libtool creates executables. It also seems to appear only in recent versions of libtool, since it does not appear in existing projects which used older versions of libtool. In older versions, libtool passes `-o FILENAME` which is handled by `compile` wrapper.
- Kirill Makurin
[Message part 8 (text/html, inline)]
[make-gnu.txt (text/plain, attachment)]
[make-msvc.txt (text/plain, attachment)]
This bug report was last modified 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.