r277721 - in /branches/gcc-7-branch/gcc: Change...

iains@gcc.gnu.org iains@gcc.gnu.org
Fri Nov 1 20:30:00 GMT 2019


Author: iains
Date: Fri Nov  1 20:30:26 2019
New Revision: 277721

URL: https://gcc.gnu.org/viewcvs?rev=277721&root=gcc&view=rev
Log:
[Darwin] The need for picsym stubs is dependent on linker used, not OS rev.

272356 For very old toolchains, the compiler generated pic symbol stubs that
provide the necessary indirections. We no longer need this (since xcode
3 era) and it's more efficient for the linker to make one stub when it
knows a symbol is needed that for us to emit them speculatively in every
object.

Our current codegen is making the assumption that a specific OS version
uses a specific linker version - and therefore the presence of support
could be based on the target OS rev. Of course, that's way too simplistic
(most likely bogus for cross-toolchains) and we want to make things explict.

Since we have detection of the linker version, we can use that directly
(A config test for support for stub-less linking might also be feasible
but much more involved).

Finally, should the user wish to generate code that caters for export to
use in an environment with an older toolchain, the generation of stubs
can be forced from the command line.

In addition to the points above, branch islanding and a long branch opt
for PowerPC Darwin has become conflated with the emission of these stubs.

274379 There is no need to distinguish PIC/non-PIC symbol stubs.

So we can use a single flag for both.

gcc/

2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-08-13 Iain Sandoe <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_call_target): Rename symbol stub
	flag.
	(darwin_override_options): Likewise.
	* config/darwin.h: Likewise.
	* config/darwin.opt: Likewise.
	* config/i386/i386.c (output_pic_addr_const): Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
	* config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
	... this TARGET_MACHO_SYMBOL_STUBS.
	(FUNCTION_PROFILER):Likewise.
	* config/i386/i386.h: Likewise.

	Backport from mainline
	2019-06-16  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_call_target): Use renamed
	darwin_picsymbol_stubs to decide on output.
	(darwin_override_options): Handle darwin_picsymbol_stubs.
	* config/darwin.h (MIN_LD64_OMIT_STUBS): New.
	(LD64_VERSION): Revise default.
	* config/darwin.opt: (mpic-symbol-stubs): New option.
	(darwin_picsymbol_stubs): New variable.
	* config/i386/darwin.h (TARGET_MACHO_BRANCH_ISLANDS):
	rename to TARGET_MACHO_PICSYM_STUBS.
	* config/i386/i386.c (output_pic_addr_const): Likewise.
	* config/i386/i386.h Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_call_darwin_1): Use renamed
	darwin_picsymbol_stubs.

gcc/testsuite/

2019-11-01  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-08-13  Iain Sandoe  <iain@sandoe.co.uk>

	* obj-c++.dg/stubify-1.mm: Rename symbol stub option.
	* obj-c++.dg/stubify-2.mm: Likewise.
	* objc.dg/stubify-1.m: Likewise.
	* objc.dg/stubify-2.m: Likewise.


Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/config/darwin.c
    branches/gcc-7-branch/gcc/config/darwin.h
    branches/gcc-7-branch/gcc/config/darwin.opt
    branches/gcc-7-branch/gcc/config/i386/darwin.h
    branches/gcc-7-branch/gcc/config/i386/i386.c
    branches/gcc-7-branch/gcc/config/i386/i386.h
    branches/gcc-7-branch/gcc/config/rs6000/darwin.h
    branches/gcc-7-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
    branches/gcc-7-branch/gcc/testsuite/obj-c++.dg/stubify-1.mm
    branches/gcc-7-branch/gcc/testsuite/obj-c++.dg/stubify-2.mm
    branches/gcc-7-branch/gcc/testsuite/objc.dg/stubify-1.m
    branches/gcc-7-branch/gcc/testsuite/objc.dg/stubify-2.m



More information about the Gcc-cvs mailing list