aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 483644284c3..0d0ffef141b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1016,16 +1016,20 @@ proper position among the other output files. */
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
- %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
+ %{s} %{t} %{u*} %{z} %{Z}\
+ %{!nostdlib:%{!nostartfiles:%{fupc:%:include(upc-crtbegin.spec)%(upc_crtbegin)}}}\
+ %{!nostdlib:%{!nostartfiles:%S}} \
%{static:} %{L*} %(mfwrap) %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
%:include(libgomp.spec)%(link_gomp)}\
%{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
+ %{fupc:%:include(libgupc.spec)%(link_upc)}\
%(mflib) " STACK_SPLIT_SPEC "\
%{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
%{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
+ %{!nostdlib:%{!nostartfiles:%{fupc:%:include(upc-crtend.spec)%(upc_crtend)}}}\
%{!nostdlib:%{!nostartfiles:%E}} %{T*} \n%(post_link) }}}}}}"
#endif
@@ -1061,6 +1065,9 @@ static const char *asm_final_spec = ASM_FINAL_SPEC;
static const char *link_spec = LINK_SPEC;
static const char *lib_spec = LIB_SPEC;
static const char *link_gomp_spec = "";
+static const char *upc_crtbegin_spec = "";
+static const char *link_upc_spec = "";
+static const char *upc_crtend_spec = "";
static const char *libgcc_spec = LIBGCC_SPEC;
static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
@@ -1134,6 +1141,9 @@ static const char *cc1_options =
%{fsyntax-only:-o %j} %{-param*}\
%{coverage:-fprofile-arcs -ftest-coverage}";
+static const char *upc_options =
+ "-fupc %{!fno-upc-pre-include:-include gcc-upc.h}";
+
static const char *asm_options =
"%{-target-help:%:print-asm-header()} "
#if HAVE_GNU_AS
@@ -1345,6 +1355,21 @@ static const struct compiler default_compilers[] =
as %(asm_debug) %(asm_options) %m.s %A }}}}"
#endif
, 0, 0, 0},
+ {".upc", "@upc", 0, 0, 0},
+ {"@upc",
+ /* Same as "@c" above, with the addition of %(upc_options). */
+ "%{E|M|MM:cc1 -E %(upc_options) %(cpp_options) %(cpp_debug_options)}\
+ %{!E:%{!M:%{!MM:\
+ %{traditional|ftraditional|traditional-cpp:\
+ %e UPC does not support traditional compilation}\
+ %{save-temps|no-integrated-cpp:\
+ cc1 -E %(upc_options) %(cpp_options)\
+ %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\
+ cc1 -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi}\
+ %(upc_options) %(cc1_options)}\
+ %{!save-temps:%{!no-integrated-cpp:\
+ cc1 %(cpp_unique_options) %(upc_options) %(cc1_options)}}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
#include "specs.h"
/* Mark end of table. */
@@ -1555,6 +1580,7 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("trad_capable_cpp", &trad_capable_cpp),
INIT_STATIC_SPEC ("cc1", &cc1_spec),
INIT_STATIC_SPEC ("cc1_options", &cc1_options),
+ INIT_STATIC_SPEC ("upc_options", &upc_options),
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
@@ -1562,6 +1588,9 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("link", &link_spec),
INIT_STATIC_SPEC ("lib", &lib_spec),
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
+ INIT_STATIC_SPEC ("upc_crtbegin", &upc_crtbegin_spec),
+ INIT_STATIC_SPEC ("link_upc", &link_upc_spec),
+ INIT_STATIC_SPEC ("upc_crtend", &upc_crtend_spec),
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
INIT_STATIC_SPEC ("startfile", &startfile_spec),
INIT_STATIC_SPEC ("cross_compile", &cross_compile),