public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* gdbserver optimizer build failure
@ 2010-06-18 20:57 Pierre Muller
  2010-06-18 21:33 ` Stan Shebs
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Muller @ 2010-06-18 20:57 UTC (permalink / raw)
  To: gdb-patches

  
  gdbserver build currently
fails on gcc16 (x86-64 machine running linux).


gcc -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbserve
r/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gdbser
ver/../../include
-Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.li
st -o gdbserver inferiors.o regcache.o remote-utils.o server.o signals.o
target.
o utils.o version.o mem-break.o hostio.o event-loop.o tracepoint.o
xml-builtin.o
 amd64-linux.o amd64-avx-linux.o i386-linux.o i386-avx-linux.o
i386-mmx-linux.o
linux-low.o linux-x86-low.o i386-low.o i387-fp.o hostio-errno.o thread-db.o
proc
-service.o  \
          -ldl
linux-x86-low.o: In function `i386_emit_void_call_2':
/home/muller/gdb/build-norm/gdb/gdbserver/../../../src/gdb/gdbserver/linux-x
86-low.c:2426: undefined reference to `start_i386_void_call_2_a'
/home/muller/gdb/build-norm/gdb/gdbserver/../../../src/gdb/gdbserver/linux-x
86-low.c:2426: undefined reference to `end_i386_void_call_2_a'
/home/muller/gdb/build-norm/gdb/gdbserver/../../../src/gdb/gdbserver/linux-x
86-l

And so on...

If I do:
prompt$ rm linux-x86-low.o
prompt$ make CFLAGS="-g  --save-temps" linux-x86-low.o
gcc -c -Wall -g  --save-temps    -I. -I../../../src/gdb/gdbserver
-I../../../src
/gdb/gdbserver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../s
rc/gdb/gdbserver/../../include ../../../src/gdb/gdbserver/linux-x86-low.c
prompt$ make
rm -f gdbserver
gcc -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbserve
r/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gdbser
ver/../../include
-Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.li
st -o gdbserver inferiors.o regcache.o remote-utils.o server.o signals.o
target.
o utils.o version.o mem-break.o hostio.o event-loop.o tracepoint.o
xml-builtin.o
 amd64-linux.o amd64-avx-linux.o i386-linux.o i386-avx-linux.o
i386-mmx-linux.o
linux-low.o linux-x86-low.o i386-low.o i387-fp.o hostio-errno.o thread-db.o
proc
-service.o  \
          -ldl
gcc -c -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbse
rver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gdb
server/../../include ../../../src/gdb/gdbserver/gdbreplay.c
rm -f gdbreplay
gcc -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbserve
r/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gdbser
ver/../../include
-Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.li
st -o gdbreplay gdbreplay.o version.o \

gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbs
erver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gd
bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
-fvisibility=hidden .
./../../src/gdb/gdbserver/tracepoint.c -o tracepoint-ipa.o
gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbs
erver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gd
bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
-fvisibility=hidden .
./../../src/gdb/gdbserver/utils.c -o utils-ipa.o
gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbs
erver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gd
bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
-fvisibility=hidden .
./../../src/gdb/gdbserver/regcache.c -o regcache-ipa.o
gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbs
erver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gd
bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
-fvisibility=hidden a
md64-linux.c -o amd64-linux-ipa.o
gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
-I../../../src/gdb/gdbs
erver/../common -I../../../src/gdb/gdbserver/../regformats
-I../../../src/gdb/gd
bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
-fvisibility=hidden .
./../../src/gdb/gdbserver/linux-amd64-ipa.c -o linux-amd64-ipa.o
rm -f libinproctrace.so
gcc -shared -fPIC -Wl,--no-undefined -Wall -g -O2    -I.
-I../../../src/gdb/gdbs
erver -I../../../src/gdb/gdbserver/../common
-I../../../src/gdb/gdbserver/../reg
formats -I../../../src/gdb/gdbserver/../../include \
         -Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.list -o
libi
nproctrace.so tracepoint-ipa.o utils-ipa.o regcache-ipa.o amd64-linux-ipa.o
linu
x-amd64-ipa.o


The build completes successfully!


  It seems that there is a problem with the macro EMIT_ASM
which seems to be mistreated by the optimizer.

  I have no clue how to solve this...

Pierre Muller
Pascal language support maintainer for GDB


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdbserver optimizer build failure
  2010-06-18 20:57 gdbserver optimizer build failure Pierre Muller
@ 2010-06-18 21:33 ` Stan Shebs
  2010-06-18 22:44   ` Pierre Muller
  0 siblings, 1 reply; 3+ messages in thread
From: Stan Shebs @ 2010-06-18 21:33 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

Pierre Muller wrote:
>   
>   gdbserver build currently
> fails on gcc16 (x86-64 machine running linux).
>   

This is presumably the same problem as Doug reported a couple days ago:

http://sourceware.org/ml/gdb-patches/2010-06/msg00370.html

It doesn't happen to me, probably because it only kicks in on particular 
compiler / binutils combos.  But could you please try Ian's suggested 
macro in http://sourceware.org/ml/gdb-patches/2010-06/msg00379.html ?  
It looks like it would do the right thing.

Stan

>
> gcc -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbserve
> r/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gdbser
> ver/../../include
> -Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.li
> st -o gdbserver inferiors.o regcache.o remote-utils.o server.o signals.o
> target.
> o utils.o version.o mem-break.o hostio.o event-loop.o tracepoint.o
> xml-builtin.o
>  amd64-linux.o amd64-avx-linux.o i386-linux.o i386-avx-linux.o
> i386-mmx-linux.o
> linux-low.o linux-x86-low.o i386-low.o i387-fp.o hostio-errno.o thread-db.o
> proc
> -service.o  \
>           -ldl
> linux-x86-low.o: In function `i386_emit_void_call_2':
> /home/muller/gdb/build-norm/gdb/gdbserver/../../../src/gdb/gdbserver/linux-x
> 86-low.c:2426: undefined reference to `start_i386_void_call_2_a'
> /home/muller/gdb/build-norm/gdb/gdbserver/../../../src/gdb/gdbserver/linux-x
> 86-low.c:2426: undefined reference to `end_i386_void_call_2_a'
> /home/muller/gdb/build-norm/gdb/gdbserver/../../../src/gdb/gdbserver/linux-x
> 86-l
>
> And so on...
>
> If I do:
> prompt$ rm linux-x86-low.o
> prompt$ make CFLAGS="-g  --save-temps" linux-x86-low.o
> gcc -c -Wall -g  --save-temps    -I. -I../../../src/gdb/gdbserver
> -I../../../src
> /gdb/gdbserver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../s
> rc/gdb/gdbserver/../../include ../../../src/gdb/gdbserver/linux-x86-low.c
> prompt$ make
> rm -f gdbserver
> gcc -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbserve
> r/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gdbser
> ver/../../include
> -Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.li
> st -o gdbserver inferiors.o regcache.o remote-utils.o server.o signals.o
> target.
> o utils.o version.o mem-break.o hostio.o event-loop.o tracepoint.o
> xml-builtin.o
>  amd64-linux.o amd64-avx-linux.o i386-linux.o i386-avx-linux.o
> i386-mmx-linux.o
> linux-low.o linux-x86-low.o i386-low.o i387-fp.o hostio-errno.o thread-db.o
> proc
> -service.o  \
>           -ldl
> gcc -c -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbse
> rver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gdb
> server/../../include ../../../src/gdb/gdbserver/gdbreplay.c
> rm -f gdbreplay
> gcc -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbserve
> r/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gdbser
> ver/../../include
> -Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.li
> st -o gdbreplay gdbreplay.o version.o \
>
> gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbs
> erver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gd
> bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
> -fvisibility=hidden .
> ./../../src/gdb/gdbserver/tracepoint.c -o tracepoint-ipa.o
> gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbs
> erver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gd
> bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
> -fvisibility=hidden .
> ./../../src/gdb/gdbserver/utils.c -o utils-ipa.o
> gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbs
> erver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gd
> bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
> -fvisibility=hidden .
> ./../../src/gdb/gdbserver/regcache.c -o regcache-ipa.o
> gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbs
> erver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gd
> bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
> -fvisibility=hidden a
> md64-linux.c -o amd64-linux-ipa.o
> gcc -c  -Wall -g -O2    -I. -I../../../src/gdb/gdbserver
> -I../../../src/gdb/gdbs
> erver/../common -I../../../src/gdb/gdbserver/../regformats
> -I../../../src/gdb/gd
> bserver/../../include -fPIC -DGDBSERVER -DIN_PROCESS_AGENT
> -fvisibility=hidden .
> ./../../src/gdb/gdbserver/linux-amd64-ipa.c -o linux-amd64-ipa.o
> rm -f libinproctrace.so
> gcc -shared -fPIC -Wl,--no-undefined -Wall -g -O2    -I.
> -I../../../src/gdb/gdbs
> erver -I../../../src/gdb/gdbserver/../common
> -I../../../src/gdb/gdbserver/../reg
> formats -I../../../src/gdb/gdbserver/../../include \
>          -Wl,--dynamic-list=../../../src/gdb/gdbserver/proc-service.list -o
> libi
> nproctrace.so tracepoint-ipa.o utils-ipa.o regcache-ipa.o amd64-linux-ipa.o
> linu
> x-amd64-ipa.o
>
>
> The build completes successfully!
>
>
>   It seems that there is a problem with the macro EMIT_ASM
> which seems to be mistreated by the optimizer.
>
>   I have no clue how to solve this...
>
> Pierre Muller
> Pascal language support maintainer for GDB
>
>
>
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: gdbserver optimizer build failure
  2010-06-18 21:33 ` Stan Shebs
@ 2010-06-18 22:44   ` Pierre Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Muller @ 2010-06-18 22:44 UTC (permalink / raw)
  To: 'Stan Shebs'; +Cc: gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Stan Shebs
> Envoyé : Friday, June 18, 2010 11:33 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: gdbserver optimizer build failure
> 
> Pierre Muller wrote:
> >
> >   gdbserver build currently
> > fails on gcc16 (x86-64 machine running linux).
> >
> 
> This is presumably the same problem as Doug reported a couple days ago:
> 
> http://sourceware.org/ml/gdb-patches/2010-06/msg00370.html
> 
> It doesn't happen to me, probably because it only kicks in on
> particular
> compiler / binutils combos.  But could you please try Ian's suggested
> macro in http://sourceware.org/ml/gdb-patches/2010-06/msg00379.html ?
> It looks like it would do the right thing.
No that patch didn't work on gcc16,
apparently the optimizer still skips the "unsused" code.

The following worked for gcc16:
I first added the volatile to the variable, but it did not seem to be
required.

Pierre


Index: linux-x86-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-x86-low.c,v
retrieving revision 1.19
diff -u -p -r1.19 linux-x86-low.c
--- linux-x86-low.c     15 Jun 2010 10:44:48 -0000      1.19
+++ linux-x86-low.c     18 Jun 2010 22:41:59 -0000
@@ -1486,10 +1486,13 @@ add_insns (unsigned char *start, int len

 /* A function used to trick optimizers.  */

+
+/* volatile */ int always_true_answer = 1;
+
 int
 always_true (void)
 {
-  return 1;
+  return always_true_answer;
 }

 /* Our general strategy for emitting code is to avoid specifying raw


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-18 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-18 20:57 gdbserver optimizer build failure Pierre Muller
2010-06-18 21:33 ` Stan Shebs
2010-06-18 22:44   ` Pierre Muller

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