Skip to content
Snippets Groups Projects
  1. May 11, 2023
    • Joseph Myers's avatar
      Implement LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [PR109128] · c49d51fa
      Joseph Myers authored
      This is one part of the fix for PR109128, along with a corresponding
      binutils's linker change.  Without this patch, what happens in the
      linker, when an unused object in a .a file has offload data, is that
      elf_link_is_defined_archive_symbol calls bfd_link_plugin_object_p,
      which ends up calling the plugin's claim_file_handler, which then
      records the object as one with offload data. That is, the linker never
      decides to use the object in the first place, but use of this _p
      interface (called as part of trying to decide whether to use the
      object) results in the plugin deciding to use its offload data (and a
      consequent mismatch in the offload data present at runtime).
      
      The new hook allows the linker plugin to distinguish calls to
      claim_file_handler that know the object is being used by the linker
      (from ldmain.c:add_archive_element), from calls that don't know it's
      being used by the linker (from elf_link_is_defined_archive_symbol); in
      the latter case, the plugin should avoid recording the object as one
      with offload data.
      
      	PR middle-end/109128
      
      	include/
      	* plugin-api.h (ld_plugin_claim_file_handler_v2)
      	(ld_plugin_register_claim_file_v2)
      	(LDPT_REGISTER_CLAIM_FILE_HOOK_V2): New.
      	(struct ld_plugin_tv): Add tv_register_claim_file_v2.
      
      	lto-plugin/
      	* lto-plugin.c (register_claim_file_v2): New.
      	(claim_file_handler_v2): New.
      	(claim_file_handler): Wrap claim_file_handler_v2.
      	(onload): Handle LDPT_REGISTER_CLAIM_FILE_HOOK_V2.
      c49d51fa
  2. Jan 16, 2023
  3. Jul 12, 2022
    • Martin Liska's avatar
      lto-plugin: implement LDPT_GET_API_VERSION · 32a75350
      Martin Liska authored
      include/ChangeLog:
      
      	* plugin-api.h (enum linker_api_version): New enum.
      	(ld_plugin_get_api_version): New.
      	(enum ld_plugin_tag): Add LDPT_GET_API_VERSION.
      	(struct ld_plugin_tv): Add tv_get_api_version.
      
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (negotiate_api_version): New.
      	(onload): Negotiate API version.
      	* Makefile.am: Add -DBASE_VERSION.
      	* Makefile.in: Regenerate.
      32a75350
  4. Jul 07, 2022
    • Martin Liska's avatar
      lto-plugin: use locking only for selected targets · d89fa97f
      Martin Liska authored
      For now, support locking only for linux targets that are different from
      riscv* where the target depends on libatomic (and fails during
      bootstrap).
      
      	PR lto/106170
      
      lto-plugin/ChangeLog:
      
      	* configure.ac: Configure HAVE_PTHREAD_LOCKING.
      	* lto-plugin.c (LOCK_SECTION): New.
      	(UNLOCK_SECTION): New.
      	(claim_file_handler): Use the newly added macros.
      	(onload): Likewise.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      d89fa97f
  5. Jun 27, 2022
    • Martin Liska's avatar
      lto-plugin: make claim_file_handler thread-safe · 2669cae0
      Martin Liska authored
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (plugin_lock): New lock.
      	(claim_file_handler): Use mutex for critical section.
      	(onload): Initialize mutex.
      	* configure.ac: Check for pthread.h.
      	* configure: Regenerate.
      	* config.h.in: Regenerate.
      2669cae0
  6. Jun 20, 2022
    • Martin Liska's avatar
      lto-plugin: support LDPT_GET_SYMBOLS_V3 · c56f7983
      Martin Liska authored
      That supports skipping of an object file (LDPS_NO_SYMS).
      
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (struct plugin_file_info): Add skip_file flag.
      	(write_resolution): Write resolution only if get_symbols != LDPS_NO_SYMS.
      	(all_symbols_read_handler): Ignore file if skip_file is true.
      	(onload): Handle LDPT_GET_SYMBOLS_V3.
      c56f7983
  7. May 04, 2022
    • Martin Liska's avatar
      LTO plugin: modernize a bit. · c4ae1758
      Martin Liska authored
      include/ChangeLog:
      
      	* plugin-api.h (enum ld_plugin_tag): Do not set implicit enum
      	values.
      
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (struct plugin_objfile): Use bool for offset
      	field.
      	(exec_lto_wrapper): Assign true/false to bool variables.
      	(process_offload_section): Likewise.
      	(claim_file_handler): Likewise.
      	(onload): Likewise.
      c4ae1758
  8. Mar 11, 2022
  9. Mar 01, 2022
  10. Jan 03, 2022
  11. Dec 02, 2021
    • Rasmus Villemoes's avatar
      fix spelling of -linker-output-auto-nolto-rel · 1ea226fa
      Rasmus Villemoes authored
      The transposition nolto -> notlo is confusing and it makes the long
      name even harder to read than it already is - I kept reading it as
      "not lo" until I realized it was a simple typo.
      
      Fixes: 5269b246 (Silence warning in LTO mode on VxWorks)
      
      lto-plugin/
      	* lto-plugin.c: Fix -linker-output-auto-notlo-rel ->
      	-linker-output-auto-nolto-rel typo.
      	(process_option): Adjust accordingly, accepting both old and
      	new spelling.
      
      gcc/
      	* config/vxworks.h (LTO_PLUGIN_SPEC): Adapt to corrected
      	spelling of -linker-output-auto-nolto-rel.
      1ea226fa
  12. Jun 25, 2021
    • Richard Biener's avatar
      add -ltrans-objects lto-plugin debug option · c6c7ac04
      Richard Biener authored
      This adds a -ltrans-objects option to lto-plugin that by-passes
      lto-wrapper invocation and instead feeds LD the final LTRANS objects
      directly from the response file given as argument to the option.
      This allows LD issues involving the linker-plugin path to be
      debugged in an easier way with just the IR objects (their symtab)
      and the LTRANS objects as testcase.
      
      I've tested the path re-building stage2 build/genmatch from an
      LTO bootstrap and got a bit-identical executable by adding
      -plugin-opt=-ltrans-objects=y to the original collect2 invocation,
      seeding y with the final objects as printed by building genmatch
      with -save-temps -v.
      
      2021-06-22  Richard Biener  <rguenther@suse.de>
      
      lto-plugin/
      	* lto-plugin.c (ltrans_objects): New global.
      	(all_symbols_read_handler): If -ltrans-objects was specified,
      	add the output files from the specified file directly.
      	(process_option): Handle -ltrans-objects.
      c6c7ac04
  13. May 10, 2021
    • Martin Liska's avatar
      LTO plugin: use startswith function. · a2d7e58f
      Martin Liska authored
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (LTO_SEGMENT_NAME): Remove.
      	(LTO_SYMTAB_PREFIX): Likewise.
      	(LTO_SYMTAB_PREFIX_LEN): Likewise.
      	(LTO_SYMTAB_EXT_PREFIX): Likewise.
      	(LTO_SYMTAB_EXT_PREFIX_LEN): Likewise.
      	(LTO_LTO_PREFIX): Likewise.
      	(LTO_LTO_PREFIX_LEN): Likewise.
      	(OFFLOAD_SECTION): Likewise.
      	(OFFLOAD_SECTION_LEN): Likewise.
      	(startswith): New function.
      	(all_symbols_read_handler): Use it.
      	(process_symtab): Likewise.
      	(process_symtab_extension): Likewise.
      	(process_offload_section): Likewise.
      	(process_option): Likewise.
      a2d7e58f
  14. Apr 21, 2021
    • Martin Liska's avatar
      Fix clang warning (-Wstring-plus-int) · e9fc9d07
      Martin Liska authored
      This fixes:
      
      lto-plugin.c:642:7: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
      
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (exec_lto_wrapper): Make a temp variable.
      e9fc9d07
  15. Jan 04, 2021
  16. Sep 09, 2020
    • Nick Clifton's avatar
      If the lto plugin encounters a file with multiple symbol sections, each of... · ad2a3715
      Nick Clifton authored
      If the lto plugin encounters a file with multiple symbol sections, each of which also has a v1 symbol extension section[1] then it will attempt to read the extension data for *every* symbol from each of the extension sections.  This results in reading off the end of a buffer with the associated memory corruption that that entails.  This patch fixes that problem.
      
      2020-09-09  Nick Clifton  <nickc@redhat.com>
      
      	* lto-plugin.c (struct plugin_symtab): Add last_sym field.
      	(parse_symtab_extension): Only read as many entries as are
      	available in the buffer.  Store the data read into the symbol
      	table indexed from last_sym.  Increment last_sym.
      ad2a3715
  17. May 26, 2020
    • Alexandre Oliva's avatar
      revamp dump and aux output names · 1dedc12d
      Alexandre Oliva authored
      This patch simplifies (!!!) the logic governing the naming of dump
      files and auxiliary output files in the driver, in the compiler, and
      in the LTO wrapper.  No changes are made to the naming of primary
      outputs, there are often ways to restore past behavior, and a number
      of inconsistencies are fixed.  Some internal options are removed
      (-auxbase and -auxbase-strip), sensible existing uses of -dumpdir and
      -dumpbase options remain unchanged, additional useful cases are added,
      making for what is still admittedly quite complex.  Extensive
      documentation and testcases provide numerous examples, from normal to
      corner cases.
      
      The most visible changes are:
      
      - aux and dump files now always go in the same directory, that
      defaults to the directory of the primary output, but that can be
      overridden with -dumpdir, -save-temps=*, or, preserving past behavior,
      with a -dumpbase with a directory component.
      
      - driver and compiler now have the same notion of naming of auxiliary
      outputs, e.g. .dwo files will no longer be in one location while the
      debug info suggests they are elsewhere, and -save-temps and .dwo
      auxiliary outputs now go in the same location as .su, .ci and
      coverage data, with consistent naming.
      
      - explicitly-specified primary output names guide not only the
      location of aux and dump outputs: the output base name is also used in
      their base name, as a prefix when also linking (e.g. foo.c bar.c -o
      foobar creates foobar-foo.dwo and foobar-bar.dwo with -gsplit-dwarf),
      or as the base name instead of the input name (foo.c -c -o whatever.o
      creates whatever.su rather than foo.su with -fstack-usage).  The
      preference for the input file base name, quite useful for our
      testsuite, can be restored with -dumpbase "".  When compiling and
      linking tests in the testsuite with additional inputs, we now use this
      flag.  Files named in dejagnu board ldflags, libs, and ldscripts are
      now quoted in the gcc testsuite with -Wl, so that they are not counted
      as additional inputs by the compiler driver.
      
      - naming a -dumpbase when compiling multiple sources used to cause
      dumps from later compiles to overwrite those of earlier ones; it is
      now used as a prefix when compiling multiple sources, like an
      executable name above.
      
      - the dumpbase, explicitly specified or computed from output or input
      names, now also governs the naming of aux outputs; since aux outputs
      usually replaced the suffix from the input name, while dump outputs
      append their own additional suffixes, a -dumpbase-ext option is
      introduced to enable a chosen suffix to be dropped from dumpbase to
      form aux output names.
      
      - LTO dump and aux outputs were quite a mess, sometimes leaking
      temporary output names into -save-temps output names, sometimes
      conversely generating desirable aux outputs in temporary locations.
      They now obey the same logic of compiler aux and dump outputs, landing
      in the expected location and taking the linker output name or an
      explicit dumpbase overrider into account.
      
      - Naming of -fdump-final-insns outputs now follows the dump file
      naming logic for the .gkd files, and the .gk dump files generated in
      the second -fcompare-debug compilation get the .gk inserted before the
      suffix that -dumpbase-ext drops in aux outputs.
      
      
      gcc/ChangeLog:
      
      	* common.opt (aux_base_name): Define.
      	(dumpbase, dumpdir): Mark as Driver options.
      	(-dumpbase, -dumpdir): Likewise.
      	(dumpbase-ext, -dumpbase-ext): New.
      	(auxbase, auxbase-strip): Drop.
      	* doc/invoke.texi (-dumpbase, -dumpbase-ext, -dumpdir):
      	Document.
      	(-o): Introduce the notion of primary output, mention it
      	influences auxiliary and dump output names as well, add
      	examples.
      	(-save-temps): Adjust, move examples into -dump*.
      	(-save-temps=cwd, -save-temps=obj): Likewise.
      	(-fdump-final-insns): Adjust.
      	* dwarf2out.c (gen_producer_string): Drop auxbase and
      	auxbase_strip; add dumpbase_ext.
      	* gcc.c (enum save_temps): Add SAVE_TEMPS_DUMP.
      	(save_temps_prefix, save_temps_length): Drop.
      	(save_temps_overrides_dumpdir): New.
      	(dumpdir, dumpbase, dumpbase_ext): New.
      	(dumpdir_length, dumpdir_trailing_dash_added): New.
      	(outbase, outbase_length): New.
      	(The Specs Language): Introduce %".  Adjust %b and %B.
      	(ASM_FINAL_SPEC): Use %b.dwo for an aux output name always.
      	Precede object file with %w when it's the primary output.
      	(cpp_debug_options): Do not pass on incoming -dumpdir,
      	-dumpbase and -dumpbase-ext options; recompute them with
      	%:dumps.
      	(cc1_options): Drop auxbase with and without compare-debug;
      	use cpp_debug_options instead of dumpbase.  Mark asm output
      	with %w when it's the primary output.
      	(static_spec_functions): Drop %:compare-debug-auxbase-opt and
      	%:replace-exception.  Add %:dumps.
      	(driver_handle_option): Implement -save-temps=*/-dumpdir
      	mutual overriding logic.  Save dumpdir, dumpbase and
      	dumpbase-ext options.  Do not save output_file in
      	save_temps_prefix.
      	(adds_single_suffix_p): New.
      	(single_input_file_index): New.
      	(process_command): Combine output dir, output base name, and
      	dumpbase into dumpdir and outbase.
      	(set_collect_gcc_options): Pass a possibly-adjusted -dumpdir.
      	(do_spec_1): Optionally dumpdir instead of save_temps_prefix,
      	and outbase instead of input_basename in %b, %B and in
      	-save-temps aux files.  Handle empty argument %".
      	(driver::maybe_run_linker): Adjust dumpdir and auxbase.
      	(compare_debug_dump_opt_spec_function): Adjust gkd dump file
      	naming.  Spec-quote the computed -fdump-final-insns file name.
      	(debug_auxbase_opt): Drop.
      	(compare_debug_self_opt_spec_function): Drop auxbase-strip
      	computation.
      	(compare_debug_auxbase_opt_spec_function): Drop.
      	(not_actual_file_p): New.
      	(replace_extension_spec_func): Drop.
      	(dumps_spec_func): New.
      	(convert_white_space): Split-out parts into...
      	(quote_string, whitespace_to_convert_p): ... these.  New.
      	(quote_spec_char_p, quote_spec, quote_spec_arg): New.
      	(driver::finalize): Release and reset new variables; drop
      	removed ones.
      	* lto-wrapper.c (HAVE_TARGET_EXECUTABLE_SUFFIX): Define if...
      	(TARGET_EXECUTABLE_SUFFIX): ... is defined; define this to the
      	empty string otherwise.
      	(DUMPBASE_SUFFIX): Drop leading period.
      	(debug_objcopy): Use concat.
      	(run_gcc): Recognize -save-temps=* as -save-temps too.  Obey
      	-dumpdir.  Pass on empty dumpdir and dumpbase with a directory
      	component.  Simplify temp file names.
      	* opts.c (finish_options): Drop aux base name handling.
      	(common_handle_option): Drop auxbase-strip handling.
      	* toplev.c (print_switch_values): Drop auxbase, add
      	dumpbase-ext.
      	(process_options): Derive aux_base_name from dump_base_name
      	and dump_base_ext.
      	(lang_dependent_init): Compute dump_base_ext along with
      	dump_base_name.  Disable stack usage and callgraph-info	during
      	lto generation and compare-debug recompilation.
      
      gcc/fortran/ChangeLog:
      
      	* options.c (gfc_get_option_string): Drop auxbase, add
      	dumpbase_ext.
      
      gcc/ada/ChangeLog:
      
      	* gcc-interface/lang-specs.h: Drop auxbase and auxbase-strip.
      	Use %:dumps instead of -dumpbase.  Add %w for implicit .s
      	primary output.
      	* switch.adb (Is_Internal_GCC_Switch): Recognize dumpdir and
      	dumpbase-ext.  Drop auxbase and auxbase-strip.
      
      lto-plugin/ChangeLog:
      
      	* lto-plugin.c (skip_in_suffix): New.
      	(exec_lto_wrapper): Use skip_in_suffix and concat to build
      	non-temporary output names.
      	(onload): Look for -dumpdir in COLLECT_GCC_OPTIONS, and
      	override link_output_name with it.
      
      contrib/ChangeLog:
      
      	* compare-debug: Adjust for .gkd files named as dump files,
      	with the source suffix rather than the object suffix.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.misc-tests/outputs.exp: New.
      	* gcc.misc-tests/outputs-0.c: New.
      	* gcc.misc-tests/outputs-1.c: New.
      	* gcc.misc-tests/outputs-2.c: New.
      	* lib/gcc-defs.exp (gcc_adjusted_linker_flags): New.
      	(gcc_adjust_linker_flags): New.
      	(dg-additional-files-options): Call it.  Pass -dumpbase ""
      	when there are additional sources.
      	* lib/profopt.exp (profopt-execute): Pass the executable
      	suffix with -dumpbase-ext.
      	* lib/scandump.exp (dump-base): Mention -dumpbase "" use.
      	* lib/scanltranstree.exp: Adjust dump suffix expectation.
      	* lib/scanwpaipa.exp: Likewise.
      1dedc12d
  18. May 05, 2020
    • Eric Botcazou's avatar
      Silence warning in LTO mode on VxWorks · 5269b246
      Eric Botcazou authored
      The link phase is always partial (-r) for VxWorks in kernel mode, which
      means that it uses incremental LTO linking by default (-flinker-output=rel).
      But in this mode the LTO plugin outputs a warning if one of the object files
      involved in the link does not contain LTO bytecode, before switching to
      nolto-rel mode.  We do not do repeated incremental linking for VxWorks so
      silence the warning.
      
      lto-plugin/
      	* lto-plugin.c: Document -linker-output-auto-notlo-rel option.
      	(linker_output_set): Change type to bool.
      	(linker_output_known): Likewise.
      	(linker_output_auto_nolto_rel): New variable.
      	(all_symbols_read_handler): Take it into account.
      	<LDPO_REL>: Do not issue the warning if it is set.
      	(process_option): Process -linker-output-auto-notlo-rel.
      	(cleanup_handler): Remove unused variable.
      	(onload) <LDPT_LINKER_OUTPUT>: Adjust to above type change.
      gcc/
      	* gcc.c (LTO_PLUGIN_SPEC): Define if not already.
      	(LINK_PLUGIN_SPEC): Execute LTO_PLUGIN_SPEC.
      	* config/vxworks.h (LTO_PLUGIN_SPEC): Define.
      5269b246
  19. Mar 19, 2020
    • Martin Liska's avatar
      API extension for binutils (type of symbols). · c8429c2a
      Martin Liska authored
      	* lto-section-in.c: Add ext_symtab.
      	* lto-streamer-out.c (write_symbol_extension_info): New.
      	(produce_symtab_extension): New.
      	(produce_asm_for_decls): Stream also produce_symtab_extension.
      	* lto-streamer.h (enum lto_section_type): New section.
      	* lto-symtab.h (enum gcc_plugin_symbol_type): New.
      	(enum gcc_plugin_symbol_section_kind): Likewise.
      	* lto-plugin.c (LTO_SECTION_PREFIX): Rename to ...
      	(LTO_SYMTAB_PREFIX): ... this.
      	(LTO_SECTION_PREFIX_LEN): Rename to ...
      	(LTO_SYMTAB_PREFIX_LEN): ... this.
      	(LTO_SYMTAB_EXT_PREFIX): New.
      	(LTO_SYMTAB_EXT_PREFIX_LEN): New.
      	(LTO_LTO_PREFIX): New.
      	(LTO_LTO_PREFIX_LEN): New.
      	(parse_table_entry): Fill up unused to zero.
      	(parse_table_entry_extension): New.
      	(parse_symtab_extension): New.
      	(finish_conflict_resolution): Change type
      	for resolution.
      	(process_symtab): Use new macro name.
      	(process_symtab_extension): New.
      	(claim_file_handler): Parse also process_symtab_extension.
      	(onload): Call new add_symbols_v2.
      c8429c2a
  20. Jan 01, 2020
  21. May 15, 2019
    • Iain Sandoe's avatar
      lto-plugin, removed unused variable · 2e97dfdd
      Iain Sandoe authored
      2019-05-15  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* lto-plugin.c (cleanup_handler): Remove unused var.
      
      From-SVN: r271212
      2e97dfdd
    • Iain Sandoe's avatar
      lto-plugin - support -save-temps, -v, --version. · c101cff8
      Iain Sandoe authored
      This patch makes the lto-plugin follow the same approach
      to save-temps as collect2. 
      
      -save-temps causes the temp file to be named meaningfully,
      and for the relevant input files to be saved in CWD.
      
      -v, —version causes the save actions to be output to stderr.
      
      one can get this to happen by just putting -save-temps, -v on
      the regular link line or (for compatibility with the way the
       -debug flag works) by appending -plugin-opt=-save-temps, etc.
      
      lto-plugin/
      
      2019-05-15  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* lto-plugin.c (exec_lto_wrapper): Make the wrapper
      	arguments filename more user-friendly.
      	(file_exists, maybe_unlink): New.
      	(cleanup_handler): Use maybe unlink to handle the
      	case when temps should be saved.
      	(process_option): Look for -v, —-version, -save-temps.
      	(onload): Record the linker output file name.
      	Check for -v, —-version, -save-temps in the GCC collect
      	options environment.
      
      From-SVN: r271202
      c101cff8
  22. Jan 01, 2019
  23. May 30, 2018
    • Jan Hubicka's avatar
      lto-plugin.c: (non_claimed_files): New static var. · de54061d
      Jan Hubicka authored
      	* lto-plugin.c: (non_claimed_files): New static var.
      	(linker_ouput_known): New static var.
      	(all_symbols_read_handler): When user specifies linker output do not
      	imply it; output warning when nonlto-rel mode is forced.
      	(claim_file_header): Record number of nonclaimed files.
      	(process_option): Remember if linker output is known
      
      From-SVN: r260960
      de54061d
  24. Jan 03, 2018
  25. Jul 21, 2017
  26. Jan 04, 2017
  27. Feb 25, 2016
    • Ilya Verbin's avatar
      re PR driver/68463 (Offloading fails when some objects are compiled with LTO and some without) · e6861a99
      Ilya Verbin authored
      gcc/
      	PR driver/68463
      	* config/gnu-user.h (CRTOFFLOADBEGIN): Define.  Add crtoffloadbegin.o if
      	offloading is enabled and -fopenacc or -fopenmp is specified.
      	(CRTOFFLOADEND): Likewise.
      	(GNU_USER_TARGET_STARTFILE_SPEC): Add CRTOFFLOADBEGIN.
      	(GNU_USER_TARGET_ENDFILE_SPEC): Add CRTOFFLOADEND.
      	* lto-wrapper.c (offloadbegin, offloadend): Remove static vars.
      	(offload_objects_file_name): New static var.
      	(tool_cleanup): Remove offload_objects_file_name file.
      	(find_offloadbeginend): Replace with ...
      	(find_crtoffloadtable): ... this.
      	(run_gcc): Remove offload_argc and offload_argv.
      	Get offload_objects_file_name from -foffload-objects=... option.
      	Read names of object files with offload from this file, pass them to
      	compile_images_for_offload_targets.  Don't call find_offloadbeginend and
      	don't pass offloadbegin and offloadend to the linker.  Don't pass
      	offload non-LTO files to the linker, because now they're not claimed.
      libgcc/
      	PR driver/68463
      	* Makefile.in (crtoffloadtable$(objext)): New rule.
      	* configure.ac (extra_parts): Add crtoffloadtable$(objext) if
      	enable_offload_targets is not empty.
      	* configure: Regenerate.
      	* offloadstuff.c: Move __OFFLOAD_TABLE__ from crtoffloadend to
      	crtoffloadtable.
      libgomp/
      	PR driver/68463
      	* testsuite/libgomp.oacc-c-c++-common/parallel-dims-2.c: Remove.
      lto-plugin/
      	PR driver/68463
      	* lto-plugin.c (struct plugin_offload_file): New.
      	(offload_files): Change type.
      	(offload_files_last, offload_files_last_obj): New.
      	(offload_files_last_lto): New.
      	(free_2): Adjust accordingly.
      	(all_symbols_read_handler): Don't add offload files to lto_arg_ptr.
      	Don't call free_1 for offload_files.  Write names of object files with
      	offloading to the temporary file.  Add new option to lto_arg_ptr.
      	(claim_file_handler): Don't claim file if it contains offload sections
      	without LTO sections.  If it contains offload sections, add to the list.
      
      From-SVN: r233712
      e6861a99
  28. Jan 15, 2016
  29. Nov 25, 2015
    • Jan Hubicka's avatar
      re PR lto/67548 (LTO drops weak binding with "ld -r") · 1ff9ed6f
      Jan Hubicka authored
      	PR lto/67548
      	* lto-plugin.c (linker_output, linker_output_set): New statics.
      	(all_symbols_read_handler): Add -flinker-output option.
      	(onload): Record linker_output info.
      
      	* ipa-visibility.c (cgraph_externally_visible_p,
      	varpool_node::externally_visible_p): When doing incremental linking,
      	hidden symbols may be still used later.
      	(update_visibility_by_resolution_info): Do not drop weak during
      	incremental link.
      	(function_and_variable_visibility): Fix formating.
      	* flag-types.h (lto_linker_output): Declare.
      	* common.opt 9flag_incremental_link): New flag.
      
      	* lto-lang.c (lto_post_options): Process flag_lto_linker_output.
      	* lang.opt (lto_linker_output): New enum.
      	(flinker_output): New flag.
      
      From-SVN: r230915
      1ff9ed6f
  30. Feb 06, 2015
    • H.J. Lu's avatar
      Revert the PR lto/64837 fix · 514ba9e4
      H.J. Lu authored
      It breaks gold:
      
      % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ -
      ld.gold: internal error in remove_writer, at token.h:132
      collect2: error: ld returned 1 exit status
      
      	* lto-plugin.c (release_input_file): Removed.
      	(claim_file_handler): Don't call release_input_file.
      	(onload): Don't set release_input_file.
      
      From-SVN: r220477
      514ba9e4
  31. Feb 05, 2015
  32. Jan 28, 2015
  33. Dec 09, 2014
    • Ilya Verbin's avatar
      lto-wrapper.c (compile_offload_image): Start processing in_argv from 0 instead of 1. · 443743fd
      Ilya Verbin authored
      gcc/
      	* lto-wrapper.c (compile_offload_image): Start processing in_argv
      	from 0 instead of 1.
      	(run_gcc): Put offload objects into offload_argv, put LTO objects and
      	possible preceding arguments into lto_argv.
      	Pass offload_argv to compile_images_for_offload_targets instead of argv.
      	Use lto_argv for LTO recompilation instead of argv.
      lto-plugin/
      	* lto-plugin.c (offload_files, num_offload_files): New static variables.
      	(free_1): Use arguments instead of global variables.
      	(free_2): Free offload_files.
      	(all_symbols_read_handler): Add names from offload_files to lto-wrapper
      	arguments.
      	(claim_file_handler): Do not add file to claimed_files if it contains
      	offload sections without LTO sections.  Add it to offload_files instead.
      
      From-SVN: r218543
      443743fd
  34. Nov 13, 2014
    • Ilya Verbin's avatar
      [PATCH 4/7] OpenMP 4.0 offloading infrastructure: lto-wrapper. · fc8b3540
      Ilya Verbin authored
      
      gcc/
      	* gcc.c (spec_host_machine, accel_dir_suffix): New variables.
      	(process_command): Tweak path construction for the possibility
      	of being configured as an offload compiler.
      	(driver::maybe_putenv_OFFLOAD_TARGETS): New function.
      	(driver::main): Call maybe_putenv_OFFLOAD_TARGETS.
      	(driver::set_up_specs): Tweak path construction for the possibility of
      	being configured as an offload compiler.
      	* lto-wrapper.c (OFFLOAD_TARGET_NAMES_ENV): Define.
      	(offload_names, offloadbegin, offloadend): New static variables.
      	(free_array_of_ptrs, parse_env_var, access_check, compile_offload_image)
      	(compile_images_for_offload_targets, copy_file, find_offloadbeginend):
      	New static functions.
      	(run_gcc): Determine whether offload sections are present.  If so, run
      	compile_images_for_offload_targets and return the names of new generated
      	objects to linker.  If there are offload sections, but no LTO sections,
      	then return the copies of input objects without link-time recompilation.
      
      lto-plugin/
      	* lto-plugin.c (OFFLOAD_SECTION, OFFLOAD_SECTION_LEN): Define.
      	(struct plugin_objfile): Add new field "offload".
      	(process_offload_section): New static function.
      	(claim_file_handler): Claim file if it contains offload sections.
      
      Co-Authored-By: default avatarAndrey Turetskiy <andrey.turetskiy@intel.com>
      Co-Authored-By: default avatarBernd Schmidt <bernds@codesourcery.com>
      Co-Authored-By: default avatarMichael Zolotukhin <michael.v.zolotukhin@intel.com>
      
      From-SVN: r217491
      fc8b3540
  35. Apr 02, 2014
  36. Mar 28, 2014
  37. May 29, 2012
Loading