[PATCH] Darwin 7.0 and above having C99 functions
Andrew Pinski
pinskia@physics.uc.edu
Fri Apr 23 13:42:00 GMT 2004
On Mar 4, 2004, at 15:55, Mike Stump wrote:
> The patch looks obvious enough to me...
Here is the updated version which also does the same
thing for MATH_LIBRARY which is needed for g++ and gfortran
as they implicitly use the C99 math functions. I will
also look into how to stop libstdc++'s needing libmath
on Darwin 7.x.
OK? Bootstrapped on powerpc-apple-darwin7.3.0 with no regressions.
Also bootstrapped on powerpc-apple-darwin6.8 with no regressions either.
I bootstrapped the tree-ssa so that I could see if no target independent
failures on gfortran and I do not.
ChangeLog:
* config/darwin7.h: New file.
* config.gcc (*-*-darwin*): Add darwin7.h if the
version is greater than 6.
* config/darwin.h (TARGET_C99_FUNCTIONS): Define.
(MATH_LIBRARY): Wrap in ifdefs.
Patch:
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.215.2.54
diff -u -p -r1.215.2.54 config.gcc
--- config.gcc 13 Apr 2004 22:33:18 -0000 1.215.2.54
+++ config.gcc 23 Apr 2004 13:35:02 -0000
@@ -331,6 +331,10 @@ esac
# Common parts for widely ported systems.
case ${target} in
*-*-darwin*)
+ case ${target} in
+ *-darwin[0-6]*) ;;
+ *) tm_file="${tm_file} darwin7.h" ;;
+ esac
tm_file="${tm_file} darwin.h"
tm_p_file="${tm_p_file} darwin-protos.h"
tmake_file="t-darwin t-slibgcc-darwin"
Index: config/darwin7.h
===================================================================
RCS file: config/darwin7.h
diff -N config/darwin7.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ config/darwin7.h 23 Apr 2004 13:35:02 -0000
@@ -0,0 +1,5 @@
+#undef TARGET_C99_FUNCTIONS
+#define TARGET_C99_FUNCTIONS 1
+
+#undef MATH_LIBRARY
+#define MATH_LIBRARY "-lmx"
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.30.2.31
diff -u -p -r1.30.2.31 darwin.h
--- config/darwin.h 13 Apr 2004 22:33:48 -0000 1.30.2.31
+++ config/darwin.h 23 Apr 2004 13:35:02 -0000
@@ -41,9 +41,11 @@ Boston, MA 02111-1307, USA. */
/* Suppress g++ attempt to link in the math library automatically.
(Some Darwin versions have a libm, but they seem to cause problems
- for C++ executables.) */
-
+ for C++ executables.) This is needs to be -lmx for Darwin 7.0 and
+ above. */
+#ifndef MATH_LIBRARY
#define MATH_LIBRARY ""
+#endif
/* We have atexit. */
@@ -907,5 +909,11 @@ void add_framework_path (char *);
#define TARGET_OPTF add_framework_path
#define TARGET_HAS_F_SETLKW
+
+/* Darwin before 7.0 does not have C99 functions. */
+#ifndef TARGET_C99_FUNCTIONS
+#define TARGET_C99_FUNCTIONS 0
+#endif
+
#endif /* CONFIG_DARWIN_H */
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: temp.diff.text
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040423/1ac1d7c1/attachment.text>
More information about the Gcc-patches
mailing list