[Darwin] There is no need to distinguish PIC/non-PIC symbol stubs.

So we can use a single flag for both, and rename this now, before a confusing
name gets into the wild.

gcc/

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.

gcc/testsuite/

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.

From-SVN: r274397
This commit is contained in:
Iain Sandoe 2019-08-13 19:03:46 +00:00 committed by Iain Sandoe
parent 20ac6454c5
commit d308419c64
14 changed files with 46 additions and 26 deletions

View File

@ -1,3 +1,18 @@
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.
2019-08-13 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (ix86_expand_vector_extract) <case E_V2SImode>:

View File

@ -788,7 +788,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
rtx
machopic_indirect_call_target (rtx target)
{
if (! darwin_picsymbol_stubs)
if (! darwin_symbol_stubs)
return target;
if (GET_CODE (target) != MEM)
@ -3268,13 +3268,13 @@ darwin_override_options (void)
Linkers that don't need stubs, don't need the EH symbol markers either.
*/
if (!global_options_set.x_darwin_picsymbol_stubs)
if (!global_options_set.x_darwin_symbol_stubs)
{
if (darwin_target_linker)
{
if (strverscmp (darwin_target_linker, MIN_LD64_OMIT_STUBS) < 0)
{
darwin_picsymbol_stubs = true;
darwin_symbol_stubs = true;
ld_needs_eh_markers = true;
}
}
@ -3283,15 +3283,15 @@ darwin_override_options (void)
/* If we don't know the linker version and we're targeting an old
system, we know no better than to assume the use of an earlier
linker. */
darwin_picsymbol_stubs = true;
darwin_symbol_stubs = true;
ld_needs_eh_markers = true;
}
}
else if (DARWIN_X86 && darwin_picsymbol_stubs && TARGET_64BIT)
else if (DARWIN_X86 && darwin_symbol_stubs && TARGET_64BIT)
{
inform (input_location,
"%<-mpic-symbol-stubs%> is not required for 64b code (ignored)");
darwin_picsymbol_stubs = false;
darwin_symbol_stubs = false;
}
if (generating_for_darwin_version >= 9)

View File

@ -1019,7 +1019,7 @@ extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **);
_tested_ version known to support this so far. */
#define MIN_LD64_NO_COAL_SECTS "236.4"
/* From at least version 62.1, ld64 can build PIC indirection stubs as
/* From at least version 62.1, ld64 can build symbol indirection stubs as
needed, and there is no need for the compiler to emit them. */
#define MIN_LD64_OMIT_STUBS "62.1"

View File

@ -75,9 +75,9 @@ mone-byte-bool
Target RejectNegative Report Var(darwin_one_byte_bool)
Set sizeof(bool) to 1.
mpic-symbol-stubs
Target Report Var(darwin_picsymbol_stubs) Init(0)
Force generation of PIC symbol stubs.
msymbol-stubs
Target Report Var(darwin_symbol_stubs) Init(0)
Force generation of external symbol indirection stubs.
; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
mtarget-linker=

View File

@ -91,8 +91,8 @@ along with GCC; see the file COPYING3. If not see
#define WCHAR_TYPE_SIZE 32
/* Generate pic symbol indirection stubs if this is true. */
#undef TARGET_MACHO_PICSYM_STUBS
#define TARGET_MACHO_PICSYM_STUBS (darwin_picsymbol_stubs)
#undef TARGET_MACHO_SYMBOL_STUBS
#define TARGET_MACHO_SYMBOL_STUBS (darwin_symbol_stubs)
/* For compatibility with OSX system tools, use the new style of pic stub
if this is set (default). */
@ -243,7 +243,7 @@ along with GCC; see the file COPYING3. If not see
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
if (TARGET_MACHO_PICSYM_STUBS \
if (TARGET_MACHO_SYMBOL_STUBS \
&& MACHOPIC_INDIRECT && !TARGET_64BIT) \
{ \
const char *name = machopic_mcount_stub_name (); \

View File

@ -11445,7 +11445,7 @@ output_pic_addr_const (FILE *file, rtx x, int code)
break;
case SYMBOL_REF:
if (TARGET_64BIT || ! TARGET_MACHO_PICSYM_STUBS)
if (TARGET_64BIT || ! TARGET_MACHO_SYMBOL_STUBS)
output_addr_const (file, x);
else
{

View File

@ -647,7 +647,7 @@ extern tree x86_mfence;
/* Replace MACH-O, ifdefs by in-line tests, where possible.
(a) Macros defined in config/i386/darwin.h */
#define TARGET_MACHO 0
#define TARGET_MACHO_PICSYM_STUBS 0
#define TARGET_MACHO_SYMBOL_STUBS 0
#define MACHOPIC_ATT_STUB 0
/* (b) Macros defined in config/darwin.h */
#define MACHO_DYNAMIC_NO_PIC_P 0

View File

@ -62,9 +62,6 @@
} \
while (0)
/* Generate pic symbol stubs if this is true. */
extern int darwin_emit_picsym_stub;
#define SUBTARGET_OVERRIDE_OPTIONS darwin_rs6000_override_options ()
#define C_COMMON_OVERRIDE_OPTIONS do { \

View File

@ -12943,7 +12943,7 @@ print_operand (FILE *file, rtx x, int code)
{
const char *name = XSTR (x, 0);
#if TARGET_MACHO
if (darwin_picsymbol_stubs
if (darwin_symbol_stubs
&& MACHOPIC_INDIRECT
&& machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION)
name = machopic_indirection_name (x, /*stub_p=*/true);
@ -19481,7 +19481,7 @@ get_prev_label (tree function_name)
return NULL_TREE;
}
/* Generate PIC and indirect symbol stubs. */
/* Generate external symbol indirection stubs (PIC and non-PIC). */
void
machopic_output_stub (FILE *file, const char *symb, const char *stub)
@ -24523,8 +24523,9 @@ rs6000_call_darwin_1 (rtx value, rtx func_desc, rtx tlsarg,
if ((cookie_val & CALL_LONG) != 0
&& GET_CODE (func_desc) == SYMBOL_REF)
{
/* FIXME: the longcall opt should not hang off picsymbol stubs. */
if (darwin_picsymbol_stubs && TARGET_32BIT)
/* FIXME: the longcall opt should not hang off this flag, it is most
likely incorrect for kernel-mode code-generation. */
if (darwin_symbol_stubs && TARGET_32BIT)
make_island = true; /* Do nothing yet, retain the CALL_LONG flag. */
else
{

View File

@ -1,3 +1,10 @@
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.
2013-08-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/90563

View File

@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;

View File

@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;

View File

@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;

View File

@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;