https://gcc.gnu.org/g:112b53b86280087c4ac0b2a1e0d9f0aa01881540
commit r17-1751-g112b53b86280087c4ac0b2a1e0d9f0aa01881540 Author: Xavier Del Campo Romero <[email protected]> Date: Mon Jun 15 22:53:48 2026 +0200 cobol: Remove %I spec Remove %I from the spec string because gcobol does not use the C preprocessor library and does not search include/ or include-fixed/ directories. Instead, system copybooks (as they're called) follow the runtime library and are installed into the LIBSUBDIR, similarly to Modula-2's .def files. For compilations relying on non-standard paths (i.e., outside the installation prefix), -B is already handled by the cobol1 compiler. gcc/cobol/ChangeLog: * gcobol.1: Document -B. * lang-specs.h: Remove %I spec. * lang.opt: Remove options injected by %I. * lang.opt.urls: Likewise. Diff: --- gcc/cobol/gcobol.1 | 33 +++++++++++++++++++++++++++++++++ gcc/cobol/lang-specs.h | 1 - gcc/cobol/lang.opt | 12 ------------ gcc/cobol/lang.opt.urls | 9 --------- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/gcc/cobol/gcobol.1 b/gcc/cobol/gcobol.1 index 97426966b525..3442f898177d 100644 --- a/gcc/cobol/gcobol.1 +++ b/gcc/cobol/gcobol.1 @@ -11,6 +11,7 @@ .Nm .Op Fl D Ns Ar name Ns Oo Li = Ns Ar value Oc .Op Fl E +.Op Fl B .Op Fl fdefaultbyte Ns Li = Ns Ar value .Op Fl fsyntax-only .Op Fl I Ns Ar copybook-path @@ -144,6 +145,38 @@ See below for examples showing the use of .Fl main and .Fl nomain. +.It Fl B Ar prefix +Add a search location for the system copybooks, so they can be found with the +.Sy COPY +statement. For each location, the +.Sy cobol1 +compiler shall search for copybooks inside the following subdirectories, +relative to +.Ar prefix : +.Pp +.Bl -tag -compact +.It Sy compat/gnu/lib/ +.It Sy compat/gnu/cpy/ +.It Sy compat/gnu/udf/ +.It Sy posix/cpy/ +.It Sy posix/udf/ +.It Sy cobol/compat/gnu/lib/ +.It Sy cobol/compat/gnu/cpy/ +.It Sy cobol/compat/gnu/udf/ +.It Sy cobol/posix/cpy/ +.It Sy cobol/posix/udf/ +.El +.Pp +Additionally, +.Sy cobol1 +shall append the configured +.Sy LIBSUBDIR +as an additional search location, where +.Sy LIBSUBDIR +is typically configured to +.Ar machine/version/ , +relative to the configured +.Ar libdir . .It Fl D Ar name Ns Op Li = Ns Ar expr Define a CDF name (for use with .Sy >>IF ) diff --git a/gcc/cobol/lang-specs.h b/gcc/cobol/lang-specs.h index 9fbc15d1cb9d..84dd1757152b 100644 --- a/gcc/cobol/lang-specs.h +++ b/gcc/cobol/lang-specs.h @@ -34,7 +34,6 @@ {".CBL", "@cobol", 0, 0, 0}, {"@cobol", "cobol1 %i %(cc1_options) " - "%I " "%{B*} %{D*} %{E} %{I*} %{M} %{fmax-errors*} %{fsyntax-only*} " "%{idirafter}" "%{fcobol-exceptions*} " diff --git a/gcc/cobol/lang.opt b/gcc/cobol/lang.opt index f629a0447e99..8abd816ae64c 100644 --- a/gcc/cobol/lang.opt +++ b/gcc/cobol/lang.opt @@ -390,22 +390,10 @@ preprocess Cobol Joined Separate Var(cobol_preprocess) Preprocess <source_filter> before compiling. -iprefix -Cobol Joined Separate -; Documented in C - include Cobol Joined Separate ; Documented in C -isysroot -Cobol Joined Separate -; Documented in C - -isystem -Cobol Joined Separate -; Documented in C - idirafter Cobol Joined Separate ; Documented in c.opt diff --git a/gcc/cobol/lang.opt.urls b/gcc/cobol/lang.opt.urls index db78cc00164b..f6c27a577f7e 100644 --- a/gcc/cobol/lang.opt.urls +++ b/gcc/cobol/lang.opt.urls @@ -28,18 +28,9 @@ LangUrlSuffix_Fortran(gfortran/Fortran-Dialect-Options.html#index-ffree-form) preprocess UrlSuffix(gcc/Overall-Options.html#index-preprocess) -iprefix -UrlSuffix(gcc/Directory-Options.html#index-iprefix) LangUrlSuffix_D(gdc/Directory-Options.html#index-iprefix) LangUrlSuffix_Fortran(gfortran/Preprocessing-Options.html#index-iprefix) - include UrlSuffix(gcc/Preprocessor-Options.html#index-include) -isysroot -UrlSuffix(gcc/Directory-Options.html#index-isysroot) LangUrlSuffix_Fortran(gfortran/Preprocessing-Options.html#index-isysroot) - -isystem -UrlSuffix(gcc/Directory-Options.html#index-isystem) LangUrlSuffix_Fortran(gfortran/Preprocessing-Options.html#index-isystem) - idirafter UrlSuffix(gcc/Directory-Options.html#index-idirafter) LangUrlSuffix_Fortran(gfortran/Preprocessing-Options.html#index-idirafter)
