Code to generate compiler options doesn't handle -g2

Bug #349177 reported by Mark Callaghan on 2009-03-26
2
Affects Status Importance Assigned to Milestone
PBXT
Undecided
Vladimir Kolesnikov

Bug Description

Using the latest code from lp:pbxt, this does the wrong thing for '-g2'. The result from that is the option '2' which makes compilation fail.

strip_mysql_opt_dbg_flags()
{
  MYSQL_CFLAGS=`echo "$MYSQL_CFLAGS" | sed "s/-Os//" | sed "s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
  MYSQL_CXXFLAGS=`echo "$MYSQL_CXXFLAGS" | sed "s/-Os//" | sed "s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
}

Related branches

Hi Mark,

I cannot reproduce the problem. Which configuration options are you using for MySQL and PBXT?

Thanks.

Changed in pbxt:
assignee: nobody → vkolesnikov
status: New → Incomplete

On Tue, Apr 7, 2009 at 7:03 AM, Vladimir Kolesnikov
<email address hidden> wrote:
> Hi Mark,
>
> I cannot reproduce the problem. Which configuration options are you
> using for MySQL and PBXT?

There are more, but the relevant ones are:
./configure ... CFLAGS="-O2 -g2" CXXFLAGS="-O2 -g2"

>
> Thanks.
>
> ** Changed in: pbxt
> Status: New => Incomplete
>
> ** Changed in: pbxt
> Assignee: (unassigned) => Vladimir Kolesnikov (vkolesnikov)
>
> --
> Code to generate compiler options doesn't handle -g2
> https://bugs.launchpad.net/bugs/349177
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in PrimeBase XT: Incomplete
>
> Bug description:
> Using the latest code from lp:pbxt, this does the wrong thing for '-g2'. The result from that is the option '2' which makes compilation fail.
>
> strip_mysql_opt_dbg_flags()
> {
> MYSQL_CFLAGS=`echo "$MYSQL_CFLAGS" | sed "s/-Os//" | sed "s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
> MYSQL_CXXFLAGS=`echo "$MYSQL_CXXFLAGS" | sed "s/-Os//" | sed "s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
> }
>

--
Mark Callaghan
<email address hidden>

I just tried to configure both MySQL and PBXT with CFLAGS="-O2 -g2" CXXFLAGS="-O2 -g2". I still cannot repro the problem. Both -O2 and -g2 are present in PBXT compile options. Btw, its not necessary to use CFLAGS="-O2 -g2" CXXFLAGS="-O2 -g2" for PBXT as it should be able to automatically grab MySQL compile options, unless you explicitly specify "--wth-debug" PBXT configure option.

Still this doesn't work properly now when I don't want to use MySQL debug options, i.e. if I build MySQL with -g2 and then specify --with-debug=no for PBXT it leaves -g2 in PBXT compiler options... However it's strange I cannot repro this bug. I wonder maybe there's a global sed flag that controls its behavior for "s" mode?...

Mark Callaghan (mdcallag) wrote :

On Tue, Apr 7, 2009 at 7:51 AM, Vladimir Kolesnikov
<email address hidden> wrote:
> I just tried to configure both MySQL and PBXT with CFLAGS="-O2 -g2"
> CXXFLAGS="-O2 -g2". I still cannot repro the problem. Both -O2 and -g2
> are present in PBXT compile options. Btw, its not necessary to use
> CFLAGS="-O2 -g2" CXXFLAGS="-O2 -g2" for PBXT as it should be able to
> automatically grab MySQL compile options, unless you explicitly specify
> "--wth-debug" PBXT configure option.

How can that sed script work? Note that the script does -Os, -O3 and
-O2 before -O but does not try to do anything special for -g2 before
-g.

strip_mysql_opt_dbg_flags()
{
 MYSQL_CFLAGS=`echo "$MYSQL_CFLAGS" | sed "s/-Os//" | sed "s/-O3//" |
sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
 MYSQL_CXXFLAGS=`echo "$MYSQL_CXXFLAGS" | sed "s/-Os//" | sed
"s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
}

>
> Still this doesn't work properly now when I don't want to use MySQL
> debug options, i.e. if I build MySQL with -g2 and then specify --with-
> debug=no for PBXT it leaves -g2 in PBXT compiler options... However it's
> strange I cannot repro this bug. I wonder maybe there's a global sed
> flag that controls its behavior for "s" mode?...
>
> --
> Code to generate compiler options doesn't handle -g2
> https://bugs.launchpad.net/bugs/349177
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in PrimeBase XT: Incomplete
>
> Bug description:
> Using the latest code from lp:pbxt, this does the wrong thing for '-g2'. The result from that is the option '2' which makes compilation fail.
>
> strip_mysql_opt_dbg_flags()
> {
> MYSQL_CFLAGS=`echo "$MYSQL_CFLAGS" | sed "s/-Os//" | sed "s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
> MYSQL_CXXFLAGS=`echo "$MYSQL_CXXFLAGS" | sed "s/-Os//" | sed "s/-O3//" | sed "s/-O2//" | sed "s/-O//" | sed "s/-g//"`
> }
>

--
Mark Callaghan
<email address hidden>

Ok, I think found a way to repro it...

Changed in pbxt:
status: Incomplete → In Progress
Changed in pbxt:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers