https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101391

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-09-14
     Ever confirmed|0                           |1

--- Comment #3 from Rainer Orth <ro at gcc dot gnu.org> ---
(In reply to Gaius Mulley from comment #1)
> Now fixed in the gcc git repro thanks for the patch.

Unfortunately, the patch wasn't enough: while I now could finish a build on 
x86_64-pc-linux-gnu, every m2 link test failed like this:

/vol/gcc/bin/gld-2.35:
/var/scratch/gcc/gcc-12.0.0-20210913/5.4.0-gm2/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs/libm2pim.so:
undefined reference to `cgetopt_optopt'
/vol/gcc/bin/gld-2.35:
/var/scratch/gcc/gcc-12.0.0-20210913/5.4.0-gm2/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs/libm2pim.so:
undefined reference to `cgetopt_opterr'
/vol/gcc/bin/gld-2.35:
/var/scratch/gcc/gcc-12.0.0-20210913/5.4.0-gm2/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs/libm2pim.so:
undefined reference to `cgetopt_getopt_long_only'
/vol/gcc/bin/gld-2.35:
/var/scratch/gcc/gcc-12.0.0-20210913/5.4.0-gm2/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs/libm2pim.so:
undefined reference to `cgetopt_getopt'
/vol/gcc/bin/gld-2.35:
/var/scratch/gcc/gcc-12.0.0-20210913/5.4.0-gm2/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs/libm2pim.so:
undefined reference to `cgetopt_getopt_long'
/vol/gcc/bin/gld-2.35:
/var/scratch/gcc/gcc-12.0.0-20210913/5.4.0-gm2/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs/libm2pim.so:
undefined reference to `cgetopt_optarg'
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gm2/calling-c/datatypes/unbounded/run/pass/m.mod compilation,  -g
UNRESOLVED: gm2/calling-c/datatypes/unbounded/run/pass/m.mod execution,  -g 
(link failed)

There are undefined references to

  cgetopt_getopt
  cgetopt_getopt_long
  cgetopt_getopt_long_only
  cgetopt_optarg
  cgetopt_opterr
  cgetopt_optopt

and libm2pim.so has those instead, defined in cgetopt.o:

0000000000020590 T getopt_getopt
00000000000205f0 T getopt_getopt_long
0000000000020650 T getopt_getopt_long_only
00000000000335c8 B getopt_optarg
00000000000335bc B getopt_opterr
00000000000335c0 B getopt_optind
00000000000335b8 B getopt_optopt

The attached new patch fixes this, too, and gives way more reasonable test
results:

                === gm2 Summary ===

# of expected passes            23067
# of unexpected failures        99
# of unresolved testcases       78

Reply via email to