https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115453

--- Comment #6 from Arthur Cohen <cohenarthur at gcc dot gnu.org> ---
Sigh... sorry everyone. Clearly autotools/shell scripting requires skills that
I'm not even close to possessing.

(In reply to Andrew Pinski from comment #4)
> (In reply to Sam James from comment #3)
> > Also, a typo: it has ac_cv_search_pthread_crate (not create).
> 
> Someone had rust crate on their mind when they did the patch :).

Yes haha. Thanks for the heads-up Sam, good catch :)

(In reply to Andrew Pinski from comment #5)
> Also it is not just old glibc but most non-"modern" libc out there (e.g.
> Solaris I think). So maybe don't reference glibc in the comments in
> configure.ac either. Just say some libc.

Thanks! Did not know that!

The patch I'm proposing should hopefully fix things and contains an update to
the comment to not mention glibc specifically.

(In reply to Andrew Pinski from comment #2)
> Note when this gets fixed, Make sure that this gets synced over toto
> gdb-binutils repo too since toplevel configure is shared.

Do you mean that I should send this patch there as well?

Here is the patch to configure.ac. I'll obviously regenerate configure as well
when sending it.

>From 2fffac310b4a9cb7ba44d87983e8687fada2753b Mon Sep 17 00:00:00 2001
From: Arthur Cohen <arthur.co...@embecosm.com>
Date: Wed, 12 Jun 2024 12:37:28 +0200
Subject: [PATCH] configure.ac: Initial patch

---
 configure.ac | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index adb738ac346..0befcc01cd6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2036,7 +2036,7 @@ fi

 AC_SUBST(PICFLAG)

-# Rust requires -ldl and -lpthread if you are using an old glibc that does not
include them by
+# Rust requires -ldl and -lpthread if you are using a libc which does not
include them by
 # default, so we check for them here

 missing_rust_dynlibs=none
@@ -2044,15 +2044,15 @@ missing_rust_dynlibs=none
 AC_SEARCH_LIBS([dlopen], [dl])
 AC_SEARCH_LIBS([pthread_create], [pthread])

-if test $ac_cv_search_dlopen = -ldl; then
+if test "$ac_cv_search_dlopen" = -ldl; then
     CRAB1_LIBS="$CRAB1_LIBS -ldl"
-elif test $ac_cv_search_dlopen = no; then
+elif test "$ac_cv_search_dlopen" = no; then
     missing_rust_dynlibs="libdl"
 fi

-if test $ac_cv_search_pthread_create = -lpthread; then
+if test "$ac_cv_search_pthread_create" = -lpthread; then
     CRAB1_LIBS="$CRAB1_LIBS -lpthread"
-elif test $ac_cv_search_pthread_crate = no; then
+elif test "$ac_cv_search_pthread_create" = no; then
     missing_rust_dynlibs="$missing_rust_dynlibs, libpthread"
 fi

-- 
2.42.0

Reply via email to