public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't
@ 2023-02-15 16:00 Mark Wielaard
  2023-02-16 10:48 ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2023-02-15 16:00 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

There have been a couple of cases where demangler support has been
accidentially been disabled because libstdc++ wasn't there/installed
during build. Make it an error if --disable-demangler isn't explicitly
given.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 ChangeLog    | 5 +++++
 configure.ac | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a46cca6c..d99d837d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-15  Mark Wielaard  <mark@klomp.org>
+
+	* configure.ac: Error out when demangler is enabled, but
+	__cxa_demangle cannot be found.
+
 2023-01-11  Frank Ch. Eigler  <fche@redhat.com>
 
 	* configure.ac: Add some rlimit/affinity checks.
diff --git a/configure.ac b/configure.ac
index 18951947..1ef45c0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -498,7 +498,8 @@ AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl
 AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])])
 AM_CONDITIONAL(DEMANGLE, test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes")
 AS_IF([test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes"],
-      [enable_demangler=yes],[enable_demangler=no]),
+      [enable_demangler=yes],
+      [AC_MSG_ERROR([__cxa_demangle not found in libstdc++ use --disable-demangler to disable demangler support.])]),
 AM_CONDITIONAL(DEMANGLE, false))
 
 AC_ARG_ENABLE([textrelcheck],
-- 
2.39.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't
  2023-02-15 16:00 [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't Mark Wielaard
@ 2023-02-16 10:48 ` Florian Weimer
  2023-02-16 13:08   ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2023-02-16 10:48 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: elfutils-devel

* Mark Wielaard:

> +      [AC_MSG_ERROR([__cxa_demangle not found in libstdc++ use --disable-demangler to disable demangler support.])]),

Missing punctuation after libstdc++?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't
  2023-02-16 10:48 ` Florian Weimer
@ 2023-02-16 13:08   ` Mark Wielaard
  2023-02-16 17:02     ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Wielaard @ 2023-02-16 13:08 UTC (permalink / raw)
  To: Florian Weimer; +Cc: elfutils-devel

Hi Florian,

On Thu, 2023-02-16 at 11:48 +0100, Florian Weimer via Elfutils-devel
wrote:
> * Mark Wielaard:
> 
> > +      [AC_MSG_ERROR([__cxa_demangle not found in libstdc++ use --disable-demangler to disable demangler support.])]),
> 
> Missing punctuation after libstdc++?

You probably mean you like to see a comma after libstdc++?
That sounds reasonable. But I had to double quote the argument to
AC_MSG_ERROR, otherwise the comma was seen as a argument separator?
Which I find slightly odd, but I don't fully grok autoconf quotes.

Does the following do what you expect?

diff --git a/configure.ac b/configure.ac
index 1ef45c0f..4c8a4c31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -499,7 +499,7 @@ AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])])
 AM_CONDITIONAL(DEMANGLE, test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes")
 AS_IF([test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes"],
       [enable_demangler=yes],
-      [AC_MSG_ERROR([__cxa_demangle not found in libstdc++ use --disable-demangler to disable demangler support.])]),
+      [AC_MSG_ERROR([[__cxa_demangle not found in libstdc++, use --disable-demangler to disable demangler support.]])]),
 AM_CONDITIONAL(DEMANGLE, false))
 
 AC_ARG_ENABLE([textrelcheck],

Thanks,

Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't
  2023-02-16 13:08   ` Mark Wielaard
@ 2023-02-16 17:02     ` Florian Weimer
  2023-02-16 23:09       ` Mark Wielaard
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2023-02-16 17:02 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: elfutils-devel

* Mark Wielaard:

> Hi Florian,
>
> On Thu, 2023-02-16 at 11:48 +0100, Florian Weimer via Elfutils-devel
> wrote:
>> * Mark Wielaard:
>> 
>> > +      [AC_MSG_ERROR([__cxa_demangle not found in libstdc++ use --disable-demangler to disable demangler support.])]),
>> 
>> Missing punctuation after libstdc++?
>
> You probably mean you like to see a comma after libstdc++?

Comma or semicolon.

> That sounds reasonable. But I had to double quote the argument to
> AC_MSG_ERROR, otherwise the comma was seen as a argument separator?

Ohh.  I had not consider that.

> Which I find slightly odd, but I don't fully grok autoconf quotes.
>
> Does the following do what you expect?

Yes, but even though I patched dozens of m4 files lately, I still don't
get the quoting rules.  For me, it's mostly “add […] until it breaks,
then remove one layer” …

Thanks,
Florian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't
  2023-02-16 17:02     ` Florian Weimer
@ 2023-02-16 23:09       ` Mark Wielaard
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Wielaard @ 2023-02-16 23:09 UTC (permalink / raw)
  To: Florian Weimer; +Cc: elfutils-devel

Hi Florian,

On Thu, Feb 16, 2023 at 06:02:49PM +0100, Florian Weimer via Elfutils-devel wrote:
> * Mark Wielaard:
> > Which I find slightly odd, but I don't fully grok autoconf quotes.
> >
> > Does the following do what you expect?
> 
> Yes, but even though I patched dozens of m4 files lately, I still don't
> get the quoting rules.  For me, it's mostly “add […] until it breaks,
> then remove one layer” …

Grin. That is good enough for me :)
Pushed.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-16 23:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 16:00 [PATCH] configure: Error when demangler is enabled, but libstdc++ support isn't Mark Wielaard
2023-02-16 10:48 ` Florian Weimer
2023-02-16 13:08   ` Mark Wielaard
2023-02-16 17:02     ` Florian Weimer
2023-02-16 23:09       ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).