[PATCH 0/7] kvx: New port.

Paul Iannetta piannetta@kalrayinc.com
Mon Jul 24 12:33:38 GMT 2023


Hi Nick,

On Mon, Jul 24, 2023 at 10:28:07AM +0100, Nick Clifton wrote:
> 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...

Yes, indeed, it was more of a convenience macro but it is not well
supported by gcc13+, that's the only location it is used so you can
safely comment out those lines and I will remove them as well.

> 
>   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...

Thanks, I'll have a look.

> 
> Cheers
>   Nick
> 

Thanks,
Paul






More information about the Binutils mailing list