bug#27866: Handle clang's internal libraries when finding compiler's internal libraries

Martin Storsjö <[email protected]> Fri, 25 Apr 2025 16:43:49 +0300 (EEST)
Newsgroups gmane.comp.gnu.libtool.bugs
Message-ID <[email protected]>
Hi Ileana,

On Tue, 15 Apr 2025, Ileana Dumitrescu wrote:

> Thank you for your bug submission. This issue may be fixed by
> utilizing a new configuration option, --enable-cxx-stdlib [1], since it
> has been confirmed to fix a similar bug report [2]. If re-configuring
> does not fix the issue, I will reopen this bug.

Thanks for looking into this bug (and sorry for taking a little while to 
follow up on this).

Yes, using the new option --enable-cxx-stdlib does avoid hitting this 
issue. However, as this requires explicit opt-in from users (either from 
project maintainers, enabling it via LT_INIT, or from users to configure 
with --enable-cxx-stdlib), most users affected by this issue will still 
keep hitting this issue (although they might have a way to work around it) 
- so I would appreciate if this bug would be reopened.

If --enable-cxx-stdlib would be enabled by default (as it perhaps might do 
at some point in the future?), this wouldn't be as much of an issue any 
longer.

The issue can be reproduced with a very minimal testcase at [1], using a 
toolchain from [2], e.g. [3].

To reproduce the issue, unpack the toolchain, add it to $PATH, unpack the 
testcase, run ./autogen.sh, and configure and build with "./configure 
--host=x86_64-w64-mingw32 && make".

The issue can be fixed by the referenced patches, or by reapplying 
1d2577357ee704da2d6d7c7da119ad82ba8ca172 (which was reverted quickly 
afterwards, without much explanation). That fix commit in itself is 
mildly incorrect though, it requires changing m4/libtool.m4 to reference 
*/libclang_rt*.a instead of */clang_rt*.a.

[1] https://martin.st/temp/libtool-compiler-rt.tar.gz
[2] https://github.com/mstorsjo/llvm-mingw/releases
[3] https://github.com/mstorsjo/llvm-mingw/releases/download/20250417/llvm-mingw-20250417-ucrt-ubuntu-22.04-x86_64.tar.xz

Thanks for the consideration!

// Martin