--- gcc/Makefile.in | 34 ++++++++++++++++++++++++++++++++- gcc/common.opt | 3 +++ gcc/config.gcc | 47 ++++++++++++++++++++++++++++++++++++++++++++++ gcc/configure | 41 ++++++++++++++++++++++++++++++++++------ gcc/configure.ac | 14 ++++++++++++++ gcc/doc/tm.texi | 18 ++++++++++++++++++ gcc/doc/tm.texi.in | 9 +++++++++ gcc/dwarf2out.cc | 6 ++++++ gcc/gcc.cc | 2 ++ gcc/genhooks.cc | 1 + 10 files changed, 168 insertions(+), 7 deletions(-)
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 2565870b812..2b4ca443833 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -615,6 +615,8 @@ tm_d_file_list=@tm_d_file_list@ tm_d_include_list=@tm_d_include_list@ tm_rust_file_list=@tm_rust_file_list@ tm_rust_include_list=@tm_rust_include_list@ +tm_algol68_file_list=@tm_algol68_file_list@ +tm_algol68_include_list=@tm_algol68_include_list@ build_xm_file_list=@build_xm_file_list@ build_xm_include_list=@build_xm_include_list@ build_xm_defines=@build_xm_defines@ @@ -917,6 +919,7 @@ TCONFIG_H = tconfig.h $(xm_file_list) TM_P_H = tm_p.h $(tm_p_file_list) $(TREE_H) TM_D_H = tm_d.h $(tm_d_file_list) TM_RUST_H = tm_rust.h $(tm_rust_file_list) +TM_ALGOL68_H = tm_algol68.h $(tm_algol68_file_list) GTM_H = tm.h $(tm_file_list) insn-constants.h TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H) @@ -976,11 +979,13 @@ C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h D_TARGET_DEF = d/d-target.def target-hooks-macros.h RUST_TARGET_DEF = rust/rust-target.def target-hooks-macros.h +ALGOL68_TARGET_DEF = algol68/algol68-target.def target-hooks-macros.h TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF) COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF) D_TARGET_H = d/d-target.h $(D_TARGET_DEF) RUST_TARGET_H = rust/rust-target.h $(RUST_TARGET_DEF) +ALGOL68_TARGET_H = algol68/algol68-target.h $(ALGOL68_TARGET_DEF) MACHMODE_H = machmode.h mode-classes.def HOOKS_H = hooks.h HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) @@ -1300,6 +1305,9 @@ FORTRAN_TARGET_OBJS=@fortran_target_objs@ # Target specific, Rust specific object file RUST_TARGET_OBJS=@rust_target_objs@ +# Target specific, Algol68 specific object file +ALGOL68_TARGET_OBJS=@algol68_target_objs@ + # Object files for gcc many-languages driver. GCC_OBJS = gcc.o gcc-main.o ggc-none.o gcc-urlifier.o options-urls.o @@ -2072,6 +2080,7 @@ tm.h: cs-tm.h ; @true tm_p.h: cs-tm_p.h ; @true tm_d.h: cs-tm_d.h ; @true tm_rust.h: cs-tm_rust.h ; @true +tm_algol68.h: cs-tm_algol68.h; @true cs-config.h: Makefile TARGET_CPU_DEFAULT="" \ @@ -2111,6 +2120,11 @@ cs-tm_rust.h: Makefile HEADERS="$(tm_rust_include_list)" DEFINES="" \ $(SHELL) $(srcdir)/mkconfig.sh tm_rust.h +cs-tm_algol68.h: Makefile + TARGET_CPU_DEFAULT="" \ + HEADERS="$(tm_algol68_include_list)" DEFINES="" \ + $(SHELL) $(srcdir)/mkconfig.sh tm_algol68.h + # Don't automatically run autoconf, since configure.ac might be accidentally # newer than configure. Also, this writes into the source directory which # might be on a read-only file system. If configured for maintainer mode @@ -2584,6 +2598,12 @@ default-rust.o: config/default-rust.cc $(COMPILE) $< $(POSTCOMPILE) +# Files used by the Algol68 language front end. + +default-algol68.o: config/default-algol68.cc + $(COMPILE) $< + $(POSTCOMPILE) + # Language-independent files. DRIVER_DEFINES = \ @@ -2930,6 +2950,15 @@ s-rust-target-hooks-def-h: build/genhooks$(build_exeext) rust/rust-target-hooks-def.h $(STAMP) s-rust-target-hooks-def-h +algol68/algol68-target-hooks-def.h: s-algol68-target-hooks-def-h; @true + +s-algol68-target-hooks-def-h: build/genhooks$(build_exeext) + $(RUN_GEN) build/genhooks$(build_exeext) "Algol68 Target Hook" \ + > tmp-algol68-target-hooks-def.h + $(SHELL) $(srcdir)/../move-if-change tmp-algol68-target-hooks-def.h \ + algol68/algol68-target-hooks-def.h + $(STAMP) s-algol68-target-hooks-def-h + # check if someone mistakenly only changed tm.texi. # We use a different pathname here to avoid a circular dependency. s-tm-texi: $(srcdir)/doc/../doc/tm.texi @@ -2955,6 +2984,7 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \ || test $(srcdir)/doc/tm.texi -nt $(srcdir)/d/d-target.def \ || test $(srcdir)/doc/tm.texi -nt $(srcdir)/rust/rust-target.def \ + || test $(srcdir)/doc/tm.texi -nt $(srcdir)/algol68/algol68-target.def \ ); then \ echo >&2 ; \ echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \ @@ -3135,6 +3165,7 @@ generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \ gimple-match-auto.h generic-match-auto.h \ c-family/c-target-hooks-def.h d/d-target-hooks-def.h \ $(TM_RUST_H) rust/rust-target-hooks-def.h \ + $(TM_ALGOL68_H) algol68/algol68-target-hooks-def.h \ case-cfn-macros.h \ cfn-operators.pd omp-device-properties.h @@ -3269,7 +3300,8 @@ build/genrecog.o : genrecog.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \ $(HASH_TABLE_H) inchash.h build/genhooks.o : genhooks.cc $(TARGET_DEF) $(C_TARGET_DEF) \ - $(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(BCONFIG_H) \ + $(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(ALGOL68_TARGET_DEF) \ + $(BCONFIG_H) \ $(SYSTEM_H) errors.h build/genmddump.o : genmddump.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) diff --git a/gcc/common.opt b/gcc/common.opt index 1b72826d44b..624ea531ff1 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3882,6 +3882,9 @@ Driver Joined static Driver +static-libgac +Driver + static-libgcc Driver diff --git a/gcc/config.gcc b/gcc/config.gcc index 262b38cf0e3..bf5f66c09e4 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -93,6 +93,9 @@ # tm_rust_file list of headers with definitions of target hook # macros for the Rust compiler. # +# tm_algol68_file list of headers with definitions of target hook +# macros for the Algol68 compiler. +# # out_file The name of the machine description C support # file, if different from "$cpu_type/$cpu_type.c". # @@ -155,6 +158,9 @@ # rust_target_objs List of extra target-dependent objects that be # linked into the Rust compiler only. # +# algol68_target_objs List of extra target-dependent objects that be +# linked into the Algol68 compiler only. +# # target_gtfiles List of extra source files with type information. # # xm_defines List of macros to define when compiling for the @@ -210,6 +216,10 @@ # # target_has_targetrustm Set to yes or no depending on whether the target # has its own definition of targetrustm. +# +# target_has_targetalgol68m +# Set to yes or no depending on whether the target +# has its own deinition of targetdm. out_file= common_out_file= @@ -228,10 +238,12 @@ cxx_target_objs= d_target_objs= fortran_target_objs= rust_target_objs= +algol68_target_objs= target_has_targetcm=no target_has_targetm_common=yes target_has_targetdm=no target_has_targetrustm=no +target_has_targetalgol68m=no tm_defines= xm_defines= # Set this to force installation and use of collect2. @@ -622,6 +634,16 @@ then rust_target_objs="${rust_target_objs} ${cpu_type}-rust.o" fi +tm_algol68_file= +if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-algol68.h +then + tm_algol68_file="${cpu_type}/${cpu_type}-algol68.h" +fi +if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-algol68.cc +then + algol68_target_objs="${algol68_target_objs} ${cpu_type}-algol68.o" +fi + extra_modes= if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def then @@ -791,9 +813,11 @@ case ${target} in d_target_objs="${d_target_objs} darwin-d.o" fortran_target_objs="darwin-f.o" rust_target_objs="${rust_target_objs} darwin-rust.o" + algol68_target_objs="${algol68_target_objs} darwin-algol68.o" target_has_targetcm=yes target_has_targetdm=yes target_has_targetrustm=yes + target_has_targetalgol68m=no extra_objs="${extra_objs} darwin.o" extra_gcc_objs="darwin-driver.o" default_use_cxa_atexit=yes @@ -826,6 +850,8 @@ case ${target} in target_has_targetdm=yes rust_target_objs="${rust_target_objs} dragonfly-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} dragonfly-algol68.o" + target_has_targetalgol68m=yes ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later @@ -879,12 +905,16 @@ case ${target} in target_has_targetdm=yes rust_target_objs="${rust_target_objs} freebsd-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} freebsd-algol68.o" + target_has_targetalgol68m=yes ;; *-*-fuchsia*) native_system_header_dir=/include tmake_file="t-fuchsia" rust_target_objs="${rust_target_objs} fuchsia-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} fuchsia-algol68.o" + target_has_targetalgol68m=yes ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) extra_options="$extra_options gnu-user.opt" @@ -957,6 +987,8 @@ case ${target} in target_has_targetdm=yes rust_target_objs="${rust_target_objs} linux-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} linux-algol68.o" + target_has_targetalgol68m=yes ;; *-*-kfreebsd*-gnu) d_target_objs="${d_target_objs} kfreebsd-d.o" @@ -993,6 +1025,8 @@ case ${target} in esac rust_target_objs="${rust_target_objs} netbsd-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} netbsd-algol68.o" + target_has_targetalgol68m=yes ;; *-*-openbsd*) tmake_file="t-openbsd" @@ -1010,6 +1044,8 @@ case ${target} in target_has_targetdm=yes rust_target_objs="${rust_target_objs} openbsd-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} openbsd-algol68.o" + target_has_targetalgol68m=yes ;; *-*-phoenix*) gas=yes @@ -1072,6 +1108,8 @@ case ${target} in target_has_targetdm=yes rust_target_objs="${rust_target_objs} sol2-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} sol2-algol68.o" + target_has_targetalgol68m=yes ;; *-*-*vms*) extra_options="${extra_options} vms/vms.opt" @@ -1107,6 +1145,9 @@ case ${target} in rust_target_objs="${rust_target_objs} vxworks-rust.o" target_has_targetrustm=yes + algol68_target_objs="${algol68_target_objs} vxworks-algol68.o" + target_has_targetalgol68m=yes + extra_gcc_objs="vxworks-driver.o" # This private header exposes a consistent interface for checks on @@ -2233,6 +2274,8 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) target_has_targetdm="yes" rust_target_objs="${rust_target_objs} winnt-rust.o" target_has_targetrustm="yes" + algol68_target_objs="${algol68_target_objs} winnt-algol68.o" + target_has_targetalgol68m=yes case ${target} in x86_64-*-* | *-w64-*) need_64bit_isa=yes @@ -3703,6 +3746,10 @@ if [ "$target_has_targetrustm" = "no" ]; then rust_target_objs="$rust_target_objs default-rust.o" fi +if [ "$target_has_targetalgol68" = "no" ]; then + algol68_target_objs="$algol68_target_objs default-algol68.o" +fi + # Support for --with-cpu and related options (and a few unrelated options, # too). case ${with_cpu} in diff --git a/gcc/configure.ac b/gcc/configure.ac index 5a178e056ef..66e6255ab1b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2449,6 +2449,17 @@ for f in $tm_rust_file; do esac done +tm_algol68_file_list= +tm_algol68_include_list= +for f in $tm_algol68_file; do + case $f in + * ) + tm_algol68_file_list="${tm_algol68_file_list} \$(srcdir)/config/$f" + tm_algol68_include_list="${tm_algol68_include_list} config/$f" + ;; + esac +done + xm_file_list= xm_include_list= for f in $xm_file; do @@ -7558,6 +7569,8 @@ AC_SUBST(tm_d_file_list) AC_SUBST(tm_d_include_list) AC_SUBST(tm_rust_file_list) AC_SUBST(tm_rust_include_list) +AC_SUBST(tm_algol68_file_list) +AC_SUBST(tm_algol68_include_list) AC_SUBST(xm_file_list) AC_SUBST(xm_include_list) AC_SUBST(xm_defines) @@ -7567,6 +7580,7 @@ AC_SUBST(cxx_target_objs) AC_SUBST(fortran_target_objs) AC_SUBST(d_target_objs) AC_SUBST(rust_target_objs) +AC_SUBST(algol68_target_objs) AC_SUBST(target_cpu_default) AC_SUBST_FILE(language_hooks) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index d7170f45206..be999b0e582 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -54,6 +54,7 @@ through the macros defined in the @file{.h} file. * C++ ABI:: Controlling C++ ABI changes. * D Language and ABI:: Controlling D ABI changes. * Rust Language and ABI:: Controlling Rust ABI changes. +* ALGOL 68 Language and ABI:: Controlling ALGOL 68 ABI changes. * Named Address Spaces:: Adding support for named address spaces * Misc:: Everything else. @end menu @@ -11283,6 +11284,23 @@ Similar to @code{TARGET_RUST_CPU_INFO}, but is used for configuration info relating to the target operating system. @end deftypefn +@node ALGOL 68 Language and ABI +@section ALGOL 68 ABI parameters +@cindex parameters, ALGOL 68 abi + +@deftypefn {Algol68 Target Hook} void TARGET_ALGOL68_CPU_INFO (void) +Declare all environmental CPU info and features relating to the target CPU +using the function @code{algol68_add_target_info}, which takes a string +representing the feature key and a string representing the feature value. +Configuration pairs predefined by this hook apply to all files that are being +compiled. +@end deftypefn + +@deftypefn {Algol68 Target Hook} void TARGET_ALGOL68_OS_INFO (void) +Similar to @code{TARGET_ALGOL68_CPU_INFO}, but is used for configuration info +relating to the target operating system. +@end deftypefn + @node Named Address Spaces @section Adding support for named address spaces @cindex named address spaces diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index f6657f9df1d..3fa35eb4e8c 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -54,6 +54,7 @@ through the macros defined in the @file{.h} file. * C++ ABI:: Controlling C++ ABI changes. * D Language and ABI:: Controlling D ABI changes. * Rust Language and ABI:: Controlling Rust ABI changes. +* ALGOL 68 Language and ABI:: Controlling ALGOL 68 ABI changes. * Named Address Spaces:: Adding support for named address spaces * Misc:: Everything else. @end menu @@ -7274,6 +7275,14 @@ floating-point support; they are not included in this mechanism. @hook TARGET_RUST_OS_INFO +@node ALGOL 68 Language and ABI +@section ALGOL 68 ABI parameters +@cindex parameters, ALGOL 68 abi + +@hook TARGET_ALGOL68_CPU_INFO + +@hook TARGET_ALGOL68_OS_INFO + @node Named Address Spaces @section Adding support for named address spaces @cindex named address spaces diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 1ee2ee57821..5a8d6d2211f 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -25432,6 +25432,12 @@ gen_compile_unit_die (const char *filename) else if (strcmp (language_string, "GNU Rust") == 0) language = DW_LANG_Rust; } + else if (!dwarf_strict) + { + /* XXX DW_LANG_Algol68 will be defined in DWARF 6? */ + if (strcmp (language_string, "GNU Algol68") == 0) + language = DW_LANG_Algol68; + } } /* Use a degraded Fortran setting in strict DWARF2 so is_fortran works. */ else if (startswith (language_string, "GNU Fortran")) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 92c92996401..8560a786ab9 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -4654,11 +4654,13 @@ driver_handle_option (struct gcc_options *opts, case OPT_static_libgfortran: case OPT_static_libquadmath: case OPT_static_libphobos: + case OPT_static_libgac: case OPT_static_libgm2: case OPT_static_libstdc__: /* These are always valid; gcc.cc itself understands the first two gfortranspec.cc understands -static-libgfortran, libgfortran.spec handles -static-libquadmath, + a68spec.cc understands -static-libgac, d-spec.cc understands -static-libphobos, gm2spec.cc understands -static-libgm2, and g++spec.cc understands -static-libstdc++. */ diff --git a/gcc/genhooks.cc b/gcc/genhooks.cc index 4de7f361335..16c8b35d549 100644 --- a/gcc/genhooks.cc +++ b/gcc/genhooks.cc @@ -36,6 +36,7 @@ static struct hook_desc hook_array[] = { #include "common/common-target.def" #include "d/d-target.def" #include "rust/rust-target.def" +#include "algol68/algol68-target.def" #undef DEFHOOK }; -- 2.30.2