summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-01-31 20:08:18 +0100
committerJakub Jelinek <jakub@redhat.com>2022-01-31 20:08:18 +0100
commit2cbe5dd54f15e88e0b42567319aa9c8e7bad7946 (patch)
treeb217e99a6c0f40be6b4c014ea522a082fcd96656
parent48d3191e7bd6245bd2df625731f1ad9207a26655 (diff)
downloadgcc-2cbe5dd54f15e88e0b42567319aa9c8e7bad7946.tar.gz
rs6000: Fix up build of non-glibc/aix/darwin powerpc* targets [PR104298]
As reported by Martin, while David has added OPTION_GLIBC define to aix and Iain to darwin, all the other non-linux targets now fail because rs6000.md macro isn't defined. One possibility is to define this macro in option-defaults.h which on rs6000 targets is included last, then we don't need to define it in aix/darwin headers and for targets using linux.h or linux64.h it will DTRT too. The other option is the first 2 hunks + changing the 3 if (!OPTION_GLIBC) FAIL; cases in rs6000.md to e.g. #ifdef OPTION_GLIBC if (!OPTION_GLIBC) #endif FAIL; or to: #ifdef OPTION_GLIBC if (!OPTION_GLIBC) #else if (true) #endif FAIL; (the latter case if Richi wants to push the -Wunreachable-code changes for GCC 13). 2022-01-31 Jakub Jelinek <jakub@redhat.com> PR target/104298 * config/rs6000/aix.h (OPTION_GLIBC): Remove. * config/rs6000/darwin.h (OPTION_GLIBC): Likewise. * config/rs6000/option-defaults.h (OPTION_GLIBC): Define to 0 if not already defined.
-rw-r--r--gcc/config/rs6000/aix.h1
-rw-r--r--gcc/config/rs6000/darwin.h2
-rw-r--r--gcc/config/rs6000/option-defaults.h6
3 files changed, 6 insertions, 3 deletions
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index eb7a0c09f72..ad3238bf09a 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -23,7 +23,6 @@
#define DEFAULT_ABI ABI_AIX
#undef TARGET_AIX
#define TARGET_AIX 1
-#define OPTION_GLIBC 0
/* Linux64.h wants to redefine TARGET_AIX based on -m64, but it can't be used
in the #if conditional in options-default.h, so provide another macro. */
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 210c60694cd..b5cef42610f 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -34,8 +34,6 @@
#endif
#endif
-#define OPTION_GLIBC 0
-
/* The object file format is Mach-O. */
#define TARGET_OBJECT_FORMAT OBJECT_MACHO
diff --git a/gcc/config/rs6000/option-defaults.h b/gcc/config/rs6000/option-defaults.h
index f03694e4b29..2123bfdd539 100644
--- a/gcc/config/rs6000/option-defaults.h
+++ b/gcc/config/rs6000/option-defaults.h
@@ -62,3 +62,9 @@
{"cpu_32", "%{" OPT_ARCH32 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"cpu_64", "%{" OPT_ARCH64 ":%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
+
+/* rs6000.md uses OPTION_GLIBC unconditionally, while it is defined only in
+ linux{,64}.h. Define fallback for other targets here. */
+#ifndef OPTION_GLIBC
+#define OPTION_GLIBC 0
+#endif