On Sat, 26 Oct 2024 13:41:32 -0400 "James K. Lowden" <jklow...@schemamania.org> wrote:
Below is a revised patch set incorporating recent feedback. Changes: * 2 patches: creation of gcc/cobo/ChangeLog now precedes "patch #1", the metafile patch * dead code (#if 0) removed * One new file included: changes to gcc/dwarf2out.cc * directory names stripped from the ChangeLog summary --jkl [snip] >From ccb8a64c97461d792fdc39db249980a9ecb63b4bbld.patch 4 Oct 2024 12:01:22 >-0400 From: "James K. Lowden" <jklow...@symas.com> Date: Fri 01 Nov 2024 01:50:33 PM EDT Subject: [PATCH] Add 'cobol' to 10 files ChangeLog * Makefile.def: Add libgcobol module and cobol language. * configure: Regenerated * configure.ac: Add libgcobol module and cobol language. gcc/ChangeLog * common.opt: Add libgcobol module and cobol language. * dwarf2out.cc: Add libgcobol module and cobol language gcc/cobol/ChangeLog * LICENSE: Add LICENSE * Make-lang.in: Add Make-lang.in * config-lang.in: Add config-lang.in * lang.opt: Add lang.opt * lang.opt.urls: Add lang.opt.urls --- Makefile.def | ++++++- configure | ++++++++++++++-- configure.ac | +- gcc/cobol/LICENSE | +++++++++++++++++++++++++++++- gcc/cobol/Make-lang.in | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- gcc/cobol/config-lang.in | +++++++++++- gcc/cobol/lang.opt | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- gcc/cobol/lang.opt.urls | +++++++++++++++++++++++++++++- gcc/common.opt | ++++- gcc/dwarf2out.cc | +++++ 10 files changed, 491 insertions(+), 11 deletions(-) diff --git a/Makefile.def b/Makefile.def index 19954e7d731..1192e852c7a 100644 --- a/Makefile.def +++ b/Makefile.def @@ -209,6 +209,7 @@ target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; }; target_modules = { module= libitm; lib_path=.libs; }; target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; }; target_modules = { module= libgrust; }; +target_modules = { module= libgcobol; }; // These are (some of) the make targets to be done in each subdirectory. // Not all; these are the ones which don't have special options. @@ -324,6 +325,7 @@ flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; }; flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; }; flags_to_pass = { flag= DSYMUTIL_FOR_TARGET ; }; flags_to_pass = { flag= FLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= GCOBOL_FOR_TARGET ; }; flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; }; flags_to_pass = { flag= GOC_FOR_TARGET ; }; flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; }; @@ -655,6 +657,7 @@ lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; }; // built newlib on some targets (e.g. Cygwin). It still needs // a dependency on libgcc for native targets to configure. lang_env_dependencies = { module=libiberty; no_c=true; }; +lang_env_dependencies = { module=libgcobol; cxx=true; }; dependencies = { module=configure-target-fastjar; on=configure-target-zlib; }; dependencies = { module=all-target-fastjar; on=all-target-zlib; }; @@ -690,6 +693,7 @@ dependencies = { module=install-target-libvtv; on=install-target-libgcc; }; dependencies = { module=install-target-libitm; on=install-target-libgcc; }; dependencies = { module=install-target-libobjc; on=install-target-libgcc; }; dependencies = { module=install-target-libstdc++-v3; on=install-target-libgcc; }; +dependencies = { module=install-target-libgcobol; on=install-target-libstdc++-v3; }; // Target modules in the 'src' repository. lang_env_dependencies = { module=libtermcap; }; @@ -727,6 +731,8 @@ languages = { language=d; gcc-check-target=check-d; lib-check-target=check-target-libphobos; }; languages = { language=jit; gcc-check-target=check-jit; }; languages = { language=rust; gcc-check-target=check-rust; }; +languages = { language=cobol; gcc-check-target=check-cobol; + lib-check-target=check-target-libgcobol; }; // Toplevel bootstrap bootstrap_stage = { id=1 ; }; diff --git a/configure b/configure index 51bf1d1add1..2a8f0cadc0e 100755 --- a/configure +++ b/configure @@ -775,6 +775,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -949,6 +950,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1201,6 +1203,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1338,7 +1349,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1498,6 +1509,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2859,6 +2871,7 @@ target_libraries="target-libgcc \ target-libgfortran \ target-libffi \ target-libobjc \ + target-libgcobol \ target-libada \ target-libgm2 \ target-libgo \ diff --git a/configure.ac b/configure.ac index 20457005e29..7ae3b5128ae 100644 --- a/configure.ac +++ b/configure.ac @@ -161,6 +161,7 @@ target_libraries="target-libgcc \ target-libgfortran \ target-libffi \ target-libobjc \ + target-libgcobol \ target-libada \ target-libgm2 \ target-libgo \ diff --git a/gcc/cobol/LICENSE b/gcc/cobol/LICENSE new file mode 100644 index 00000000000..6cb64d44790 --- /dev/null +++ b/gcc/cobol/LICENSE @@ -0,0 +1,29 @@ +######################################################################### +# +# Copyright (c) 2019-2022 Symas Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of the Symas Corporation nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in new file mode 100644 index 00000000000..b8df8146674 --- /dev/null +++ b/gcc/cobol/Make-lang.in @@ -0,0 +1,248 @@ +# Top level -*- makefile -*- fragment for Cobol +# Copyright (C) 2016 Free Software Foundation, Inc. + +# This file is part of GCC. + +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# This file provides the language dependent support in the main Makefile. +# Each language makefile fragment must provide the following targets: +# +# foo.all.cross, foo.start.encap, foo.rest.encap, +# foo.install-common, foo.install-man, foo.install-info, foo.install-pdf, +# foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall, +# foo.mostlyclean, foo.clean, foo.distclean, +# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 +# +# where `foo' is the name of the language. +# +# It should also provide rules for: +# +# - making any compiler driver (eg: g++) +# - the compiler proper (eg: cc1plus) +# - define the names for selecting the language in LANGUAGES. + +gcobol_INSTALL_NAME := $(shell echo gcobol|sed '$(program_transform_name)') +gcobol_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobol|sed '$(program_transform_name)') + +cobol: cobol1$(exeext) + +# +# The src<foo> targets are executed if +# ?--enable-generated-files-in-srcdir? was specified as a configure +# option. +# +# srcextra copies generated dependencies into the source +# directory. This is used for files such as Flex/Bison output: files +# that are not version-controlled but should be included in any +# release tarballs. +# +# Although versioned snapshots require Flex to be installed, they do +# not require Bison. Release tarballs always include Flex/Bison +# output, and do not require those tools to be installed. +# +cobol.srcextra: cobol/scan.c cobol/parse.c + -cp -p $^ $(srcdir) + +cobol.srcinfo: +cobol.srcman: + +.PHONY: cobol + +BINCLUDE ?= ./gcc + +# +# At this point, as of 2022-10-21, CPPFLAGS is an empty string and can be +# altered. CFLAGS and CXXFLAGS are being established upstream, and thus +# cannot, at this point, be changed. +# + +CPPFLAGS = \ + -std=c++17 \ + $(MAX_ERRORS) \ + -Iinclude \ + -I$(BINCLUDE) \ + -Wno-cpp \ + -Wno-missing-field-initializers \ + -DEXEC_LIB=\"$(DESTDIR)$(libdir)\" + $(END) + +YACC = bison +YFLAGS = -Werror -Wmidrule-values -Wno-yacc \ + --debug --token-table --verbose + +LEX = flex +LFLAGS = -d -Ca + +# +# These are the object files for creating the cobol1.exe compiler: +# + +cobol_one_OBJS = \ + cobol/cdf.o \ + cobol/cdf-copy.o \ + cobol/cobol1.o \ + cobol/convert.o \ + cobol/except.o \ + cobol/genutil.o \ + cobol/genapi.o \ + cobol/genmath.o \ + cobol/gengen.o \ + cobol/lexio.o \ + cobol/parse.o \ + cobol/scan.o \ + cobol/structs.o \ + cobol/symbols.o \ + cobol/symfind.o \ + cobol/util.o \ + cobol/valconv.o \ + cobol/charmaps.o \ + $(END) + +# cobol/charutf8.o \ + +# +# These are the object files for creating the gcobol.exe "driver" +# +GCOBOL_D_OBJS = $(GCC_OBJS) cobol/gcobolspec.o + +# +# These get combined to provide a dependency relationship that ensures all +# of the "generated-files" are generated before we need them. See the root +# Makefile.in code that looks like this: +# ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) +# + +cobol_OBJS = \ + $(cobol_one_OBJS) \ + cobol/gcobolspec.o \ + $(END) + +# +# Frankly, I can't figure out what this does: +# + +CFLAGS-cobol/gcobolspec.o += $(DRIVER_DEFINES) + +# +# This controls the build of the gcobol.exe "driver" +# + +gcobol$(exeext): \ + $(GCOBOL_D_OBJS) \ + $(EXTRA_GCC_OBJS) \ + libcommon-target.a \ + $(LIBDEPS) + +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ + $(GCOBOL_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ + $(EXTRA_GCC_LIBS) $(LIBS) + +# +# These control the build of the cobol1.exe source-to-GENERIC converter +# + +# First, files needed for parsing: + +cobol/parse.c: cobol/parse.y cobol/genapi.h cobol/parse_ante.h + $(YACC) -o $@ $(YFLAGS) \ + --defines=cobol/parse.h \ + --report-file=cobol/parser.out $< + +cobol/cdf.c: cobol/cdf.y cobol/genapi.h + $(YACC) -o $@ $(YFLAGS) \ + --defines=cobol/cdf.h --report-file=cobol/cdf.out $< + +cobol/scan.c: cobol/scan.l cobol/scan_ante.h cobol/scan_post.h + $(LEX) -o$@ $(LFLAGS) $< + +cobol/scan.o: cobol/parse.c # cobol/parse.h # parse.h gets built along with parse.c + +# And the cobol1.exe front end + +cobol1$(exeext): $(cobol_one_OBJS) $(BACKEND) $(LIBDEPS) attribs.o + +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) attribs.o -o $@ \ + $(cobol_one_OBJS) $(BACKEND) $(LIBS) $(BACKENDLIBS) + +## Other dependencies +# mkdep cobol/*.cc; grep -E '^[[:alnum:]_][.]o|cobol/' .depend | +# awk '{gsub(/[/]usr[^ \n]+ ?/, ""); gsub(/cobol[^ ]+[.]cc/, ""); } 1' \ +# > /tmp/depends && rm .depend + +cdf-copy.o: cobol/copybook.h +symbols.o: cobol/genapi.h cobol/symbols.h cobol/inspect.h cobol/io.h + +# FIXME +cobol.all.cross: + +cobol.start.encap: gcobol$(exeext) + +cobol.rest.encap: + +cobol.install-common: installdirs + $(INSTALL_PROGRAM) -v gcobol$(exeext) \ + $(DESTDIR)$(bindir)/$(gcobol_INSTALL_NAME)$(exeext) + $(INSTALL_PROGRAM) -v $(srcdir)/cobol/gcobc $(DESTDIR)$(bindir)/ + $(INSTALL_DATA) -v $(srcdir)/cobol/udf/* $(udfdir)/ + +cobol.install-man: installdirs + $(INSTALL_DATA) -v $(srcdir)/cobol/gcobol.1 $(DESTDIR)$(man1dir)/ + $(INSTALL_DATA) -v $(srcdir)/cobol/gcobol.3 $(DESTDIR)$(man3dir)/ + +cobol.install-info: + +cobol.install-pdf: + +cobol.install-plugin: + +cobol.install-html: + +cobol.info: + +cobol.dvi: + +cobol.pdf: + +cobol.html: + +cobol.uninstall: + -rm -f gcobol$(exeext) cobol1$(exeext) + -rm -f $(cobol_OBJS) + +cobol.man: + +cobol.mostlyclean: + +cobol.clean: + rm -fr cobol1 cobol/* ../*/libgcobol/* + +cobol.distclean: + +cobol.maintainer-clean: + +# The main makefile has already created stage?/cobol. +cobol.stage1: stage1-start + -mv cobol/*$(objext) stage1/cobol +cobol.stage2: stage2-start + -mv cobol/*$(objext) stage2/cobol +cobol.stage3: stage3-start + -mv cobol/*$(objext) stage3/cobol +cobol.stage4: stage4-start + -mv cobol/*$(objext) stage4/cobol +cobol.stageprofile: stageprofile-start + -mv cobol/*$(objext) stageprofile/cobol +cobol.stagefeedback: stagefeedback-start + -mv cobol/*$(objext) stagefeedback/cobol + +selftest-cobol: diff --git a/gcc/cobol/config-lang.in b/gcc/cobol/config-lang.in new file mode 100644 index 00000000000..ca4714998a0 --- /dev/null +++ b/gcc/cobol/config-lang.in @@ -0,0 +1,11 @@ +language="cobol" + +compilers="cobol1\$(exeext)" + +target_libs="libgcobol.a" + +# The cobol FE is written in C++ +lang_requires_boot_languages=c++ + +# Do not build by default +build_by_default="no" diff --git a/gcc/cobol/lang.opt b/gcc/cobol/lang.opt new file mode 100644 index 00000000000..3917bdb3182 --- /dev/null +++ b/gcc/cobol/lang.opt @@ -0,0 +1,144 @@ +; lang.opt -- Options for the gcc Cobol front end. + +; Copyright (C) 2009-2020 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; <http://www.gnu.org/licenses/>. + +; See the GCC internals manual for a description of this file's format. + +; Please try to keep this file in ASCII collating order. + +Language +Cobol + +D +Cobol Joined Separate +; Documented in c.opt + +E +Cobol +; Documented in c.opt + +I +Cobol Joined Separate +;; -I <dir> Add copybook search directory +; Documented in c.opt + +dialect +Cobol Joined Separate Enum(dialect_type) EnumBitSet Var(cobol_dialect) +Accept COBOL constructs used by non-ISO compilers + +Enum +Name(dialect_type) Type(int) UnknownError(Unrecognized COBOL dialect name: %qs) + +EnumValue +Enum(dialect_type) String(gcc) Value(0x04) Canonical + +EnumValue +Enum(dialect_type) String(ibm) Value(0x01) + +EnumValue +Enum(dialect_type) String(mf) Value(0x02) + +EnumValue +Enum(dialect_type) String(gnu) Value(0x04) + +fcobol-exceptions +Cobol Joined Separate Var(cobol_exceptions) +-fcobol-exceptions=<n> Enable some exceptions by default + +copyext +Cobol Joined Separate Var(cobol_copyext) Init(0) +Define alternative implicit copybook filename extension + +fdefaultbyte +Cobol RejectNegative Joined Separate UInteger Var(cobol_default_byte) +Set Working-Storage data items to the supplied value + +fflex-debug +Cobol Var(yy_flex_debug, 1) Init(0) +Enable Cobol lex debugging + +ffixed-form +Cobol RejectNegative +Assume that the source file is fixed form. + +fsyntax-only +Cobol RejectNegative +; Documented in c.opt + +ffree-form +Cobol RejectNegative +Assume that the source file is free form. + +findicator-column +Cobol RejectNegative Joined Separate UInteger Var(indicator_column) Init(0) IntegerRange(0, 8) +-findicator-column=<n> Column after which Region A begins + +finternal-ebcdic +Cobol Var(cobol_ebcdic, 1) Init(0) +-finternal-ebcdic Internal processing is in EBCDIC Code Page 1140 + +fmax-errors +Cobol Joined Separate +; Documented in C + +fstatic-call +Cobol Var(cobol_static_call, 1) Init(1) +Enable/disable static linkage for CALL literals + +ftrace-debug +Cobol Var(cobol_trace_debug, 1) Init(0) +Enable Cobol parser debugging + +fyacc-debug +Cobol Var(yy_debug, 1) Init(0) +Enable Cobol yacc debugging + +preprocess +Cobol Joined Separate Var(cobol_preprocess) +preprocess <source_filter> before compiling + +iprefix +Cobol Joined Separate +; Documented in C + +include +Cobol Joined Separate Var(cobol_include) +; Documented in C + +isysroot +Cobol Joined Separate +; Documented in C + +isystem +Cobol Joined Separate +; Documented in C + +main +Cobol +-main The first program-id in the next source file is called by a generated main() entry point + +main= +Cobol Joined Var(cobol_main_string) +-main=<source_file> source_file/PROGRAM-ID is called by the generated main() + +nomain +Cobol +-nomain No main() function is created from COBOL source files + +; This comment is to ensure we retain the blank line above. diff --git a/gcc/cobol/lang.opt.urls b/gcc/cobol/lang.opt.urls new file mode 100644 index 00000000000..9fd69a37a6b --- /dev/null +++ b/gcc/cobol/lang.opt.urls @@ -0,0 +1,29 @@ +; Copied by Dubner from gcc/rust/ so that compilation could proceed +; Autogenerated by regenerate-opt-urls.py from gcc/rust/lang.opt and generated HTML + +I +UrlSuffix(gcc/Directory-Options.html#index-I) LangUrlSuffix_D(gdc/Directory-Options.html#index-I) + +L +UrlSuffix(gcc/Directory-Options.html#index-L) LangUrlSuffix_D(gdc/Directory-Options.html#index-L) + +; skipping UrlSuffix for 'Wall' due to multiple URLs: +; duplicate: 'gcc/Standard-Libraries.html#index-Wall-1' +; duplicate: 'gcc/Warning-Options.html#index-Wall' +Wall +LangUrlSuffix_D(gdc/Warnings.html#index-Wall) + +Wunused-variable +UrlSuffix(gcc/Warning-Options.html#index-Wno-unused-variable) + +Wunused-const-variable +UrlSuffix(gcc/Warning-Options.html#index-Wno-unused-const-variable) + +Wunused-const-variable= +UrlSuffix(gcc/Warning-Options.html#index-Wno-unused-const-variable) + +Wunused-result +UrlSuffix(gcc/Warning-Options.html#index-Wno-unused-result) + +o +UrlSuffix(gcc/Overall-Options.html#index-o) diff --git a/gcc/common.opt b/gcc/common.opt index ea39f87ae71..11e8bf0ea8b 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3829,6 +3829,10 @@ static-libgfortran Driver ; Documented for Fortran, but always accepted by driver. +static-libgcobol +Driver +; Documented for COBOL, but always accepted by driver. + static-libgm2 Driver ; Documented for Modula-2, but always accepted by driver. diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 3f040da33a6..a9660abe08e 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -25391,6 +25391,8 @@ gen_compile_unit_die (const char *filename) } else if (strcmp (language_string, "GNU F77") == 0) language = DW_LANG_Fortran77; + else if (strcmp (language_string, "Cobol") == 0) + language = DW_LANG_Cobol85; else if (strcmp (language_string, "GNU Modula-2") == 0) language = DW_LANG_Modula2; else if (dwarf_version >= 3 || !dwarf_strict) @@ -25442,6 +25444,9 @@ gen_compile_unit_die (const char *filename) lowercases everything. */ add_AT_unsigned (die, DW_AT_identifier_case, DW_ID_down_case); break; + case DW_LANG_Cobol85: + add_AT_unsigned (die, DW_AT_identifier_case, DW_ID_case_insensitive); + default: /* The default DW_ID_case_sensitive doesn't need to be specified. */ break; [pins]