[PATCH 0/7] kvx: New port.

Nick Clifton nickc@redhat.com
Mon Jul 24 09:28:07 GMT 2023


Hi Paul,

   I tried compiling the binutils for a kvx-elf target with your
   patches applied and I ran across a compile time warning/error:

gas/config/kvx-parse.c: In function 'parse_with_restarts':
gas/config/kvx-parse.c:766:3: error: using a dangling pointer to '__buf_tok' [-Werror=dangling-pointer=]
   766 |   printf_debug (1, "\nEntering rule: %d (Trying to match: %s (%s)[%d])\n", jump_target,
       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   767 |                 TOKEN_NAME (CLASS_ID (tok)), TOKEN_STR (tok), CLASS_ID (tok));
       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gas/config/kvx-parse.c:391:6: note: '__buf_tok' declared here
   391 | char __buf_##token[256] = { 0 }; \
       |      ^~~~~~
gas/config/kvx-parse.c:767:46: note: in expansion of macro 'TOKEN_STR'
   767 |                 TOKEN_NAME (CLASS_ID (tok)), TOKEN_STR (tok), CLASS_ID (tok));
       |                                              ^~~~~~~~~
cc1: all warnings being treated as errors

   This is with gcc v13 on a Fedora 38 box...

   It looks like the TOKEN_STR macro is doing some funky things that are not fully
   supported by gcc 13...


   On a related note, building a toolchain configure as --enable-64-bit-bfd --enable-targets=all
   results in:

/bin/ld: ../bfd/.libs/libbfd.a(targets.o):(.rodata+0xbc8): undefined reference to `kvx_elf64_vec'
/bin/ld: ../bfd/.libs/libbfd.a(targets.o):(.rodata+0x1b98): undefined reference to `kvx_elf64_vec'
/bin/ld: ../bfd/.libs/libbfd.a(targets.o):(.rodata+0x1ba0): undefined reference to `kvx_elf64_linux_vec'
collect2: error: ld returned 1 exit status

   I believe that this is because you are missing an entry for elf64-kvx.lo
   from the BFD64_BACKENDS list defined in bfd/Makefile.am...

Cheers
   Nick




More information about the Binutils mailing list