mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-18 23:51:08 +08:00
Index: ChangeLog
2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
This commit is contained in:
parent
5f7d29798e
commit
ed5b9f96ee
@ -1,3 +1,35 @@
|
||||
2005-07-07 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* config.gcc (*-*-darwin*): Only one target-specific header file
|
||||
for generic darwin.
|
||||
(powerpc-*-darwin*): Add version-specific header files.
|
||||
* configure.in (gcc_AC_CHECK_DECLS): Add strverscmp.
|
||||
* config.in: Regenerate.
|
||||
* configure: Regenerate.
|
||||
* gcc.c: Include xregex.h.
|
||||
(version_compare_spec_function): New.
|
||||
(spec_function): Add version-compare.
|
||||
(replace_outfile_spec_function): Reformat comment.
|
||||
(compare_version_strings): New.
|
||||
* config/darwin-c.c (version_as_macro): New.
|
||||
(builtin_define): New.
|
||||
(darwin_cpp_builtins): New.
|
||||
* config/darwin-protos.h (darwin_cpp_builtins): New.
|
||||
* config/darwin.h (CPP_SPEC): Don't define APPLE_CC here.
|
||||
(LIB_SPEC): Make unconditional, update comment.
|
||||
(TARGET_C99_FUNCTIONS): Define.
|
||||
* config/darwin.opt: Sort.
|
||||
(mmacosx-version-min=): New.
|
||||
* config/darwin7.h: Delete.
|
||||
* config/darwin8.h: Delete.
|
||||
* config/i386/darwin.h (): Call darwin_cpp_builtins.
|
||||
* config/rs6000/darwin.h (): Call darwin_cpp_builtins.
|
||||
(TARGET_C99_FUNCTIONS): Define.
|
||||
* config/rs6000/darwin7.h: New.
|
||||
* config/rs6000/darwin8.h: New.
|
||||
* doc/invoke.texi (Darwin Options): Add -mmacosx-version-min=
|
||||
(-mmacosx-version-min): Document.
|
||||
|
||||
2005-07-07 Ian Lance Taylor <ian@airs.com>
|
||||
|
||||
* config/mips/mips.md (abs<mode>2) [GPR]: Remove.
|
||||
|
@ -355,12 +355,6 @@ esac
|
||||
# Common parts for widely ported systems.
|
||||
case ${target} in
|
||||
*-*-darwin*)
|
||||
case ${target} in
|
||||
*-darwin1[0-9]*) tm_file="${tm_file} darwin8.h" ;;
|
||||
*-darwin[0-6]*) ;;
|
||||
*-darwin7*) tm_file="${tm_file} darwin7.h" ;;
|
||||
*) tm_file="${tm_file} darwin8.h" ;;
|
||||
esac
|
||||
tm_file="${tm_file} darwin.h"
|
||||
tm_p_file="${tm_p_file} darwin-protos.h"
|
||||
tmake_file="t-darwin t-slibgcc-darwin"
|
||||
@ -1608,9 +1602,15 @@ powerpc-*-darwin*)
|
||||
tmake_file="${tmake_file} rs6000/t-darwin"
|
||||
extra_options="${extra_options} rs6000/darwin.opt"
|
||||
case ${target} in
|
||||
*-darwin1[0-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;;
|
||||
*-darwin[0-7]*) ;;
|
||||
*-darwin[8-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;;
|
||||
*-darwin1[0-9]* | *-darwin[8-9]*)
|
||||
tmake_file="${tmake_file} rs6000/t-darwin8"
|
||||
tm_file="${tm_file} rs6000/darwin8.h"
|
||||
;;
|
||||
*-darwin7*)
|
||||
tm_file="${tm_file} rs6000/darwin7.h"
|
||||
;;
|
||||
*-darwin[0-6]*)
|
||||
;;
|
||||
esac
|
||||
extra_headers=altivec.h
|
||||
;;
|
||||
|
@ -577,6 +577,13 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if we found a declaration for 'strverscmp', otherwise define to
|
||||
0. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_DECL_STRVERSCMP
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if we found a declaration for 'times', otherwise define to 0.
|
||||
*/
|
||||
#ifndef USED_FOR_TARGET
|
||||
|
@ -542,3 +542,57 @@ find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return the value of darwin_macosx_version_min suitable for the
|
||||
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro,
|
||||
so '10.4.2' becomes 1042.
|
||||
Print a warning if the version number is not known. */
|
||||
static const char *
|
||||
version_as_macro (void)
|
||||
{
|
||||
static char result[] = "1000";
|
||||
|
||||
if (strncmp (darwin_macosx_version_min, "10.", 3) != 0)
|
||||
goto fail;
|
||||
if (! ISDIGIT (darwin_macosx_version_min[3]))
|
||||
goto fail;
|
||||
result[2] = darwin_macosx_version_min[3];
|
||||
if (darwin_macosx_version_min[4] != '\0')
|
||||
{
|
||||
if (darwin_macosx_version_min[4] != '.')
|
||||
goto fail;
|
||||
if (! ISDIGIT (darwin_macosx_version_min[5]))
|
||||
goto fail;
|
||||
if (darwin_macosx_version_min[6] != '\0')
|
||||
goto fail;
|
||||
result[3] = darwin_macosx_version_min[5];
|
||||
}
|
||||
else
|
||||
result[3] = '0';
|
||||
|
||||
return result;
|
||||
|
||||
fail:
|
||||
error ("Unknown value %qs of -mmacosx-version-min",
|
||||
darwin_macosx_version_min);
|
||||
return "1000";
|
||||
}
|
||||
|
||||
/* Define additional CPP flags for Darwin. */
|
||||
|
||||
#define builtin_define(TXT) cpp_define (pfile, TXT)
|
||||
|
||||
void
|
||||
darwin_cpp_builtins (cpp_reader *pfile)
|
||||
{
|
||||
builtin_define ("__MACH__");
|
||||
builtin_define ("__APPLE__");
|
||||
|
||||
/* __APPLE_CC__ is defined as some old Apple include files expect it
|
||||
to be defined and won't work if it isn't. */
|
||||
builtin_define_with_value ("__APPLE_CC__", "1", false);
|
||||
|
||||
if (darwin_macosx_version_min)
|
||||
builtin_define_with_value ("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__",
|
||||
version_as_macro(), false);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Prototypes.
|
||||
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -135,3 +135,4 @@ extern void darwin_assemble_visibility (tree, int);
|
||||
extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
|
||||
const char *);
|
||||
extern bool darwin_binds_local_p (tree);
|
||||
extern void darwin_cpp_builtins (struct cpp_reader *);
|
||||
|
@ -185,13 +185,11 @@ Boston, MA 02110-1301, USA. */
|
||||
!strcmp (STR, "dylinker_install_name") ? 1 : \
|
||||
0)
|
||||
|
||||
/* Machine dependent cpp options. __APPLE_CC__ is defined as the
|
||||
Apple include files expect it to be defined and won't work if it
|
||||
isn't. */
|
||||
/* Machine dependent cpp options. Don't add more options here, add
|
||||
them to darwin_cpp_builtins in darwin-c.c. */
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}\
|
||||
-D__APPLE_CC__=1"
|
||||
#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}"
|
||||
|
||||
/* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
|
||||
precomp, libtool, and fat build additions. Also we
|
||||
@ -291,12 +289,9 @@ Boston, MA 02110-1301, USA. */
|
||||
%{dylinker} %{Mach} "
|
||||
|
||||
|
||||
/* Machine dependent libraries but do not redefine it if we already on 7.0 and
|
||||
above as it needs to link with libmx also. */
|
||||
/* Machine dependent libraries. */
|
||||
|
||||
#ifndef LIB_SPEC
|
||||
#define LIB_SPEC "%{!static:-lSystem}"
|
||||
#endif
|
||||
|
||||
/* -dynamiclib implies -shared-libgcc just like -shared would on linux. */
|
||||
#define REAL_LIBGCC_SPEC \
|
||||
@ -1033,10 +1028,8 @@ void add_framework_path (char *);
|
||||
|
||||
#define TARGET_HAS_F_SETLKW
|
||||
|
||||
/* Darwin before 7.0 does not have C99 functions. */
|
||||
#ifndef TARGET_C99_FUNCTIONS
|
||||
#define TARGET_C99_FUNCTIONS 0
|
||||
#endif
|
||||
/* All new versions of Darwin have C99 functions. */
|
||||
#define TARGET_C99_FUNCTIONS
|
||||
|
||||
#define WINT_TYPE "int"
|
||||
|
||||
|
@ -19,10 +19,14 @@
|
||||
; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
; 02110-1301, USA.
|
||||
|
||||
mone-byte-bool
|
||||
Target RejectNegative Report Var(darwin_one_byte_bool)
|
||||
Set sizeof(bool) to 1
|
||||
|
||||
mfix-and-continue
|
||||
Target Report Var(darwin_fix_and_continue)
|
||||
Generate code suitable for fast turn around debugging
|
||||
|
||||
mmacosx-version-min=
|
||||
Target Joined Report Var(darwin_macosx_version_min)
|
||||
The earliest MacOS X version on which this program will run
|
||||
|
||||
mone-byte-bool
|
||||
Target RejectNegative Report Var(darwin_one_byte_bool)
|
||||
Set sizeof(bool) to 1
|
||||
|
@ -33,8 +33,7 @@ Boston, MA 02110-1301, USA. */
|
||||
{ \
|
||||
builtin_define ("__i386__"); \
|
||||
builtin_define ("__LITTLE_ENDIAN__"); \
|
||||
builtin_define ("__MACH__"); \
|
||||
builtin_define ("__APPLE__"); \
|
||||
darwin_cpp_builtins (pfile); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
@ -54,8 +54,7 @@
|
||||
if (TARGET_64BIT) builtin_define ("__ppc64__"); \
|
||||
builtin_define ("__POWERPC__"); \
|
||||
builtin_define ("__NATURAL_ALIGNMENT__"); \
|
||||
builtin_define ("__MACH__"); \
|
||||
builtin_define ("__APPLE__"); \
|
||||
darwin_cpp_builtins (pfile); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
@ -415,3 +414,10 @@ do { \
|
||||
|
||||
/* This is the reserved ivar address Objective-C. */
|
||||
#define OFFS_ASSIGNIVAR_FAST 0xFFFEFEC0
|
||||
|
||||
/* Old versions of Mac OS/Darwin don't have C99 functions available. */
|
||||
#undef TARGET_C99_FUNCTIONS
|
||||
#define TARGET_C99_FUNCTIONS \
|
||||
(TARGET_64BIT \
|
||||
|| (darwin_macosx_version_min \
|
||||
&& strverscmp (darwin_macosx_version_min, "10.3") >= 0))
|
||||
|
@ -19,11 +19,13 @@ along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Darwin 7.0 and above have C99 functions. */
|
||||
#define TARGET_C99_FUNCTIONS 1
|
||||
|
||||
/* Machine dependent libraries, include libmx when compiling on Darwin 7.0
|
||||
and above. */
|
||||
/* Machine dependent libraries. Include libmx when compiling for
|
||||
Darwin 7.0 and above, but before libSystem, since the functions are
|
||||
actually in libSystem but for 7.x compatibility we want them to be
|
||||
looked for in libmx first. Include libmx by default because otherwise
|
||||
libstdc++ isn't usable. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{!static:-lSystem -lmx}"
|
||||
#define LIB_SPEC "%{!static:\
|
||||
%:version-compare(!< 10.3 mmacosx-version-min= -lmx)\
|
||||
-lSystem}"
|
@ -19,16 +19,15 @@ along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Darwin 7.0 and above have C99 functions. */
|
||||
#define TARGET_C99_FUNCTIONS 1
|
||||
|
||||
/* Machine dependent libraries. Include libmx when compiling on
|
||||
Darwin 7.0 and above, but before libSystem, since the functions are
|
||||
actually in libSystem but for 7.x compatibility we want them to be
|
||||
looked for in libmx first. Include libSystemStubs when compiling
|
||||
on 8.0 and above and not 64-bit long double. */
|
||||
looked for in libmx first---but only do this if 7.x compatibility
|
||||
is a concern, which it's not in 64-bit mode. Include
|
||||
libSystemStubs when compiling on (not necessarily for) 8.0 and
|
||||
above and not 64-bit long double. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{!static:\
|
||||
%{!mlong-double-64:%{pg:-lSystemStubs_profile;:-lSystemStubs}} \
|
||||
-lmx -lSystem}"
|
||||
%{!m64:%:version-compare(>< 10.3 10.4 mmacosx-version-min= -lmx)} -lSystem}"
|
6
gcc/configure
vendored
6
gcc/configure
vendored
@ -11212,8 +11212,10 @@ CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
|
||||
|
||||
|
||||
|
||||
for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd strsignal \
|
||||
strstr errno snprintf vsnprintf vasprintf malloc realloc calloc \
|
||||
|
||||
for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \
|
||||
strsignal strstr strverscmp \
|
||||
errno snprintf vsnprintf vasprintf malloc realloc calloc \
|
||||
free basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
|
||||
do
|
||||
ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
|
||||
|
@ -1049,8 +1049,9 @@ AM_LANGINFO_CODESET
|
||||
# We will need to find libiberty.h and ansidecl.h
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
|
||||
gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd strsignal \
|
||||
strstr errno snprintf vsnprintf vasprintf malloc realloc calloc \
|
||||
gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
|
||||
strsignal strstr strverscmp \
|
||||
errno snprintf vsnprintf vasprintf malloc realloc calloc \
|
||||
free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[
|
||||
#include "ansidecl.h"
|
||||
#include "system.h"])
|
||||
|
@ -451,7 +451,8 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-single_module -static -sub_library -sub_umbrella @gol
|
||||
-twolevel_namespace -umbrella -undefined @gol
|
||||
-unexported_symbols_list -weak_reference_mismatches @gol
|
||||
-whatsloaded -F -gused -gfull -mone-byte-bool}
|
||||
-whatsloaded -F -gused -gfull -mmacosx-min-version=@var{version} @gol
|
||||
-mone-byte-bool}
|
||||
|
||||
@emph{DEC Alpha Options}
|
||||
@gccoptlist{-mno-fp-regs -msoft-float -malpha-as -mgas @gol
|
||||
@ -7668,6 +7669,14 @@ This is by default ON@.
|
||||
@opindex -gfull
|
||||
Emit debugging information for all symbols and types.
|
||||
|
||||
@item -mmacosx-version-min=@var{version}
|
||||
The earliest version of MacOS X that this executable will run on
|
||||
is @var{version}. Typical values of @var{version} include @code{10.1},
|
||||
@code{10.2}, and @code{10.3.9}.
|
||||
|
||||
The default for this option is to make choices that seem to be most
|
||||
useful.
|
||||
|
||||
@item -mone-byte-bool
|
||||
@opindex -mone-byte-bool
|
||||
Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
|
||||
|
125
gcc/gcc.c
125
gcc/gcc.c
@ -80,6 +80,7 @@ compilation is specified by a string called a "spec". */
|
||||
#if ! defined( SIGCHLD ) && defined( SIGCLD )
|
||||
# define SIGCHLD SIGCLD
|
||||
#endif
|
||||
#include "xregex.h"
|
||||
#include "obstack.h"
|
||||
#include "intl.h"
|
||||
#include "prefix.h"
|
||||
@ -349,6 +350,7 @@ static const char *convert_filename (const char *, int, int);
|
||||
static const char *if_exists_spec_function (int, const char **);
|
||||
static const char *if_exists_else_spec_function (int, const char **);
|
||||
static const char *replace_outfile_spec_function (int, const char **);
|
||||
static const char *version_compare_spec_function (int, const char **);
|
||||
|
||||
/* The Specs Language
|
||||
|
||||
@ -1577,6 +1579,7 @@ static const struct spec_function static_spec_functions[] =
|
||||
{ "if-exists", if_exists_spec_function },
|
||||
{ "if-exists-else", if_exists_else_spec_function },
|
||||
{ "replace-outfile", replace_outfile_spec_function },
|
||||
{ "version-compare", version_compare_spec_function },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -7573,8 +7576,9 @@ if_exists_else_spec_function (int argc, const char **argv)
|
||||
}
|
||||
|
||||
/* replace-outfile built-in spec function.
|
||||
This looks for the first argument in the outfiles array's name and replaces it
|
||||
with the second argument. */
|
||||
|
||||
This looks for the first argument in the outfiles array's name and
|
||||
replaces it with the second argument. */
|
||||
|
||||
static const char *
|
||||
replace_outfile_spec_function (int argc, const char **argv)
|
||||
@ -7592,3 +7596,120 @@ replace_outfile_spec_function (int argc, const char **argv)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Given two version numbers, compares the two numbers.
|
||||
A version number must match the regular expression
|
||||
([1-9][0-9]*|0)(\.([1-9][0-9]*|0))*
|
||||
*/
|
||||
static int
|
||||
compare_version_strings (const char *v1, const char *v2)
|
||||
{
|
||||
int rresult;
|
||||
regex_t r;
|
||||
|
||||
if (regcomp (&r, "^([1-9][0-9]*|0)(\\.([1-9][0-9]*|0))*$",
|
||||
REG_EXTENDED | REG_NOSUB) != 0)
|
||||
abort ();
|
||||
rresult = regexec (&r, v1, 0, NULL, 0);
|
||||
if (rresult == REG_NOMATCH)
|
||||
fatal ("invalid version number `%s'", v1);
|
||||
else if (rresult != 0)
|
||||
abort ();
|
||||
rresult = regexec (&r, v2, 0, NULL, 0);
|
||||
if (rresult == REG_NOMATCH)
|
||||
fatal ("invalid version number `%s'", v2);
|
||||
else if (rresult != 0)
|
||||
abort ();
|
||||
|
||||
return strverscmp (v1, v2);
|
||||
}
|
||||
|
||||
|
||||
/* version_compare built-in spec function.
|
||||
|
||||
This takes an argument of the following form:
|
||||
|
||||
<comparison-op> <arg1> [<arg2>] <switch> <result>
|
||||
|
||||
and produces "result" if the comparison evaluates to true,
|
||||
and nothing if it doesn't.
|
||||
|
||||
The supported <comparison-op> values are:
|
||||
|
||||
>= true if switch is a later (or same) version than arg1
|
||||
!> opposite of >=
|
||||
< true if switch is an earlier version than arg1
|
||||
!< opposite of <
|
||||
>< true if switch is arg1 or later, and earlier than arg2
|
||||
<> true if switch is earlier than arg1 or is arg2 or later
|
||||
|
||||
If the switch is not present, the condition is false unless
|
||||
the first character of the <comparison-op> is '!'.
|
||||
|
||||
For example,
|
||||
%:version-compare(>= 10.3 mmacosx-version-min= -lmx)
|
||||
adds -lmx if -mmacosx-version-min=10.3.9 was passed. */
|
||||
|
||||
static const char *
|
||||
version_compare_spec_function (int argc, const char **argv)
|
||||
{
|
||||
int comp1, comp2;
|
||||
size_t switch_len;
|
||||
const char *switch_value = NULL;
|
||||
int nargs = 1, i;
|
||||
bool result;
|
||||
|
||||
if (argc < 3)
|
||||
abort ();
|
||||
if (argv[0][0] == '\0')
|
||||
abort ();
|
||||
if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!')
|
||||
nargs = 2;
|
||||
if (argc != nargs + 3)
|
||||
abort ();
|
||||
|
||||
switch_len = strlen (argv[nargs + 1]);
|
||||
for (i = 0; i < n_switches; i++)
|
||||
if (!strncmp (switches[i].part1, argv[nargs + 1], switch_len)
|
||||
&& check_live_switch (i, switch_len))
|
||||
switch_value = switches[i].part1 + switch_len;
|
||||
|
||||
if (switch_value == NULL)
|
||||
comp1 = comp2 = -1;
|
||||
else
|
||||
{
|
||||
comp1 = compare_version_strings (switch_value, argv[1]);
|
||||
if (nargs == 2)
|
||||
comp2 = compare_version_strings (switch_value, argv[2]);
|
||||
else
|
||||
comp2 = -1; /* This value unused. */
|
||||
}
|
||||
|
||||
switch (argv[0][0] << 8 | argv[0][1])
|
||||
{
|
||||
case '>' << 8 | '=':
|
||||
result = comp1 >= 0;
|
||||
break;
|
||||
case '!' << 8 | '<':
|
||||
result = comp1 >= 0 || switch_value == NULL;
|
||||
break;
|
||||
case '<' << 8:
|
||||
result = comp1 < 0;
|
||||
break;
|
||||
case '!' << 8 | '>':
|
||||
result = comp1 < 0 || switch_value == NULL;
|
||||
break;
|
||||
case '>' << 8 | '<':
|
||||
result = comp1 >= 0 && comp2 < 0;
|
||||
break;
|
||||
case '<' << 8 | '>':
|
||||
result = comp1 < 0 || comp2 >= 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
if (! result)
|
||||
return NULL;
|
||||
|
||||
return argv[nargs + 2];
|
||||
}
|
||||
|
@ -1,3 +1,16 @@
|
||||
2005-07-07 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* gcc.dg/darwin-version-1.c: New.
|
||||
* gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3.
|
||||
* gcc.dg/builtins-20.c: Likewise.
|
||||
* gcc.dg/builtins-53.c: Likewise.
|
||||
* gcc.dg/torture/builtins-convert-1.c: Likewise.
|
||||
* gcc.dg/torture/builtins-convert-2.c: Likewise.
|
||||
* gcc.dg/torture/builtins-convert-3.c: Likewise.
|
||||
* gcc.dg/torture/builtins-power-1.c: Likewise.
|
||||
* gcc.dg/builtins-config.h: Complain if macosx-version-min not set
|
||||
on Darwin.
|
||||
|
||||
2005-07-07 Jeff Law <law@redhat.com>
|
||||
|
||||
* gcc.dg/tree-ssa/vrp17.c: Simplify. Remove dependency on
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
/* { dg-do link } */
|
||||
/* { dg-options "-O2 -ffast-math" } */
|
||||
/* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "builtins-config.h"
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
/* { dg-do link } */
|
||||
/* { dg-options "-O2 -ffast-math" } */
|
||||
/* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "builtins-config.h"
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -ffast-math" } */
|
||||
/* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "builtins-config.h"
|
||||
|
||||
|
@ -19,6 +19,15 @@
|
||||
/* FreeBSD before version 5 doesn't have the entire C99 runtime. */
|
||||
#elif defined(__netware__)
|
||||
/* NetWare doesn't have the entire C99 runtime. */
|
||||
#elif (defined(__APPLE__) \
|
||||
&& ! defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__))
|
||||
/* MacOS versions before 10.3 don't have many C99 functions.
|
||||
But, if you're including this file, you probably want to test the
|
||||
newer behaviour, so: */
|
||||
#error forgot to set -mmacosx-version-min.
|
||||
#elif (defined(__APPLE__) \
|
||||
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1030)
|
||||
/* MacOS versions before 10.3 don't have many C99 functions. */
|
||||
#else
|
||||
/* Newlib has the "f" variants of the math functions, but not the "l"
|
||||
variants. TARGET_C99_FUNCTIONS is only defined if all C99
|
||||
|
10
gcc/testsuite/gcc.dg/darwin-version-1.c
Normal file
10
gcc/testsuite/gcc.dg/darwin-version-1.c
Normal file
@ -0,0 +1,10 @@
|
||||
/* Basic test of the -mmacosx-version-min option. */
|
||||
|
||||
/* { dg-options "-mmacosx-version-min=10.1" } */
|
||||
/* { dg-do link { target *-*-darwin* } } */
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
/* { dg-do link } */
|
||||
/* { dg-options "-ffast-math" } */
|
||||
/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "../builtins-config.h"
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
/* { dg-do link } */
|
||||
/* { dg-options "-ffast-math" } */
|
||||
/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "../builtins-config.h"
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
/* { dg-do link } */
|
||||
/* { dg-options "-ffast-math" } */
|
||||
/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "../builtins-config.h"
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
/* { dg-do link } */
|
||||
/* { dg-options "-ffast-math" } */
|
||||
/* { dg-options "-ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */
|
||||
|
||||
#include "../builtins-config.h"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user