Skip to content

Commit

Permalink
ChangeLog:
Browse files Browse the repository at this point in the history
2010-10-07  Dave Korn  <dave.korn.cygwin@gmail.com>

	* configure.ac (build_lto_plugin): New shell variable.
	(--enable-lto): Turn on by default for all non-ELF platforms that
	have had LTO support added so far.  Set build_lto_plugin appropriately
	for both ELF and non-ELF.
	(configdirs): Add lto-plugin or not based on build_lto_plugin.
	* configure: Regenerate.

gcc/ChangeLog:

2010-10-07  Dave Korn  <dave.korn.cygwin@gmail.com>

	* config.host (host_lto_plugin_soname): New shell variable.
	* configure.ac (LTOPLUGINSONAME): Add an AC_DEFINE for the above.
	* config.in: Regenerate.
	* configure: Regenerate.
	* gcc.c (main): Use LTOPLUGINSONAME instead of hard-coding name of
	LTO plugin shared library.

lto-plugin/ChangeLog:

2010-10-07  Dave Korn  <dave.korn.cygwin@gmail.com>

	* configure.ac: Source config.gcc to determine lto_binary_reader.
	(LTO_FORMAT): New AC_SUBST variable inferred from lto_binary_reader.
	* Makefile.am (LTO_FORMAT): Import.
	(liblto_plugin_la_SOURCES): Add object format dependent module
	defined by LTO_FORMAT.
	(liblto_plugin_la_LIBADD): Allow for both PIC and non-PIC libiberty,
	and work around libtool warning.
	* configure: Regenerate.
	* Makefile.in: Likewise.
	* lto-plugin.c (struct sym_aux): Move to new lto-plugin.h.
	(struct sym_aux): Likewise.
	(struct plugin_symtab): Likewise.
	(struct plugin_file_info): Likewise.
	(LTO_SECTION_PREFIX): Likewise.
	(add_symbols):  Make non-static.
	(claimed_files): Likewise.
	(num_claimed_files): Likewise.
	(check): Likewise.
	(parse_table_entry): Likewise.
	(translate): Likewise.
	(resolve_conflicts): Likewise.
	(process_symtab): Move to new lto-plugin-elf.c object format dependent
	source file.
	(claim_file_handler): Likewise, and make non-static.
	(onload): Call new onload_format_checks function.
	* lto-plugin.h: New file.
	(LTO_SECTION_PREFIX): Move here.
	(struct sym_aux): Likewise.
	(struct plugin_symtab): Likewise.
	(struct plugin_file_info): Likewise.
	(claim_file_handler): Add new function prototype.
	(onload_format_checks): Likewise.
	(check): Declare extern.
	(translate): Likewise.
	(parse_table_entry): Likewise.
	(resolve_conflicts): Likewise.
	(add_symbols):  Likewise.
	(claimed_files): Likewise.
	(num_claimed_files): Likewise.
	* lto-plugin-elf.c (process_symtab): Move here.
	(claim_file_handler): Likewise, and make non-static.
	(onload_format_checks): New function factored out from onload.
	* lto-plugin-coff.c (claim_file_handler): New function stub.
	(onload_format_checks): Likewise.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165133 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
davek committed Oct 7, 2010
1 parent 983e6b0 commit ca42e77
Show file tree
Hide file tree
Showing 18 changed files with 465 additions and 188 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2010-10-07 Dave Korn <dave.korn.cygwin@gmail.com>

* configure.ac (build_lto_plugin): New shell variable.
(--enable-lto): Turn on by default for all non-ELF platforms that
have had LTO support added so far. Set build_lto_plugin appropriately
for both ELF and non-ELF.
(configdirs): Add lto-plugin or not based on build_lto_plugin.
* configure: Regenerate.

2010-10-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

Sync from src:
Expand Down
13 changes: 10 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6676,11 +6676,13 @@ to specify its location." "$LINENO" 5
# Flags needed for libelf.


# ELF platforms build the lto-plugin when GOLD is in use.
build_lto_plugin=${ENABLE_GOLD}
fi
else
if test x"$default_enable_lto" = x"yes" ; then
case $target in
*-apple-darwin*) ;;
*-apple-darwin* | *-cygwin* | *-mingw*) ;;
# On other non-ELF platforms, LTO must be explicitly enabled.
*) enable_lto=no ;;
esac
Expand All @@ -6691,13 +6693,18 @@ else
# warn during gcc/ subconfigure; unless you're bootstrapping with
# -flto it won't be needed until after installation anyway.
case $target in
*-cygwin*|*-mingw* | *-apple-darwin*) ;;
*-cygwin* | *-mingw* | *-apple-darwin*) ;;
*) if test x"$enable_lto" = x"yes"; then
as_fn_error "LTO support is not enabled for this target." "$LINENO" 5
fi
;;
esac
fi
# Among non-ELF, only Windows platforms support the lto-plugin so far.
case $target in
*-cygwin* | *-mingw*) build_lto_plugin=yes ;;
*) ;;
esac
default_enable_lto=no
fi

Expand Down Expand Up @@ -6778,7 +6785,7 @@ if test -d ${srcdir}/gcc; then
*,lto,*) ;;
*) enable_languages="${enable_languages},lto" ;;
esac
if test "${ENABLE_GOLD}" = "yes" ; then
if test "${build_lto_plugin}" = "yes" ; then
configdirs="$configdirs lto-plugin"
extra_host_libiberty_configure_flags=--enable-shared
fi
Expand Down
13 changes: 10 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1786,9 +1786,11 @@ to specify its location.])
# Flags needed for libelf.
AC_SUBST(libelflibs)
AC_SUBST(libelfinc)
# ELF platforms build the lto-plugin when GOLD is in use.
build_lto_plugin=${ENABLE_GOLD}
fi],[if test x"$default_enable_lto" = x"yes" ; then
case $target in
*-apple-darwin*) ;;
*-apple-darwin* | *-cygwin* | *-mingw*) ;;
# On other non-ELF platforms, LTO must be explicitly enabled.
*) enable_lto=no ;;
esac
Expand All @@ -1799,13 +1801,18 @@ fi],[if test x"$default_enable_lto" = x"yes" ; then
# warn during gcc/ subconfigure; unless you're bootstrapping with
# -flto it won't be needed until after installation anyway.
case $target in
*-cygwin*|*-mingw* | *-apple-darwin*) ;;
*-cygwin* | *-mingw* | *-apple-darwin*) ;;
*) if test x"$enable_lto" = x"yes"; then
AC_MSG_ERROR([LTO support is not enabled for this target.])
fi
;;
esac
fi
# Among non-ELF, only Windows platforms support the lto-plugin so far.
case $target in
*-cygwin* | *-mingw*) build_lto_plugin=yes ;;
*) ;;
esac
default_enable_lto=no])


Expand Down Expand Up @@ -1884,7 +1891,7 @@ if test -d ${srcdir}/gcc; then
*,lto,*) ;;
*) enable_languages="${enable_languages},lto" ;;
esac
if test "${ENABLE_GOLD}" = "yes" ; then
if test "${build_lto_plugin}" = "yes" ; then
configdirs="$configdirs lto-plugin"
extra_host_libiberty_configure_flags=--enable-shared
fi
Expand Down
9 changes: 9 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2010-10-07 Dave Korn <dave.korn.cygwin@gmail.com>

* config.host (host_lto_plugin_soname): New shell variable.
* configure.ac (LTOPLUGINSONAME): Add an AC_DEFINE for the above.
* config.in: Regenerate.
* configure: Regenerate.
* gcc.c (main): Use LTOPLUGINSONAME instead of hard-coding name of
LTO plugin shared library.

2010-10-07 Richard Henderson <rth@redhat.com>

* target.h (enum unwind_info_type): Move ...
Expand Down
9 changes: 9 additions & 0 deletions gcc/config.host
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@
#
# host_can_use_collect2 Set to yes normally; to no if the host cannot
# link or otherwise use collect2
#
# use_long_long_for_widest_fast_int Set this to 'yes' if 'long long'
# (or '__int64') is wider than 'long' but still
# efficeiently supported by the host hardware.
# Only affects compile speed. Default is 'no'.
#
# host_lto_plugin_soname Set this to the name to which the LTO linker
# plugin gets compiled on this host, if it is
# different from the default "liblto_plugin.so".

# When setting any of these variables, check to see if a corresponding
# variable is present in config.build; if so, you will likely want to
Expand All @@ -70,6 +75,7 @@ host_extra_gcc_objs=
out_host_hook_obj=host-default.o
host_can_use_collect2=yes
use_long_long_for_widest_fast_int=no
host_lto_plugin_soname=liblto_plugin.so

# Unsupported hosts list. Generally, only include hosts known to fail here,
# since we allow hosts not listed to be supported generically.
Expand Down Expand Up @@ -206,19 +212,22 @@ case ${host} in
out_host_hook_obj=host-cygwin.o
host_xmake_file="${host_xmake_file} i386/x-cygwin"
host_exeext=.exe
host_lto_plugin_soname=cyglto_plugin-0.dll
;;
i[34567]86-*-mingw32*)
host_xm_file=i386/xm-mingw32.h
host_xmake_file="${host_xmake_file} i386/x-mingw32"
host_exeext=.exe
out_host_hook_obj=host-mingw32.o
host_lto_plugin_soname=liblto_plugin-0.dll
;;
x86_64-*-mingw*)
use_long_long_for_widest_fast_int=yes
host_xm_file=i386/xm-mingw32.h
host_xmake_file="${host_xmake_file} i386/x-mingw32"
host_exeext=.exe
out_host_hook_obj=host-mingw32.o
host_lto_plugin_soname=liblto_plugin-0.dll
;;
i[34567]86-*-uwin*)
echo "*** UWIN may not be used as a host platform because"
Expand Down
16 changes: 13 additions & 3 deletions gcc/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,6 @@
/* Define if your assembler and linker support .hidden. */
#undef HAVE_GAS_HIDDEN

/* Define if your system supports gnu indirect functions. */
#undef HAVE_GNU_INDIRECT_FUNCTION

/* Define if your assembler supports .lcomm with an alignment field. */
#ifndef USED_FOR_TARGET
#undef HAVE_GAS_LCOMM_WITH_ALIGNMENT
Expand Down Expand Up @@ -1062,6 +1059,12 @@
#endif


/* Define if your system supports gnu indirect functions. */
#ifndef USED_FOR_TARGET
#undef HAVE_GNU_INDIRECT_FUNCTION
#endif


/* Define if using GNU ld. */
#ifndef USED_FOR_TARGET
#undef HAVE_GNU_LD
Expand Down Expand Up @@ -1543,6 +1546,13 @@
#endif


/* Define to the name of the LTO plugin DSO that must be passed to the
linker's -plugin=LIB option. */
#ifndef USED_FOR_TARGET
#undef LTOPLUGINSONAME
#endif


/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#ifndef USED_FOR_TARGET
Expand Down
10 changes: 8 additions & 2 deletions gcc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -11045,6 +11045,12 @@ case $use_collect2 in
;;
esac


cat >>confdefs.h <<_ACEOF
#define LTOPLUGINSONAME "${host_lto_plugin_soname}"
_ACEOF


# ---------------------------
# Assembler & linker features
# ---------------------------
Expand Down Expand Up @@ -17127,7 +17133,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 17130 "configure"
#line 17136 "configure"
#include "confdefs.h"

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

#if HAVE_DLFCN_H
Expand Down
4 changes: 4 additions & 0 deletions gcc/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,10 @@ case $use_collect2 in
;;
esac

AC_DEFINE_UNQUOTED(LTOPLUGINSONAME,"${host_lto_plugin_soname}",
[Define to the name of the LTO plugin DSO that must be
passed to the linker's -plugin=LIB option.])

# ---------------------------
# Assembler & linker features
# ---------------------------
Expand Down
4 changes: 2 additions & 2 deletions gcc/gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6827,10 +6827,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
{
linker_plugin_file_spec = find_a_file (&exec_prefixes,
"liblto_plugin.so", R_OK,
LTOPLUGINSONAME, R_OK,
false);
if (!linker_plugin_file_spec)
fatal_error ("-fuse-linker-plugin, but liblto_plugin.so not found");
fatal_error ("-fuse-linker-plugin, but " LTOPLUGINSONAME " not found");

lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
R_OK, true);
Expand Down
47 changes: 47 additions & 0 deletions lto-plugin/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
2010-10-07 Dave Korn <dave.korn.cygwin@gmail.com>

* configure.ac: Source config.gcc to determine lto_binary_reader.
(LTO_FORMAT): New AC_SUBST variable inferred from lto_binary_reader.
* Makefile.am (LTO_FORMAT): Import.
(liblto_plugin_la_SOURCES): Add object format dependent module
defined by LTO_FORMAT.
(liblto_plugin_la_LIBADD): Allow for both PIC and non-PIC libiberty,
and work around libtool warning.
* configure: Regenerate.
* Makefile.in: Likewise.
* lto-plugin.c (struct sym_aux): Move to new lto-plugin.h.
(struct sym_aux): Likewise.
(struct plugin_symtab): Likewise.
(struct plugin_file_info): Likewise.
(LTO_SECTION_PREFIX): Likewise.
(add_symbols): Make non-static.
(claimed_files): Likewise.
(num_claimed_files): Likewise.
(check): Likewise.
(parse_table_entry): Likewise.
(translate): Likewise.
(resolve_conflicts): Likewise.
(process_symtab): Move to new lto-plugin-elf.c object format dependent
source file.
(claim_file_handler): Likewise, and make non-static.
(onload): Call new onload_format_checks function.
* lto-plugin.h: New file.
(LTO_SECTION_PREFIX): Move here.
(struct sym_aux): Likewise.
(struct plugin_symtab): Likewise.
(struct plugin_file_info): Likewise.
(claim_file_handler): Add new function prototype.
(onload_format_checks): Likewise.
(check): Declare extern.
(translate): Likewise.
(parse_table_entry): Likewise.
(resolve_conflicts): Likewise.
(add_symbols): Likewise.
(claimed_files): Likewise.
(num_claimed_files): Likewise.
* lto-plugin-elf.c (process_symtab): Move here.
(claim_file_handler): Likewise, and make non-static.
(onload_format_checks): New function factored out from onload.
* lto-plugin-coff.c (claim_file_handler): New function stub.
(onload_format_checks): Likewise.

2010-08-05 Andi Kleen <ak@linux.intel.com>

* lto-plugin.c: Include <hashtab.h>
Expand Down
10 changes: 8 additions & 2 deletions lto-plugin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
LIBELFLIBS = @LIBELFLIBS@
LIBELFINC = @LIBELFINC@

# Which object format to parse.
LTO_FORMAT = @LTO_FORMAT@

AM_CPPFLAGS = -I$(top_srcdir)/../include $(LIBELFINC)
AM_CFLAGS = -Wall -Werror

libexecsub_LTLIBRARIES = liblto_plugin.la

liblto_plugin_la_SOURCES = lto-plugin.c
liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
liblto_plugin_la_SOURCES = lto-plugin.c lto-plugin-$(LTO_FORMAT).c
liblto_plugin_la_LIBADD = $(LIBELFLIBS) \
$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
liblto_plugin_la_LDFLAGS = -no-undefined -bindir $(libexecsubdir) \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a)

all: copy_lto_plugin

Expand Down
24 changes: 18 additions & 6 deletions lto-plugin/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ am__base_list = \
am__installdirs = "$(DESTDIR)$(libexecsubdir)"
LTLIBRARIES = $(libexecsub_LTLIBRARIES)
am__DEPENDENCIES_1 =
liblto_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
../libiberty/pic/libiberty.a
am_liblto_plugin_la_OBJECTS = lto-plugin.lo
liblto_plugin_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(if $(wildcard \
../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
am_liblto_plugin_la_OBJECTS = lto-plugin.lo \
lto-plugin-$(LTO_FORMAT).lo
liblto_plugin_la_OBJECTS = $(am_liblto_plugin_la_OBJECTS)
liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(liblto_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
am__depfiles_maybe =
Expand Down Expand Up @@ -139,6 +143,9 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@

# Which object format to parse.
LTO_FORMAT = @LTO_FORMAT@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
Expand Down Expand Up @@ -225,8 +232,13 @@ libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
AM_CPPFLAGS = -I$(top_srcdir)/../include $(LIBELFINC)
AM_CFLAGS = -Wall -Werror
libexecsub_LTLIBRARIES = liblto_plugin.la
liblto_plugin_la_SOURCES = lto-plugin.c
liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
liblto_plugin_la_SOURCES = lto-plugin.c lto-plugin-$(LTO_FORMAT).c
liblto_plugin_la_LIBADD = $(LIBELFLIBS) \
$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)

liblto_plugin_la_LDFLAGS = -no-undefined -bindir $(libexecsubdir) \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a)

all: all-am

.SUFFIXES:
Expand Down Expand Up @@ -297,7 +309,7 @@ clean-libexecsubLTLIBRARIES:
rm -f "$${dir}/so_locations"; \
done
liblto_plugin.la: $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_DEPENDENCIES)
$(LINK) -rpath $(libexecsubdir) $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_LIBADD) $(LIBS)
$(liblto_plugin_la_LINK) -rpath $(libexecsubdir) $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_LIBADD) $(LIBS)

mostlyclean-compile:
-rm -f *.$(OBJEXT)
Expand Down
Loading

0 comments on commit ca42e77

Please sign in to comment.