On Jul 18 2024, Maxim Blinov wrote:

> +if test $default_gnu_indirect_function = yes; then
> +  case "${target}" in
> +    riscv*-*-linux*)
> +      AC_MSG_CHECKING(linker ifunc IRELATIVE support)
> +      cat > conftest.s <<EOF
> +      .text
> +      .type    foo_resolver, @function
> +  foo_resolver:
> +      ret
> +      .size    foo_resolver, .-foo_resolver
> +
> +      .globl    foo
> +      .type    foo, %gnu_indirect_function
> +      .set    foo, foo_resolver
> +
> +      .globl    bar
> +      .type    bar, @function
> +  bar:
> +      call    foo
> +      ret
> +      .size    bar, .-bar
> +  EOF
> +      if test x$gcc_cv_as != x \
> +     && test x$gcc_cv_ld != x \
> +     && test x$gcc_cv_readelf != x \
> +     && $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
> +     && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1 \
> +     && $gcc_cv_readelf --relocs --wide conftest \
> +        | grep R_RISCV_IRELATIVE > /dev/null 2>&1; then
> +    enable_gnu_indirect_function=yes
> +      else
> +    enable_gnu_indirect_function=no
> +      fi
> +      rm -f conftest conftest.o conftest.s
> +      AC_MSG_RESULT($enable_gnu_indirect_function)
> +      ;;
> +  esac
> +fi

That should actually set default_gnu_indirect_function instead of
enable_gnu_indirect_function, and moved before the check for the
--enable-gnu-indirect-function option.  Otherwise
--disable-gnu-indirect-function still won't work as expected.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Reply via email to