From: Xavier Del Campo Romero Date: Mon, 15 Jun 2026 20:53:48 +0000 (+0200) Subject: cobol: Remove %I spec X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fgcc.git 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 --git a/gcc/cobol/gcobol.1 b/gcc/cobol/gcobol.1 index 97426966b52..3442f898177 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 9fbc15d1cb9..84dd1757152 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 f629a0447e9..8abd816ae64 100644 --- a/gcc/cobol/lang.opt +++ b/gcc/cobol/lang.opt @@ -390,22 +390,10 @@ preprocess Cobol Joined Separate Var(cobol_preprocess) Preprocess 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 db78cc00164..f6c27a577f7 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)