> -----Original Message-----
> From: Richard Biener <richard.guent...@gmail.com>
> Sent: Wednesday, March 5, 2025 10:50
> To: Robert Dubner <rdub...@symas.com>
> Cc: Jakub Jelinek <ja...@redhat.com>; James K. Lowden
> <jklow...@schemamania.org>; gcc-patches@gcc.gnu.org
> Subject: Re: The COBOL front end, version 3, now in 14 easy pieces
>
> On Wed, Mar 5, 2025 at 4:47 PM Robert Dubner <rdub...@symas.com> wrote:
> >
> > > -----Original Message-----
> > > From: Jakub Jelinek <ja...@redhat.com>
> > > Sent: Wednesday, March 5, 2025 08:35
> > > To: Richard Biener <richard.guent...@gmail.com>
> > > Cc: James K. Lowden <jklow...@schemamania.org>;
> > > gcc-patches@gcc.gnu.org
> > > Subject: Re: The COBOL front end, version 3, now in 14 easy pieces
> > >
> > > On Wed, Mar 05, 2025 at 12:46:48PM +0100, Richard Biener wrote:
> > > > and the installed compiler behaves as intended. I can trick -m32
> > > > to
> > > "work"
> > > > by using the generic gcc diriver:
> > > >
> > > > > ./install/gcc-cobol/usr/local/bin/gcc -x cobol t.cob -m32 -c
> > > >
> > > > but I think this is a less important issue.
> > >
> > > Agreed, it should be the compiler, i.e. cobol1, that diagnoses this
> > rather
> > > than the driver.
> >
> > I actually tried to do that, by looking for "case OPT_m32". in
> cobol1.cc.
> >
> > I learned that OPT_m32 wasn't being delivered to
> > "cobol_langhook_handle_option()"
> >
> > I made a quick attempt at making "m32" a COBOL switch, so that it
> > would be sent. But all I managed to do was create compilation errors,
> > so I gave up.
> >
> > Any advice will land on grateful ears.
>
> As I suggested I'd see if __int128 is supported instead and sorry () when
> not, diagnosing that __int128 is required to compile Cobol.
>
At the present time, I am noticing OPT_m32 in the driver with this code in
gcobolspec.cc:
#ifdef __x86_64__
case OPT_m32:
error ( "unrecognized command-line option %<-%s%>; "
"(32-bit executables cannot be generated)", "m32");
break;
#endif
The #ifdef is needed because when compiling on an aarch64, OPT_m32 isn't
defined.
I did that to more-or-less match what I saw when I put an absurd "-m47" on a
gcc command line.
The question here is that I need OPT_m32 to be delivered to
cobol_langhook_handle_option(), so I could do the test there. I made a
casual attempt at that, and quickly gave up when I couldn't make it work.
Somewhere there is an incantation that will cause OPT_m32 to be delivered to
cobol_langhook_handle_option(). I just didn't dig deeply into where, or
how. I'll do that now, but a pointer would be appreciated.
> Richard.
>
> >
> > >
> > > Jakub
> >