Skip to content

Commit c509ce9

Browse files
author
Apple
committed
gcc-5666.3
1 parent b4f2c69 commit c509ce9

File tree

20,993 files changed

+245
-1085455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

20,993 files changed

+245
-1085455
lines changed

ChangeLog.apple

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2010-08-06 Bob Wilson <[email protected]>
2+
3+
Radar 8277973
4+
* Makefile.in (FLAGS_FOR_TARGET): Add $(SYSROOT_CFLAGS_FOR_TARGET).
5+
* build_gcc: Configure for powerpc using --with-build-sysroot.
6+
17
2010-02-08 Jim Grosbach <[email protected]>
28

39
Radar 7148788

Makefile.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ STAGE1_LANGUAGES=@stage1_languages@
308308
# Programs producing files for the TARGET machine
309309
# -----------------------------------------------
310310

311-
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
311+
# APPLE LOCAL 8277973 Add sysroot flag here.
312+
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ $(SYSROOT_CFLAGS_FOR_TARGET)
312313

313314
AR_FOR_TARGET=@AR_FOR_TARGET@
314315
AS_FOR_TARGET=@AS_FOR_TARGET@

build_gcc

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ if [ ! -d "$DEST_ROOT/include/c++/$LIBSTDCXX_VERSION" ]; then
8686
fi
8787
NON_ARM_CONFIGFLAGS="--with-gxx-include-dir=\${prefix}/include/c++/$LIBSTDCXX_VERSION"
8888

89+
# Build against the MacOSX10.5 SDK for PowerPC.
90+
PPC_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk
91+
PPC_CONFIGFLAGS="$NON_ARM_CONFIGFLAGS --with-build-sysroot=\"$PPC_SYSROOT\""
92+
8993
DARWIN_VERS=`uname -r | sed 's/\..*//'`
9094
echo DARWIN_VERS = $DARWIN_VERS
9195

@@ -297,6 +301,8 @@ for t in $CROSS_TARGETS ; do
297301
AS_FOR_TARGET=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-as \
298302
LD_FOR_TARGET=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-ld \
299303
$SRC_DIR/configure $T_CONFIGFLAGS $ARM_CONFIGFLAGS || exit 1
304+
elif [ $t = 'powerpc' ] ; then
305+
$SRC_DIR/configure $T_CONFIGFLAGS $PPC_CONFIGFLAGS || exit 1
300306
else
301307
$SRC_DIR/configure $T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS || exit 1
302308
fi
@@ -345,6 +351,8 @@ for h in $HOSTS ; do
345351
--target=$t-apple-darwin$DARWIN_VERS"
346352
if [ $t = 'arm' ] && [ $h != 'arm' ] ; then
347353
T_CONFIGFLAGS="$T_CONFIGFLAGS $ARM_CONFIGFLAGS"
354+
elif [ $t = 'powerpc' ] && [ $h != 'powerpc' ] ; then
355+
T_CONFIGFLAGS="$T_CONFIGFLAGS $PPC_CONFIGFLAGS"
348356
else
349357
T_CONFIGFLAGS="$T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS"
350358
fi

configure

+117-116
Large diffs are not rendered by default.

configure.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,8 @@ AC_ARG_WITH([build-sysroot],
14961496
[ --with-build-sysroot=sysroot
14971497
use sysroot as the system root during the build],
14981498
[if test x"$withval" != x ; then
1499-
SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
1499+
# APPLE LOCAL 7852964 Use -isysroot instead of --sysroot.
1500+
SYSROOT_CFLAGS_FOR_TARGET="-isysroot $withval"
15001501
fi],
15011502
[SYSROOT_CFLAGS_FOR_TARGET=])
15021503
AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)

gcc/ChangeLog.apple

+32
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
2010-09-27 Bob Wilson <[email protected]>
2+
3+
Radar 8392704
4+
* doc/cppopts.texi: Fix description of -isysroot for Apple's GCC.
5+
* doc/invoke.texi (Directory Options): Update --sysroot description to
6+
refer Apple users to -isysroot.
7+
8+
2010-08-13 Bob Wilson <[email protected]>
9+
10+
Radar 8307333
11+
* config/i386/darwin.h (DARWIN_IPHONEOS_LIBGCC_SPEC): Do not link
12+
against libgcc_s.10.5.dylib.
13+
* config/rs6000/darwin.h (DARWIN_IPHONEOS_LIBGCC_SPEC): Likewise.
14+
15+
2010-04-16 Fariborz Jahanian <[email protected]>
16+
17+
Radar 7865106 is backed out.
18+
19+
2010-04-15 Fariborz Jahanian <[email protected]>
20+
21+
Radar 7865106
22+
* config/darwin.h (objc_weak_import_class): New decl.
23+
(ASM_WEAKEN_DECL): Call objc_weak_import_class see if
24+
we have a 'weak_reference' decl.
25+
* darwin.c (objc_weak_import_class): New definition.
26+
27+
2010-04-13 Stuart Hastings <[email protected]>
28+
29+
Radar 7212824
30+
* cp/decl.c (redeclaration_error_message): Insure we're looking
31+
at a VAR_DECL before diagnosing a redeclaration.
32+
133
2010-03-18 Stuart Hastings <[email protected]>
234

335
Radar 7763139

gcc/builtins.def

+1
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING
730730
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
731731
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
732732
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCPY_CHK, "__strncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
733+
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY_CHK, "__stpncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
733734
DEF_EXT_LIB_BUILTIN (BUILT_IN_SNPRINTF_CHK, "__snprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_5_6)
734735
DEF_EXT_LIB_BUILTIN (BUILT_IN_SPRINTF_CHK, "__sprintf_chk", BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_4_5)
735736
DEF_EXT_LIB_BUILTIN (BUILT_IN_VSNPRINTF_CHK, "__vsnprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_5_0)

gcc/config/i386/darwin.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ Boston, MA 02110-1301, USA. */
138138
#define DARWIN_DEFAULT_VERSION_TYPE DARWIN_VERSION_MACOSX
139139
/* APPLE LOCAL end ARM 5683689 */
140140

141-
/* APPLE LOCAL ARM 5681645 */
142-
#define DARWIN_IPHONEOS_LIBGCC_SPEC "-lgcc_s.10.5 -lgcc"
141+
/* APPLE LOCAL ARM 5681645 8307333 */
142+
#define DARWIN_IPHONEOS_LIBGCC_SPEC "-lgcc"
143143

144144
/* APPLE LOCAL begin link optimizations 6499452 */
145145
#undef DARWIN_CRT1_SPEC

gcc/config/rs6000/darwin.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@
168168
#define DARWIN_DEFAULT_VERSION_TYPE DARWIN_VERSION_MACOSX
169169
/* APPLE LOCAL end ARM 5683689 */
170170

171-
/* APPLE LOCAL ARM 5681645 */
172-
#define DARWIN_IPHONEOS_LIBGCC_SPEC "-lgcc_s.10.5 -lgcc"
171+
/* APPLE LOCAL ARM 5681645 8307333 */
172+
#define DARWIN_IPHONEOS_LIBGCC_SPEC "-lgcc"
173173

174174
/* APPLE LOCAL begin mainline */
175175
#undef SUBTARGET_EXTRA_SPECS

gcc/cp/decl.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -2197,8 +2197,10 @@ redeclaration_error_message (tree newdecl, tree olddecl)
21972197
union { int i; };
21982198
21992199
is invalid. */
2200-
if (DECL_ANON_UNION_VAR_P (newdecl)
2201-
|| DECL_ANON_UNION_VAR_P (olddecl))
2200+
if (TREE_CODE (olddecl) == VAR_DECL
2201+
&& TREE_CODE (newdecl) == VAR_DECL
2202+
&& (DECL_ANON_UNION_VAR_P (newdecl)
2203+
|| DECL_ANON_UNION_VAR_P (olddecl)))
22022204
return "redeclaration of %q#D";
22032205
/* If at least one declaration is a reference, there is no
22042206
conflict. For example:

gcc/doc/cppopts.texi

+4-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,10 @@ would; @option{-iwithprefix} puts it where @option{-idirafter} would.
491491
@item -isysroot @var{dir}
492492
@opindex isysroot
493493
This option is like the @option{--sysroot} option, but applies only to
494-
header files. See the @option{--sysroot} option for more information.
494+
header files, except for Apple's version of GCC, where it applies to
495+
both header files and libraries and effectively replaces the
496+
@option{--sysroot} option.
497+
See the @option{--sysroot} option for more information.
495498

496499
@item -imultilib @var{dir}
497500
@opindex imultilib

gcc/doc/invoke.texi

+4-1
Original file line numberDiff line numberDiff line change
@@ -7502,7 +7502,10 @@ For example, if the compiler would normally search for headers in
75027502
@file{/usr/include} and libraries in @file{/usr/lib}, it will instead
75037503
search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
75047504

7505-
If you use both this option and the @option{-isysroot} option, then
7505+
With Apple's version of GCC, this option is effectively replaced by
7506+
@option{-isysroot}, which you should use instead of @option{--sysroot}.
7507+
For other (non-Apple) versions of GCC,
7508+
if you use both this option and the @option{-isysroot} option, then
75067509
the @option{--sysroot} option will apply to libraries, but the
75077510
@option{-isysroot} option will apply to header files.
75087511

gcc/objc/ChangeLog.apple

+23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2010-04-18 Fariborz Jahanian <[email protected]>
2+
3+
Radar 7865106 - Take two
4+
* objc-act.c (objc_class_weak_import,
5+
objc_build_weak_reference_internal_classname): New.
6+
(objc_start_class_interface): For weak_import
7+
class declaration generate asm(.weak_reference ...)
8+
statement.
9+
(objc_warn_on_class_attributes): Do not warn on existance
10+
of 'weak_import' attribute on a class.
11+
12+
2010-04-15 Fariborz Jahanian <[email protected]>
13+
14+
Radar 7865106
15+
* objc-act.c (objc_class_weak_import): New
16+
(objc_create_global_decl_for_class): Tag metaclass
17+
with weak_import attribute if class has one.
18+
(ivar_offset_ref): Call to objc_create_global_decl_for_class takes
19+
extra flag arg.
20+
(generate_v2_shared_structures): Ditto.
21+
(objc_warn_on_class_attributes): Do not warn on existance
22+
of 'weak_import' attribute on a class.
23+
124
2010-04-02 Fariborz Jahanian <[email protected]>
225

326
Radar 7591784

gcc/objc/objc-act.c

+37
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,28 @@ lookup_protocol_in_reflist (tree rproto_list, tree lproto)
912912
return 0;
913913
}
914914

915+
/* APPLE LOCAL begin radar 7865106 */
916+
static bool objc_class_weak_import(tree class)
917+
{
918+
tree chain;
919+
gcc_assert (class && TREE_CODE (class) == CLASS_INTERFACE_TYPE);
920+
for (chain = CLASS_ATTRIBUTES (class); chain; chain = TREE_CHAIN (chain))
921+
if (is_attribute_p ("weak_import", TREE_PURPOSE (chain)))
922+
return true;
923+
return false;
924+
}
925+
926+
static char*
927+
objc_build_weak_reference_internal_classname (tree ident, bool metaclass)
928+
{
929+
static char string[BUFSIZE];
930+
sprintf (string, ".weak_reference %s_%s", !metaclass ? "_OBJC_CLASS_$"
931+
: "_OBJC_METACLASS_$",
932+
IDENTIFIER_POINTER (ident));
933+
return string;
934+
}
935+
/* APPLE LOCAL end radar 7865106 */
936+
915937
void
916938
/* APPLE LOCAL radar 4548636 */
917939
objc_start_class_interface (tree class, tree super_class, tree protos, tree attributes)
@@ -923,6 +945,17 @@ objc_start_class_interface (tree class, tree super_class, tree protos, tree attr
923945
CLASS_ATTRIBUTES (objc_interface_context) = attributes;
924946
objc_warn_on_class_attributes (objc_interface_context, false);
925947
/* APPLE LOCAL end radar 4548636 */
948+
/* APPLE LOCAL begin radar 7865106 */
949+
if (flag_objc_abi == 2 && objc_class_weak_import(objc_interface_context)) {
950+
const char * name =
951+
objc_build_weak_reference_internal_classname(CLASS_NAME(objc_interface_context) , 0);
952+
tree asm_str = build_string(strlen(name), name);
953+
cgraph_add_asm_node(asm_str);
954+
name = objc_build_weak_reference_internal_classname(CLASS_NAME(objc_interface_context) , 1);
955+
asm_str = build_string(strlen(name), name);
956+
cgraph_add_asm_node(asm_str);
957+
}
958+
/* APPLE LOCAL end radar 7865106 */
926959
objc_public_flag = 0;
927960
}
928961

@@ -14756,6 +14789,10 @@ objc_warn_on_class_attributes (tree class, bool use)
1475614789
else if (is_attribute_p ("objc_exception", TREE_PURPOSE (chain)))
1475714790
;
1475814791
/* APPLE LOCAL end radar 5008110 */
14792+
/* APPLE LOCAL begin radar 7865106 */
14793+
else if (is_attribute_p ("weak_import", TREE_PURPOSE (chain)))
14794+
;
14795+
/* APPLE LOCAL end radar 7865106 */
1475914796
else if (!use)
1476014797
warning (0, "attribute %s is unknown - ignored",
1476114798
IDENTIFIER_POINTER (TREE_PURPOSE (chain)));

0 commit comments

Comments
 (0)