Skip to content

Commit

Permalink
Revert "Sync with binutils: GCC: Pass --plugin to AR and RANLIB"
Browse files Browse the repository at this point in the history
This reverts commit bf8cdd3.
  • Loading branch information
hjl-tools committed Dec 16, 2021
1 parent e1f8c14 commit ab18659
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 191 deletions.
5 changes: 2 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ MAKEINFOFLAGS = --split-size=5000000
# ---------------------------------------------

AS = @AS@
AR = @AR@ @AR_PLUGIN_OPTION@
AR = @AR@
AR_FLAGS = rc
CC = @CC@
CXX = @CXX@
Expand All @@ -429,7 +429,7 @@ LIPO = @LIPO@
NM = @NM@
OBJDUMP = @OBJDUMP@
OTOOL = @OTOOL@
RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
RANLIB = @RANLIB@
READELF = @READELF@
STRIP = @STRIP@
WINDRES = @WINDRES@
Expand Down Expand Up @@ -66712,7 +66712,6 @@ AUTOCONF = autoconf
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
$(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
$(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
$(srcdir)/config/gcc-plugin.m4 \
$(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
$(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
cd $(srcdir) && $(AUTOCONF)
Expand Down
5 changes: 2 additions & 3 deletions Makefile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ MAKEINFOFLAGS = --split-size=5000000
# ---------------------------------------------

AS = @AS@
AR = @AR@ @AR_PLUGIN_OPTION@
AR = @AR@
AR_FLAGS = rc
CC = @CC@
CXX = @CXX@
Expand All @@ -432,7 +432,7 @@ LIPO = @LIPO@
NM = @NM@
OBJDUMP = @OBJDUMP@
OTOOL = @OTOOL@
RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
RANLIB = @RANLIB@
READELF = @READELF@
STRIP = @STRIP@
WINDRES = @WINDRES@
Expand Down Expand Up @@ -2094,7 +2094,6 @@ AUTOCONF = autoconf
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
$(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
$(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
$(srcdir)/config/gcc-plugin.m4 \
$(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
$(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
cd $(srcdir) && $(AUTOCONF)
Expand Down
28 changes: 0 additions & 28 deletions config/gcc-plugin.m4
Original file line number Diff line number Diff line change
Expand Up @@ -129,31 +129,3 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
fi
fi
])

dnl
dnl
dnl GCC_PLUGIN_OPTION
dnl (SHELL-CODE_HANDLER)
dnl
AC_DEFUN([GCC_PLUGIN_OPTION],[dnl
AC_MSG_CHECKING([for -plugin option])
plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
plugin_option=
for plugin in $plugin_names; do
plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
if test x$plugin_so = x$plugin; then
plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
fi
if test x$plugin_so != x$plugin; then
plugin_option="--plugin $plugin_so"
break
fi
done
if test -n "$plugin_option"; then
$1="$plugin_option"
AC_MSG_RESULT($plugin_option)
else
AC_MSG_RESULT([no])
fi
])
39 changes: 0 additions & 39 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ GFORTRAN_FOR_TARGET
GCC_FOR_TARGET
CXX_FOR_TARGET
CC_FOR_TARGET
RANLIB_PLUGIN_OPTION
AR_PLUGIN_OPTION
GDCFLAGS
READELF
OTOOL
Expand Down Expand Up @@ -12843,43 +12841,6 @@ fi



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
$as_echo_n "checking for -plugin option... " >&6; }

plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
plugin_option=
for plugin in $plugin_names; do
plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
if test x$plugin_so = x$plugin; then
plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
fi
if test x$plugin_so != x$plugin; then
plugin_option="--plugin $plugin_so"
break
fi
done
if test -n "$plugin_option"; then
PLUGIN_OPTION="$plugin_option"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
$as_echo "$plugin_option" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

AR_PLUGIN_OPTION=
RANLIB_PLUGIN_OPTION=
if test -n "$PLUGIN_OPTION"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
AR_PLUGIN_OPTION="$PLUGIN_OPTION"
fi
if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
fi
fi



# Target tools.

# Check whether --with-build-time-tools was given.
Expand Down
15 changes: 0 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ m4_include(config/override.m4)
m4_include(config/proginstall.m4)
m4_include(config/elf.m4)
m4_include(config/ax_cxx_compile_stdcxx.m4)
m4_include(config/gcc-plugin.m4)
m4_include([libtool.m4])
m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
Expand Down Expand Up @@ -3601,20 +3600,6 @@ AC_SUBST(CXXFLAGS)
AC_SUBST(GDC)
AC_SUBST(GDCFLAGS)

GCC_PLUGIN_OPTION(PLUGIN_OPTION)
AR_PLUGIN_OPTION=
RANLIB_PLUGIN_OPTION=
if test -n "$PLUGIN_OPTION"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
AR_PLUGIN_OPTION="$PLUGIN_OPTION"
fi
if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
fi
fi
AC_SUBST(AR_PLUGIN_OPTION)
AC_SUBST(RANLIB_PLUGIN_OPTION)

# Target tools.
AC_ARG_WITH([build-time-tools],
[AS_HELP_STRING([--with-build-time-tools=PATH],
Expand Down
5 changes: 2 additions & 3 deletions libiberty/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ mkinstalldirs = $(SHELL) $(libiberty_topdir)/mkinstalldirs
# Some compilers can't handle cc -c blah.c -o foo/blah.o.
OUTPUT_OPTION = @OUTPUT_OPTION@

AR = @AR@ @AR_PLUGIN_OPTION@
AR = @AR@
AR_FLAGS = rc

CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
RANLIB = @RANLIB@
MAKEINFO = @MAKEINFO@
PERL = @PERL@

Expand Down Expand Up @@ -507,7 +507,6 @@ aclocal_deps = \
$(srcdir)/../config/acx.m4 \
$(srcdir)/../config/cet.m4 \
$(srcdir)/../config/enable.m4 \
$(srcdir)/../config/gcc-plugin.m4 \
$(srcdir)/../config/no-executables.m4 \
$(srcdir)/../config/override.m4 \
$(srcdir)/../config/picflag.m4 \
Expand Down
1 change: 0 additions & 1 deletion libiberty/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun
m4_include([../config/acx.m4])
m4_include([../config/cet.m4])
m4_include([../config/enable.m4])
m4_include([../config/gcc-plugin.m4])
m4_include([../config/no-executables.m4])
m4_include([../config/picflag.m4])
m4_include([../config/warnings.m4])
Expand Down
37 changes: 0 additions & 37 deletions libiberty/configure
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,6 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
RANLIB_PLUGIN_OPTION
AR_PLUGIN_OPTION
RANLIB
AR
host_os
Expand Down Expand Up @@ -2937,41 +2935,6 @@ else
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
$as_echo_n "checking for -plugin option... " >&6; }

plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
plugin_option=
for plugin in $plugin_names; do
plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
if test x$plugin_so = x$plugin; then
plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
fi
if test x$plugin_so != x$plugin; then
plugin_option="--plugin $plugin_so"
break
fi
done
if test -n "$plugin_option"; then
PLUGIN_OPTION="$plugin_option"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
$as_echo "$plugin_option" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

if test -n "$PLUGIN_OPTION"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
AR_PLUGIN_OPTION="$PLUGIN_OPTION"

fi
if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"

fi
fi

# Add --enable-multilib to configure.
# Default to --enable-multilib
# Check whether --enable-multilib was given.
Expand Down
12 changes: 0 additions & 12 deletions libiberty/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)

GCC_PLUGIN_OPTION(PLUGIN_OPTION)
if test -n "$PLUGIN_OPTION"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
AR_PLUGIN_OPTION="$PLUGIN_OPTION"
AC_SUBST(AR_PLUGIN_OPTION)
fi
if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
AC_SUBST(RANLIB_PLUGIN_OPTION)
fi
fi

dnl When switching to automake, replace the following with AM_ENABLE_MULTILIB.
# Add --enable-multilib to configure.
# Default to --enable-multilib
Expand Down
25 changes: 1 addition & 24 deletions libtool.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1325,26 +1325,8 @@ need_locks="$enable_libtool_lock"
# _LT_CMD_OLD_ARCHIVE
# -------------------
m4_defun([_LT_CMD_OLD_ARCHIVE],
[plugin_option=
plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
for plugin in $plugin_names; do
plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
if test x$plugin_so = x$plugin; then
plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
fi
if test x$plugin_so != x$plugin; then
plugin_option="--plugin $plugin_so"
break
fi
done

AC_CHECK_TOOL(AR, ar, false)
[AC_CHECK_TOOL(AR, ar, false)
test -z "$AR" && AR=ar
if test -n "$plugin_option"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
AR="$AR $plugin_option"
fi
fi
test -z "$AR_FLAGS" && AR_FLAGS=cru
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1])
Expand All @@ -1355,11 +1337,6 @@ _LT_DECL([], [STRIP], [1], [A symbol stripping program])

AC_CHECK_TOOL(RANLIB, ranlib, :)
test -z "$RANLIB" && RANLIB=:
if test -n "$plugin_option" && test "$RANLIB" != ":"; then
if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
RANLIB="$RANLIB $plugin_option"
fi
fi
_LT_DECL([], [RANLIB], [1],
[Commands used to install an old-style archive])

Expand Down
29 changes: 3 additions & 26 deletions zlib/configure
Original file line number Diff line number Diff line change
Expand Up @@ -4169,7 +4169,7 @@ case "$host" in
case "$enable_cet" in
auto)
# Check if target supports multi-byte NOPs
# and if compiler and assembler support CET insn.
# and if assembler supports CET insn.
cet_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fcf-protection"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Expand Down Expand Up @@ -5502,19 +5502,6 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown



plugin_option=
plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
for plugin in $plugin_names; do
plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
if test x$plugin_so = x$plugin; then
plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
fi
if test x$plugin_so != x$plugin; then
plugin_option="--plugin $plugin_so"
break
fi
done

if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
Expand Down Expand Up @@ -5608,11 +5595,6 @@ else
fi

test -z "$AR" && AR=ar
if test -n "$plugin_option"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
AR="$AR $plugin_option"
fi
fi
test -z "$AR_FLAGS" && AR_FLAGS=cru


Expand Down Expand Up @@ -5817,11 +5799,6 @@ else
fi

test -z "$RANLIB" && RANLIB=:
if test -n "$plugin_option" && test "$RANLIB" != ":"; then
if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
RANLIB="$RANLIB $plugin_option"
fi
fi



Expand Down Expand Up @@ -10758,7 +10735,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10761 "configure"
#line 10748 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -10864,7 +10841,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10867 "configure"
#line 10854 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down

0 comments on commit ab18659

Please sign in to comment.