Message ID | 6C7293F5-4069-43D4-9980-182F81914800@sandoe-acoustics.co.uk |
---|---|
State | New |
Headers | show |
On 10/19/2010 10:48 AM, IainS wrote: > Hi, > CFStrings are a c-family target-specific addition on Darwin (they might > be useful to GNUstep, but we decided to delay that consideration for > present). > They've been present in the system since the start of Darwin and using > them has become a requirement if we are to parse system headers on > Darwin10. > > The changes need to be applied as one commit - hence one email. > > however to make review easier I've split the patch into files that > involve build system changes ... > ... and the remainder which are under Mike's area (the bulk of the text). > Although this patch is based on examination of the apple local 'trunk' > branch, I had to make significant modifications (i.e. it is technically > covered by the merging pre-approval, but Mike might wish to cast a quick > eye over it). > > checked on {powerpc,i686}-darwin9, x86_64-darwin10, i686-darwin8, > x86_64-unknown-linux, and a cross to cris-elf > (really mostly relevant to the test-suite changes in part 2). > > OK for trunk? > Iain > > === Build system Changes > > It turns out that, whilst we have the capability to add files > selectively for cfamily per target, this does not extend to gt-files and > therefore, to apply the patch I need approval for the following build > mechanism change: > > gcc: > > * config.gcc (target_cfamily_gtfiles): New var, target_cfamily_gtfiles > add darwin-cfstrings.c. > c_target_objs, cxx_target_objs add darwin-cfstrings.o. > * c-config-lang.in (gtfiles): Add target_cfamily_gtfiles. > > gcc/cp: > > * cp/config-lang.in (gtfiles): Add target_cfamily_gtfiles. > > gcc/objc: > > * objc/config-lang.in (gtfiles): Add target_cfamily_gtfiles. > > gcc/objcp: > > * objcp/config-lang.in (gtfiles): Add target_cfamily_gtfiles. That's okay. However I think it's better to make most of the implementation language-independent, since it already is. This is especially important for LTO, and also removes the need for the weak symbol hack. What remains is then small enough that it can be put in darwin-c.c. It's also hackish to have darwin_fold_builtin as TARGET_FOLD_BUILTIN; it only works because neither x86 and PPC have such a hook. I don't have any big problem with that, though. Paolo
Hi Paolo, On 19 Oct 2010, at 10:06, Paolo Bonzini wrote: > On 10/19/2010 10:48 AM, IainS wrote: >> Hi, >> CFStrings are a c-family target-specific addition on Darwin (they >> might >> be useful to GNUstep, but we decided to delay that consideration for >> present). >> They've been present in the system since the start of Darwin and >> using >> them has become a requirement if we are to parse system headers on >> Darwin10. >> >> The changes need to be applied as one commit - hence one email. >> >> however to make review easier I've split the patch into files that >> involve build system changes ... >> ... and the remainder which are under Mike's area (the bulk of the >> text). >> Although this patch is based on examination of the apple local >> 'trunk' >> branch, I had to make significant modifications (i.e. it is >> technically >> covered by the merging pre-approval, but Mike might wish to cast a >> quick >> eye over it). >> >> checked on {powerpc,i686}-darwin9, x86_64-darwin10, i686-darwin8, >> x86_64-unknown-linux, and a cross to cris-elf >> (really mostly relevant to the test-suite changes in part 2). >> >> OK for trunk? >> Iain >> >> === Build system Changes >> >> It turns out that, whilst we have the capability to add files >> selectively for cfamily per target, this does not extend to gt- >> files and >> therefore, to apply the patch I need approval for the following build >> mechanism change: >> >> gcc: >> >> * config.gcc (target_cfamily_gtfiles): New var, >> target_cfamily_gtfiles >> add darwin-cfstrings.c. >> c_target_objs, cxx_target_objs add darwin-cfstrings.o. >> * c-config-lang.in (gtfiles): Add target_cfamily_gtfiles. >> >> gcc/cp: >> >> * cp/config-lang.in (gtfiles): Add target_cfamily_gtfiles. >> >> gcc/objc: >> >> * objc/config-lang.in (gtfiles): Add target_cfamily_gtfiles. >> >> gcc/objcp: >> >> * objcp/config-lang.in (gtfiles): Add target_cfamily_gtfiles. thanks for the quick review. > That's okay. However I think it's better to make most of the > implementation language-independent, since it already is. Hm. I thought about this, but could not see any real way in which this could be made use of in Fortran as things stand... (this might change when fortran gets objects) .. I guess it's easier to see how it might apply to Java. > This is especially important for LTO, and also removes the need for > the weak symbol hack. What remains is then small enough that it can > be put in darwin-c.c. The test-suite changes incorporate cfstring ObjC torture tests, which include basic lto and whopr checks (which pass for darwin). I haven't done multi-file versions yet. FWIW, there is currently no target-specific additions file defined for Java (although there is one for Fortran). If Mike is also OK with this as it is, I'd prefer to leave as is for now - in the absence of any mechanism to test it on Fortran & Java. cheers, Iain
On 19 Oct 2010, at 10:06, Paolo Bonzini wrote: > > It's also hackish to have darwin_fold_builtin as > TARGET_FOLD_BUILTIN; it only works because neither x86 and PPC have > such a hook. I don't have any big problem with that, though. If the consensus is that we should have a "TARGET_SUBTARGET_FOLD_BUILTIN" and "TARGET_SUBTARGET_INIT_BUILTINS" ... ... I'll happily add them - not hard to do. cheers Iain
On 10/19/2010 11:27 AM, IainS wrote: > FWIW, there is currently no target-specific additions file defined for > Java (although there is one for Fortran). That wouldn't be needed, no? I don't recall anything language-dependent in the patch other than the ObjC hook. Paolo
On 19 Oct 2010, at 11:18, Paolo Bonzini wrote: > On 10/19/2010 11:27 AM, IainS wrote: >> FWIW, there is currently no target-specific additions file defined >> for >> Java (although there is one for Fortran). > > That wouldn't be needed, no? I don't recall anything language- > dependent in the patch other than the ObjC hook. IIRC Fortran and C have different ideas about 'push_top_level()' would take some investigation, I don't know about Java .. I hadn't looked. (BTW, passing the builtin to lto is dealt with by the streamer, I just confirmed w/Richi on IRC). cheers Iain
On 10/19/2010 12:28 PM, IainS wrote: > > On 19 Oct 2010, at 11:18, Paolo Bonzini wrote: > >> On 10/19/2010 11:27 AM, IainS wrote: >>> FWIW, there is currently no target-specific additions file defined for >>> Java (although there is one for Fortran). >> >> That wouldn't be needed, no? I don't recall anything >> language-dependent in the patch other than the ObjC hook. > > IIRC Fortran and C have different ideas about 'push_top_level()' would > take some investigation, I don't know about Java My point is that I see absolutely _nothing_ here that should be language-dependent except the C++ TREE_HAS_CONSTRUCTOR bit and the ObjC hook. There are some thing like pushdecl_top_level that in theory should be done through varpool, but I guess if Mike is okay it's pointless to argue. Paolo
On 19 Oct 2010, at 13:49, Paolo Bonzini wrote: > On 10/19/2010 12:28 PM, IainS wrote: >> >> On 19 Oct 2010, at 11:18, Paolo Bonzini wrote: >> >>> On 10/19/2010 11:27 AM, IainS wrote: >>>> FWIW, there is currently no target-specific additions file >>>> defined for >>>> Java (although there is one for Fortran). >>> >>> That wouldn't be needed, no? I don't recall anything >>> language-dependent in the patch other than the ObjC hook. >> >> IIRC Fortran and C have different ideas about 'push_top_level()' >> would >> take some investigation, I don't know about Java > > My point is that I see absolutely _nothing_ here that should be > language-dependent except the C++ TREE_HAS_CONSTRUCTOR bit that's already, handled in a language-independent manner in darwin.c (so that darwin_running_cxx is available generally, without needing the c_dialect() macros). So, I could move the main body code to darwin.c (all languages) > and the ObjC hook. ... that could probably be moved to darwin-c.c (c-family) ... (there's no reason to have to export a dummy for that to Fortran & Java). > There are some thing like pushdecl_top_level that in theory should > be done through varpool, hm. maybe that's a thing I've missed... .... perhaps I should be using finish_var_decl and setting the context instead. (that was part of the merged code I didn't modify). > but I guess if Mike is okay it's pointless to argue. Well, not arguing here ;-) ... ... if there's a Better Way, would rather do it now than modify it later.... cheers, Iain
On Oct 19, 2010, at 1:48 AM, IainS wrote: > The changes need to be applied as one commit - hence one email. > OK for trunk? Ok. If someone has a suggestion and direction for this part: + if (darwin_running_cxx) + TREE_LANG_FLAG_4 (constructor) = 1; /* TREE_HAS_CONSTRUCTOR */ I'd pre-approve a better direction. I've not thought about it much yet. I'm wondering if it makes sense to include the header that defines TREE_HAS_CONSTRUCTOR and then use that directly, or, if that should be pushed into the language independent parts of the compiler.... or something else entirely.
Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 165662) +++ gcc/config.gcc (working copy) @@ -147,6 +147,10 @@ # # target_gtfiles List of extra source files with type information. # +# target_cfamily_gtfiles +# List of extra source files with type information +# to be used for c family only. +# # xm_defines List of macros to define when compiling for the # target machine. # @@ -217,6 +221,7 @@ gnu_ld="$gnu_ld_flag" default_use_cxa_atexit=no default_gnu_indirect_function=no target_gtfiles= +target_cfamily_gtfiles= need_64bit_hwint= need_64bit_isa= # Selects the object file format reader/writer used by LTO. @@ -464,9 +469,10 @@ case ${target} in tm_file="${tm_file} ${cpu_type}/darwin.h" tm_p_file="${tm_p_file} darwin-protos.h" target_gtfiles="\$(srcdir)/config/darwin.c" + target_cfamily_gtfiles="\$(srcdir)/config/darwin-cfstrings.c" extra_options="${extra_options} darwin.opt" - c_target_objs="${c_target_objs} darwin-c.o" - cxx_target_objs="${cxx_target_objs} darwin-c.o" + c_target_objs="${c_target_objs} darwin-c.o darwin-cfstrings.o" + cxx_target_objs="${cxx_target_objs} darwin-c.o darwin-cfstrings.o" fortran_target_objs="darwin-f.o" extra_objs="darwin.o" extra_gcc_objs="darwin-driver.o" Index: gcc/c-config-lang.in =================================================================== --- gcc/c-config-lang.in (revision 165662) +++ gcc/c-config-lang.in (working copy) @@ -1,5 +1,6 @@ # Top level configure fragment for GNU C - C language. -# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2010 +# Free Software Foundation, Inc. #This file is part of GCC. @@ -23,3 +24,4 @@ # which therefore need to be scanned by gengtype.c. gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-parser.c \$(srcdir)/c-lang.h" +gtfiles="${gtfiles} ${target_cfamily_gtfiles}" Index: gcc/cp/config-lang.in =================================================================== --- gcc/cp/config-lang.in (revision 165662) +++ gcc/cp/config-lang.in (working copy) @@ -1,5 +1,5 @@ # Top level configure fragment for GNU C++. -# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2007 +# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2007, 2010 # Free Software Foundation, Inc. #This file is part of GCC. @@ -31,3 +31,4 @@ compilers="cc1plus\$(exeext)" target_libs="target-libstdc++-v3" gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/cp-lang.c" +gtfiles="${gtfiles} ${target_cfamily_gtfiles}" Index: gcc/objc/config-lang.in =================================================================== --- gcc/objc/config-lang.in (revision 165662) +++ gcc/objc/config-lang.in (working copy) @@ -1,5 +1,5 @@ # Top level configure fragment for GNU Objective-C -# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007 +# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010 # Free Software Foundation, Inc. #This file is part of GCC. @@ -34,3 +34,4 @@ target_libs=target-libobjc lang_requires="c" gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/c-parser.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/objc/objc-act.c" +gtfiles="${gtfiles} ${target_cfamily_gtfiles}" Index: gcc/objcp/config-lang.in =================================================================== --- gcc/objcp/config-lang.in (revision 165662) +++ gcc/objcp/config-lang.in (working copy) @@ -1,5 +1,5 @@ # Top level configure fragment for GNU Objective-C++. -# Copyright (C) 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc. # Contributed by Ziemowit Laski <zlaski@apple.com> #This file is part of GCC. @@ -38,3 +38,4 @@ lang_requires="objc c++" subdir_requires="objc cp" gtfiles="\$(srcdir)/objcp/objcp-decl.c \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-act.h \$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/cp/cp-objcp-common.c" +gtfiles="${gtfiles} ${target_cfamily_gtfiles}"