Commit 965a7e90 by Geoffrey Keating Committed by Geoffrey Keating

darwin.h (ASM_SPEC): Simplify.

	* config/i386/darwin.h (ASM_SPEC): Simplify.
	(SUBTARGET_EXTRA_SPECS): Add darwin_subarch spec.
	* config/rs6000/darwin.h (DARWIN_SUBARCH_SPEC): New.
	(SUBTARGET_EXTRA_SPECS): Add darwin_subarch spec.
	* config/darwin.h (LINK_COMMAND_SPEC): Don't pass -arch here.
	(LINK_SPEC): Do pass -arch here.  Handle -force_cpusubtype_ALL
	in all cases.  Pass the right -arch or -arch_only based on -mcpu.
	(ASM_SPEC): Handle -force_cpusubtype_ALL.
	* doc/invoke.texi (Darwin Options): Improve documentation for
	Darwin linker (and libtool) switches.

From-SVN: r89877
parent d2607dde
...@@ -43,6 +43,17 @@ ...@@ -43,6 +43,17 @@
2004-10-29 Geoffrey Keating <geoffk@apple.com> 2004-10-29 Geoffrey Keating <geoffk@apple.com>
* config/i386/darwin.h (ASM_SPEC): Simplify.
(SUBTARGET_EXTRA_SPECS): Add darwin_subarch spec.
* config/rs6000/darwin.h (DARWIN_SUBARCH_SPEC): New.
(SUBTARGET_EXTRA_SPECS): Add darwin_subarch spec.
* config/darwin.h (LINK_COMMAND_SPEC): Don't pass -arch here.
(LINK_SPEC): Do pass -arch here. Handle -force_cpusubtype_ALL
in all cases. Pass the right -arch or -arch_only based on -mcpu.
(ASM_SPEC): Handle -force_cpusubtype_ALL.
* doc/invoke.texi (Darwin Options): Improve documentation for
Darwin linker (and libtool) switches.
* config/rs6000/darwin-fallback.c: Include <mach/thread_status.h>. * config/rs6000/darwin-fallback.c: Include <mach/thread_status.h>.
2004-10-29 Stan Shebs <shebs@apple.com> 2004-10-29 Stan Shebs <shebs@apple.com>
......
...@@ -219,8 +219,6 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -219,8 +219,6 @@ extern const char *darwin_fix_and_continue_switch;
#define LINK_COMMAND_SPEC "\ #define LINK_COMMAND_SPEC "\
%{!fdump=*:%{!fsyntax-only:%{!precomp:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %{!fdump=*:%{!fsyntax-only:%{!precomp:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%{!Zdynamiclib:%(linker)}%{Zdynamiclib:/usr/bin/libtool} \ %{!Zdynamiclib:%(linker)}%{Zdynamiclib:/usr/bin/libtool} \
%{!Zdynamiclib:-arch %(darwin_arch)} \
%{Zdynamiclib:-arch_only %(darwin_arch)} \
%l %X %{d} %{s} %{t} %{Z} \ %l %X %{d} %{s} %{t} %{Z} \
%{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \ %{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \ %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
...@@ -240,13 +238,14 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -240,13 +238,14 @@ extern const char *darwin_fix_and_continue_switch;
"%{static}%{!static:-dynamic} \ "%{static}%{!static:-dynamic} \
%{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}\ %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}\
%{!Zdynamiclib: \ %{!Zdynamiclib: \
%{Zforce_cpusubtype_ALL:-arch %(darwin_arch) -force_cpusubtype_ALL} \
%{!Zforce_cpusubtype_ALL:-arch %(darwin_subarch)} \
%{Zbundle:-bundle} \ %{Zbundle:-bundle} \
%{Zbundle_loader*:-bundle_loader %*} \ %{Zbundle_loader*:-bundle_loader %*} \
%{client_name*} \ %{client_name*} \
%{compatibility_version*:%e-compatibility_version only allowed with -dynamiclib\ %{compatibility_version*:%e-compatibility_version only allowed with -dynamiclib\
} \ } \
%{current_version*:%e-current_version only allowed with -dynamiclib} \ %{current_version*:%e-current_version only allowed with -dynamiclib} \
%{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
%{Zforce_flat_namespace:-force_flat_namespace} \ %{Zforce_flat_namespace:-force_flat_namespace} \
%{Zinstall_name*:%e-install_name only allowed with -dynamiclib} \ %{Zinstall_name*:%e-install_name only allowed with -dynamiclib} \
%{keep_private_externs} \ %{keep_private_externs} \
...@@ -258,7 +257,8 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -258,7 +257,8 @@ extern const char *darwin_fix_and_continue_switch;
%{client_name*:%e-client_name not allowed with -dynamiclib} \ %{client_name*:%e-client_name not allowed with -dynamiclib} \
%{compatibility_version*} \ %{compatibility_version*} \
%{current_version*} \ %{current_version*} \
%{Zforce_cpusubtype_ALL:%e-force_cpusubtype_ALL not allowed with -dynamiclib} \ %{Zforce_cpusubtype_ALL:-arch_only %(darwin_arch)} \
%{!Zforce_cpusubtype_ALL: -arch_only %(darwin_subarch)} \
%{Zforce_flat_namespace:%e-force_flat_namespace not allowed with -dynamiclib} \ %{Zforce_flat_namespace:%e-force_flat_namespace not allowed with -dynamiclib} \
%{Zinstall_name*:-install_name %*} \ %{Zinstall_name*:-install_name %*} \
%{keep_private_externs:%e-keep_private_externs not allowed with -dynamiclib} \ %{keep_private_externs:%e-keep_private_externs not allowed with -dynamiclib} \
...@@ -332,7 +332,8 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -332,7 +332,8 @@ extern const char *darwin_fix_and_continue_switch;
/* #define ENDFILE_SPEC "" */ /* #define ENDFILE_SPEC "" */
/* Default Darwin ASM_SPEC, very simple. */ /* Default Darwin ASM_SPEC, very simple. */
#define ASM_SPEC "-arch %(darwin_arch)" #define ASM_SPEC "-arch %(darwin_arch) \
%{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL}"
/* We use Dbx symbol format. */ /* We use Dbx symbol format. */
......
...@@ -45,16 +45,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -45,16 +45,13 @@ Boston, MA 02111-1307, USA. */
%{g: %{!gfull: -feliminate-unused-debug-symbols %<gfull }}" %{g: %{!gfull: -feliminate-unused-debug-symbols %<gfull }}"
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "-arch i686 \ #define ASM_SPEC "-arch i686 -force_cpusubtype_ALL"
-force_cpusubtype_ALL \
%{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
%{!Zforce_cpusubtype_ALL:%{mmmx:-force_cpusubtype_ALL}\
%{msse:-force_cpusubtype_ALL}\
%{msse2:-force_cpusubtype_ALL}}"
#undef SUBTARGET_EXTRA_SPECS #undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \ #define SUBTARGET_EXTRA_SPECS \
{ "darwin_arch", "i686" }, { "darwin_arch", "i686" }, \
{ "darwin_subarch", "%{march=pentium3:pentIIm3;:i686}" },
/* Use the following macro for any Darwin/x86-specific command-line option /* Use the following macro for any Darwin/x86-specific command-line option
translation. */ translation. */
......
...@@ -132,9 +132,29 @@ do { \ ...@@ -132,9 +132,29 @@ do { \
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\ %{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
%{!static:%{!mdynamic-no-pic:-fPIC}}" %{!static:%{!mdynamic-no-pic:-fPIC}}"
#define DARWIN_SUBARCH_SPEC " \
%{m64: ppc64} \
%{!m64: \
%{mcpu=601:ppc601; \
mcpu=603:ppc603; \
mcpu=603e:ppc603; \
mcpu=604:ppc604; \
mcpu=604e:ppc604e; \
mcpu=740:ppc750; \
mcpu=750:ppc750; \
mcpu=G3:ppc750; \
mcpu=7400:ppc7400; \
mcpu=G4:ppc7400; \
mcpu=7450:ppc7450; \
mcpu=970:ppc970; \
mcpu=power4:ppc970; \
mcpu=G5:ppc970; \
:ppc}}"
#undef SUBTARGET_EXTRA_SPECS #undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \ #define SUBTARGET_EXTRA_SPECS \
{ "darwin_arch", "%{m64:ppc64} %{!m64:ppc}" }, { "darwin_arch", "%{m64:ppc64;:ppc}" }, \
{ "darwin_subarch", DARWIN_SUBARCH_SPEC },
/* Output a .machine directive. */ /* Output a .machine directive. */
#undef TARGET_ASM_FILE_START #undef TARGET_ASM_FILE_START
......
...@@ -7185,7 +7185,17 @@ Like @option{-sim}, but pass linker options to locate initialized data at ...@@ -7185,7 +7185,17 @@ Like @option{-sim}, but pass linker options to locate initialized data at
@cindex Darwin options @cindex Darwin options
These options are defined for all architectures running the Darwin operating These options are defined for all architectures running the Darwin operating
system. They are useful for compatibility with other Mac OS compilers. system.
FSF GCC on Darwin does not create ``fat'' object files; it will create
an object file for the single architecture that it was built to
target. Apple's GCC on Darwin does create ``fat'' files if multiple
@option{-arch} options are used.
The subtype of the file created (@var{ppc7400} or @var{ppc970} or
@var{i686}) is determined by the flag that specifies the ISA
that GCC is targetting, @option{-mcpu} or @option{-march}. The
@option{-force_cpusubtype_ALL} option can be used to override this.
@table @gcctabopt @table @gcctabopt
@item -F@var{dir} @item -F@var{dir}
...@@ -7272,12 +7282,20 @@ See man ld(1) for more information. ...@@ -7272,12 +7282,20 @@ See man ld(1) for more information.
@item -bundle_loader @var{executable} @item -bundle_loader @var{executable}
@opindex bundle_loader @opindex bundle_loader
This specifies the @var{executable} that will be loading the build This option specifies the @var{executable} that will be loading the build
output file being linked. See man ld(1) for more information. output file being linked. See man ld(1) for more information.
@item -allowable_client @var{client_name} @item -dynamiclib
@itemx -arch_only @opindex -dynamiclib
When passed this option, GCC will produce a dynamic library instead of
an executable when linking, using the Darwin @file{libtool} command.
@item -force_cpusubtype_ALL
@opindex -force_cpusubtype_ALL
This causes GCC's output file to have the @var{ALL} subtype, instead of
one controlled by the @option{-mcpu} or @option{-march} option.
@item -allowable_client @var{client_name}
@itemx -client_name @itemx -client_name
@itemx -compatibility_version @itemx -compatibility_version
@itemx -current_version @itemx -current_version
...@@ -7286,11 +7304,9 @@ output file being linked. See man ld(1) for more information. ...@@ -7286,11 +7304,9 @@ output file being linked. See man ld(1) for more information.
@itemx -dylib_file @itemx -dylib_file
@itemx -dylinker_install_name @itemx -dylinker_install_name
@itemx -dynamic @itemx -dynamic
@itemx -dynamiclib
@itemx -exported_symbols_list @itemx -exported_symbols_list
@itemx -filelist @itemx -filelist
@itemx -flat_namespace @itemx -flat_namespace
@itemx -force_cpusubtype_ALL
@itemx -force_flat_namespace @itemx -force_flat_namespace
@itemx -headerpad_max_install_names @itemx -headerpad_max_install_names
@itemx -image_base @itemx -image_base
...@@ -7339,7 +7355,6 @@ output file being linked. See man ld(1) for more information. ...@@ -7339,7 +7355,6 @@ output file being linked. See man ld(1) for more information.
@itemx -whatsloaded @itemx -whatsloaded
@opindex allowable_client @opindex allowable_client
@opindex arch_only
@opindex client_name @opindex client_name
@opindex compatibility_version @opindex compatibility_version
@opindex current_version @opindex current_version
...@@ -7348,11 +7363,9 @@ output file being linked. See man ld(1) for more information. ...@@ -7348,11 +7363,9 @@ output file being linked. See man ld(1) for more information.
@opindex dylib_file @opindex dylib_file
@opindex dylinker_install_name @opindex dylinker_install_name
@opindex dynamic @opindex dynamic
@opindex dynamiclib
@opindex exported_symbols_list @opindex exported_symbols_list
@opindex filelist @opindex filelist
@opindex flat_namespace @opindex flat_namespace
@opindex force_cpusubtype_ALL
@opindex force_flat_namespace @opindex force_flat_namespace
@opindex headerpad_max_install_names @opindex headerpad_max_install_names
@opindex image_base @opindex image_base
...@@ -7400,7 +7413,7 @@ output file being linked. See man ld(1) for more information. ...@@ -7400,7 +7413,7 @@ output file being linked. See man ld(1) for more information.
@opindex weak_reference_mismatches @opindex weak_reference_mismatches
@opindex whatsloaded @opindex whatsloaded
These options are available for Darwin linker. Darwin linker man page These options are passed to the Darwin linker. The Darwin linker man page
describes them in detail. describes them in detail.
@end table @end table
......
...@@ -1623,6 +1623,8 @@ add_call_read_ops (tree stmt) ...@@ -1623,6 +1623,8 @@ add_call_read_ops (tree stmt)
{ {
bitmap_iterator bi; bitmap_iterator bi;
bi.ptr2 = NULL;
/* Otherwise, if the function is not pure, it may reference memory. Add /* Otherwise, if the function is not pure, it may reference memory. Add
a VUSE for .GLOBAL_VAR if it has been created. Otherwise, add a VUSE a VUSE for .GLOBAL_VAR if it has been created. Otherwise, add a VUSE
for each call-clobbered variable. See add_referenced_var for the for each call-clobbered variable. See add_referenced_var for the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment