bug#27866: Handle clang's internal libraries when finding compiler's internal libraries
Martin Storsjö <[email protected]> Sun, 15 May 2022 23:21:35 +0300 (EEST)
| Newsgroups | gmane.comp.gnu.libtool.bugs |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 15 May 2022, Alex Ameen wrote:
> Earlier this week I read through the thread, and created a patch based on the
> ones posted. This was checked if you would like to experiment with it.
>
> What I did notice was that this change has a wider effect than the problem
> statement initially suggests. I'm not crazy about the way it has a
> conditional behavior for two specific libraries since it is an ad-hoc
> solution directed at two compiler-collections, as opposed to a general
> purpose solution; but for the time being I see this as a practical change.
>
> As a side effect this change should also resolve issues with certain
> flag-specs such as `-fsanitize' which is nice; but the impact of unknown side
> effects is something I expect will rear its head in the near future. With
> that in mind, I think this is a necessary change, but I want to express up
> front that "I'm confident this will break a lot of existing builds, and I
> consider this to be a first draft".
>
> I would greatly appreciate y'all taking this for a spin on any available
> projects you have to get a sense of how it will behave "in the field". This
> change really effects "unspecified behavior" that the test-suite isn't
> designed to audit, but nonetheless has a practical effect on users.
Thanks!
I tested this now, and it doesn't work quite as is - it needs this
modification:
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index ab5af335..9c084816 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -7554,7 +7554,7 @@ if AC_TRY_EVAL(ac_compile); then
for p in `eval "$output_verbose_link_cmd"`; do
case $prev$p in
- -L* | -R* | -l* | */clang_rt*.a)
+ -L* | -R* | -l* | */libclang_rt*.a)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
if test x-L = "$p" ||
(This was correct in one out of two instances in
1d2577357ee704da2d6d7c7da119ad82ba8ca172.)
With that changed, it does seem to work as it should for me on a test
project.
// Martin
_______________________________________________
Bug-libtool mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-libtool