Tighten flag_pic processing in vxworks_override_options

Olivier Hainque hainque@adacore.com
Thu Sep 24 10:13:18 GMT 2020


This fixes spurious complaints about PIC mode not supported
on "gcc --help=...", on VxWorks without -mrtp. The spurious message
is emitted by vxworks_override_options, called with flag_pic == -1
when we're running for --help.

The change simply adjusts the check testing for "we're generating pic code"
to "flag_pic > 0" instead of just "flag_pic". We're not generating code at
all when reaching here with -1.

Tested by verifying that the spurious message goes away in
production gcc-9 based toolchains for more than a year now, and
sanity checked that I can build a mainline compiler with the
patch applied.

Committing to mainline shortly.

Olivier

2020-09-24  Olivier Hainque  <hainque@adacore.com>

        * config/vxworks.c (vxworks_override_options): Guard pic checks with
        flag_pic > 0 instead of just flag_pic.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Tigthen-flag_pic-processing-in-vxworks_override_o.diff
Type: application/octet-stream
Size: 769 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200924/235904cf/attachment.obj>


More information about the Gcc-patches mailing list