]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
config: Fix host -rdynamic detection for build != host != target
authorJoseph Myers <joseph@codesourcery.com>
Fri, 11 Aug 2023 13:20:07 +0000 (13:20 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 11 Aug 2023 13:20:07 +0000 (13:20 +0000)
The GCC_ENABLE_PLUGINS configure logic for detecting whether -rdynamic
is necessary and supported uses an appropriate objdump for $host
binaries (running on $build) in cases where $host is $build or
$target.

However, it is missing such logic in the case where $host is neither
$build nor $target, resulting in the compilers not being linked with
-rdynamic and plugins not being usable with such a compiler.  In fact
$ac_cv_prog_OBJDUMP, as used when $build = $host, is always an objdump
for $host binaries that runs on $build; that is, it's appropriate to
use in this case as well.

Tested in such a configuration that it does result in cc1 being linked
with -rdynamic as expected.  Also bootstrapped with no regressions for
x86_64-pc-linux-gnu.

config/
* gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Use
export_sym_check="$ac_cv_prog_OBJDUMP -T" also when host is not
build or target.

gcc/
* configure: Regenerate.

libcc1/
* configure: Regenerate.

config/gcc-plugin.m4
gcc/configure
libcc1/configure

index c731a6fab3831e3c089c51bf1ada558b8befd5ca..c30cfdd8fadba3fb54f89d6afe8edb3441206dba 100644 (file)
@@ -49,7 +49,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
        elif test x$host = x$target; then
         export_sym_check="$gcc_cv_objdump -T"
        else
-        export_sym_check=
+        export_sym_check="$ac_cv_prog_OBJDUMP -T"
        fi
      ;;
    esac
index ea1ad6606a685153cf5b6138834fc653b976ec78..db5812d4a63cd997c0a39f78d0971a29d9609267 100755 (executable)
@@ -31975,7 +31975,7 @@ fi
        elif test x$host = x$target; then
         export_sym_check="$gcc_cv_objdump -T"
        else
-        export_sym_check=
+        export_sym_check="$ac_cv_prog_OBJDUMP -T"
        fi
      ;;
    esac
index 1a63a0e4e1a833e16dc4787aca43f07caf968e15..2a914a0bfc8b6652b5e0a5c65ce816d36e64a085 100755 (executable)
@@ -15120,7 +15120,7 @@ fi
        elif test x$host = x$target; then
         export_sym_check="$gcc_cv_objdump -T"
        else
-        export_sym_check=
+        export_sym_check="$ac_cv_prog_OBJDUMP -T"
        fi
      ;;
    esac