Re: [PATCH] newlib: Remove debug flag for --enable-target-optspace

Andrew Pinski <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CA+=Sn1=k8MB5VxLP3D5X1Ujz38nxMUH2mq+16_ZWGAOQhGSWkA@mail.gmail.com>
On Fri, Nov 29, 2019 at 3:19 AM Jon Beniston <[email protected]> wrote:
>
> Hi Stephanos,
>
> >As you suggested, the debug information added by `--enable-target-optspace`
> can be stripped, but why add it in the first place if it is not necessary?
>
> Because many people want to be able to debug their code!
>
> >Unless there is a good reason to keep `-g` and `-Os` together in
> `--enable-target-optspace`,
> >I strongly believe `-g` should be removed and moved into a separate
> configuration option.
>
> Currently the default for CFLAGS_FOR_TARGET is "-g -O2".
> --enable-target-optspace Changes this to "-g -Os"

Actually you are wrong.  --enable-target-optspace changes the (normal)
CFLAGS to be "-g -O2 -g -Os".  The "-g" in the config/mt-ospace is
redundant now.
Please see https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02062.html as
that changed CFLAGS from being destroyed to be additional.

The reasoning Stephanos is giving of removing the "-g" there is not
correct though.  I am saying the patch is correct but the REASON
behind of why it is correct is NOT.  The "-g" is redudant and can be
removed from config/mt-ospace.

Thanks,
Andrew Pinski

>
> If -g is to be controlled by a separate option, then it should apply in both
> cases. And this new option should probably be enabled by default to maintain
> existing behaviour (so perhaps add a --disable-target-debug option that
> removes -g)
>
> Cheers,
> Jon
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.