* Building gcc with "-O -g"?
@ 2024-02-10 18:28 Steve Kargl
2024-02-10 18:35 ` Marc Glisse
0 siblings, 1 reply; 3+ messages in thread
From: Steve Kargl @ 2024-02-10 18:28 UTC (permalink / raw)
To: gcc
So, how does one biulding all parts of gcc with "-O -g"?
In my shell script, I have
CFLAGS="-O -g"
export CFLAGS
CXXFLAGS="-O -g"
export CXXFLAGS
BOOT_CFLAGS="-O -g"
export BOOT_CFLAGS
../gcc/configure --prefix=$HOME/work --enable-languages=c,c++,fortran \
--enable-bootstrap --disable-libssp --disable-multilib
but during bootstrap I see
/home/kargl/gcc/obj/./prev-gcc/xg++ -B/home/kargl/gcc/obj/./prev-gcc/ -B/home/kargl/work/x86_64-unknown-freebsd15.0/bin/ -nostdinc++ -B/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/src/.libs -B/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/libsupc++/.libs -I/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/include/x86_64-unknown-freebsd15.0 -I/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/include -I/home/kargl/gcc/gcc/libstdc++-v3/libsupc++ -L/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/src/.libs -L/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/libsupc++/.libs -fno-PIE -c -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I/usr/local/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o fibonacci_heap.o -MT fibonacci_heap.o -MMD -MP -MF ./.deps/fibonacci_heap.TPo ../../gcc/gcc/fibonacci_heap.cc
Note the "-g -O2". Why?
--
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Building gcc with "-O -g"?
2024-02-10 18:28 Building gcc with "-O -g"? Steve Kargl
@ 2024-02-10 18:35 ` Marc Glisse
2024-02-10 18:38 ` Steve Kargl
0 siblings, 1 reply; 3+ messages in thread
From: Marc Glisse @ 2024-02-10 18:35 UTC (permalink / raw)
To: sgk; +Cc: gcc
On Sat, 10 Feb 2024, Steve Kargl via Gcc wrote:
> So, how does one biulding all parts of gcc with "-O -g"?
>
> In my shell script, I have
>
> CFLAGS="-O -g"
> export CFLAGS
>
> CXXFLAGS="-O -g"
> export CXXFLAGS
>
> BOOT_CFLAGS="-O -g"
> export BOOT_CFLAGS
>
> ../gcc/configure --prefix=$HOME/work --enable-languages=c,c++,fortran \
> --enable-bootstrap --disable-libssp --disable-multilib
>
> but during bootstrap I see
>
> /home/kargl/gcc/obj/./prev-gcc/xg++ -B/home/kargl/gcc/obj/./prev-gcc/ -B/home/kargl/work/x86_64-unknown-freebsd15.0/bin/ -nostdinc++ -B/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/src/.libs -B/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/libsupc++/.libs -I/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/include/x86_64-unknown-freebsd15.0 -I/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/include -I/home/kargl/gcc/gcc/libstdc++-v3/libsupc++ -L/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/src/.libs -L/home/kargl/gcc/obj/prev-x86_64-unknown-freebsd15.0/libstdc++-v3/libsupc++/.libs -fno-PIE -c -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I/usr/local/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o fibonacci_heap.o -MT fibonacci_heap.o -MMD -MP -MF ./.deps/fibonacci_heap.TPo ../../gcc/gcc/fibonacci_heap.cc
>
> Note the "-g -O2". Why?
In addition to CFLAGS and BOOT_CFLAGS, you are missing CFLAGS_FOR_TARGET
(plus the same 3 for CXX). I don't know if that's still sufficient, but
that's what I used to set a few years ago.
--
Marc Glisse
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Building gcc with "-O -g"?
2024-02-10 18:35 ` Marc Glisse
@ 2024-02-10 18:38 ` Steve Kargl
0 siblings, 0 replies; 3+ messages in thread
From: Steve Kargl @ 2024-02-10 18:38 UTC (permalink / raw)
To: Marc Glisse; +Cc: gcc
On Sat, Feb 10, 2024 at 07:35:22PM +0100, Marc Glisse wrote:
> On Sat, 10 Feb 2024, Steve Kargl via Gcc wrote:
>
> > So, how does one biulding all parts of gcc with "-O -g"?
> >
> > In my shell script, I have
> >
> > CFLAGS="-O -g"
> > export CFLAGS
> >
> > CXXFLAGS="-O -g"
> > export CXXFLAGS
> >
> > BOOT_CFLAGS="-O -g"
> > export BOOT_CFLAGS
> >
> > ../gcc/configure --prefix=$HOME/work --enable-languages=c,c++,fortran \
> > --enable-bootstrap --disable-libssp --disable-multilib
> >
> > but during bootstrap I see
> >
> > /home/kargl/gcc/obj/./prev-gcc/xg++ ... -g -O2 ...
> >
> > Note the "-g -O2". Why?
>
> In addition to CFLAGS and BOOT_CFLAGS, you are missing CFLAGS_FOR_TARGET
> (plus the same 3 for CXX). I don't know if that's still sufficient, but
> that's what I used to set a few years ago.
Thanks for the pointers. It seems that https://gcc.gnu.org/install/build.html
needs be updated.
--
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-10 18:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-10 18:28 Building gcc with "-O -g"? Steve Kargl
2024-02-10 18:35 ` Marc Glisse
2024-02-10 18:38 ` Steve Kargl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).