]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stack-trace: Add support for Oracle DeveloperStudio cc.
authorBruno Haible <bruno@clisp.org>
Thu, 18 Sep 2025 18:57:26 +0000 (20:57 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Sep 2025 18:57:26 +0000 (20:57 +0200)
* m4/stack-trace.m4 (gl_STACK_TRACE_EARLY): Use option
'-Wl,-export-dynamic' instead of '-rdynamic'.

ChangeLog
m4/stack-trace.m4

index 74d54e24b4754ef5d4207c76fa1935cce8867089..503732632ea540506385ad7d9c015ccae7543bab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-09-18  Bruno Haible  <bruno@clisp.org>
+
+       stack-trace: Add support for Oracle DeveloperStudio cc.
+       * m4/stack-trace.m4 (gl_STACK_TRACE_EARLY): Use option
+       '-Wl,-export-dynamic' instead of '-rdynamic'.
+
 2025-09-18  Pádraig Brady  <P@draigBrady.com>
 
        localcharset: fix macOS build
index abf6fc21b442d26dfd73f35c83f68dfc39b71dc5..b8c8297abdc878aa6ea32af7dd2890807da5abbf 100644 (file)
@@ -1,5 +1,5 @@
 # stack-trace.m4
-# serial 4
+# serial 5
 dnl Copyright (C) 2024-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,10 +71,13 @@ AC_DEFUN([gl_STACK_TRACE_EARLY],
           if test $CAN_PRINT_STACK_TRACE = 1; then
             dnl Link all programs in such a way that the stack trace includes
             dnl the function names.
-            dnl '-rdynamic' is equivalent to '-Wl,-export-dynamic'.
+            dnl gcc supports '-rdynamic' as an option equivalent to
+            dnl '-Wl,-export-dynamic'. But cc from Oracle DeveloperStudio 12.6
+            dnl converts '-rdynamic' into a linker option '-dynamic', which the
+            dnl linker does not understand. So better avoid '-rdynamic'.
             case "$host_os" in
               *-gnu* | gnu* | openbsd*)
-                LDFLAGS="$LDFLAGS -rdynamic"
+                LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
                 ;;
             esac
           fi