Skip to contentSkip to conversation

Fix gdbserver-xen build errors

PATCH In review Travis Betak 3 participants 8 messages Aug 30, 2006 – Sep 4, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix gdbserver-xen build errors

This may or may not be the correct place to put this fix but it does fix the following build error:

In file included from ../../../../../libxc/xenctrl.h:16,

                 from ../../../gdb-6.2.1/gdb/gdbserver/linux-xen-low.c:38:
../../../../../libxc/xen/domctl.h:14:2: #error "domctl operations are intended for use by node control tools only"
In file included from ../../../../../libxc/xenctrl.h:17,
		 from ../../../gdb-6.2.1/gdb/gdbserver/linux-xen-low.c:38:

../../../../../libxc/xen/sysctl.h:13:2: #error "sysctl operations are intended for use by node control tools only"

---

tools/debugger/gdb/gdbbuild +2 -2
diff -r a39ad4c78850 tools/debugger/gdb/gdbbuild
@@ -18,7 +18,7 @@ if [ "$MAKE" ]; then
 if [ "$MAKE" ]; then
     $MAKE
 elif which gmake ; then
-    gmake -j4
+    gmake -j4 CFLAGS=-D__XEN_TOOLS__
 else
-    make -j4
+    make -j4 CFLAGS=-D__XEN_TOOLS__
 fi
#1 lore raw
Quoted 4 lines · Travis Betak

This may or may not be the correct place to put this fix but it does fix the following build error:

Quoted 9 lines

In file included from ../../../../../libxc/xenctrl.h:16,

                 from ../../../gdb-6.2.1/gdb/gdbserver/linux-xen-low.c:38:
../../../../../libxc/xen/domctl.h:14:2: #error "domctl operations are intended for use by node control tools only"
In file included from ../../../../../libxc/xenctrl.h:17,
		 from ../../../gdb-6.2.1/gdb/gdbserver/linux-xen-low.c:38:

../../../../../libxc/xen/sysctl.h:13:2: #error "sysctl operations are intended for use by node control tools only"

Hi Travis,

Ouch, that looks like a pretty horrible problem. Unfortunately I think your fix is broken on two counts.

1) It won't work if MAKE is defined, as $MAKE will be executed without CFLAGS doctoring

2) Any existing CFLAGS are clobered.

I'm not sure if the CFLAGS override approach is really the right way to go, but if it is, the following might work.

 tools/debugger/gdb/gdbbuild |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/debugger/gdb/gdbbuild +3 -3
@@ -16,9 +16,9 @@ cd gdb-6.2.1-linux-i386-xen
 
 # Use $MAKE if set, else use gmake if present, otherwise use make
 if [ "$MAKE" ]; then
-    $MAKE
+    $MAKE CFLAGS="$CFLAGS -D__XEN_TOOLS__"
 elif which gmake ; then
-    gmake -j4
+    gmake -j4 CFLAGS="$CFLAGS -D__XEN_TOOLS__"
 else
-    make -j4
+    make -j4 CFLAGS="$CFLAGS -D__XEN_TOOLS__"
 fi
#2 lore raw
Quoted 11 lines · Horms
Quoted 4 lines · Travis Betak

This may or may not be the correct place to put this fix but it does fix the following build error:

Hi Travis,

Ouch, that looks like a pretty horrible problem. Unfortunately I think your fix is broken on two counts.

Quoted 8 lines

1) It won't work if MAKE is defined, as $MAKE will be executed without CFLAGS doctoring

2) Any existing CFLAGS are clobered.

I'm not sure if the CFLAGS override approach is really the right way to go, but if it is, the following might work.

I guess it was not the correct fix =)

Yeah, I didn't take into account any predefined CFLAGS or MAKE. So your patch is much better.

Perhaps a better place to put the define is in the gdbserver-xen sparse directory's Makefile.in. That will narrow the scope of the define a bit. How does the following look to you? ...or something similar?

tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in +4 -1
diff -r 2017f6e92bf8 tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
@@ -92,13 +92,16 @@ GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS
 
 WARN_CFLAGS = -Wall
 
+# Xen specific CFLAGS
+XEN_CFLAGS = -D__XEN_TOOLS__
+
 # CFLAGS is specifically reserved for setting from the command line
 # when running make.  I.E.  "make CFLAGS=-Wmissing-prototypes".
 CFLAGS = @CFLAGS@
 
 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
 INTERNAL_CFLAGS =  $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
-	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
+	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} ${XEN_CFLAGS}
 
 # LDFLAGS is specifically reserved for setting from the command line
 # when running make.
tools/debugger/gdb/gdbbuild +2 -2
diff -r 2017f6e92bf8 tools/debugger/gdb/gdbbuild
@@ -18,7 +18,7 @@ if [ "$MAKE" ]; then
 if [ "$MAKE" ]; then
     $MAKE
 elif which gmake ; then
-    gmake -j4 CFLAGS=-D__XEN_TOOLS__
+    gmake -j4
 else
-    make -j4 CFLAGS=-D__XEN_TOOLS__
+    make -j4
 fi
#3 lore raw
Quoted 8 lines · Travis Betak

I guess it was not the correct fix =)

Yeah, I didn't take into account any predefined CFLAGS or MAKE. So your patch is much better.

Perhaps a better place to put the define is in the gdbserver-xen sparse directory's Makefile.in. That will narrow the scope of the define a bit. How does the following look to you? ...or something similar?

I just checked in a more general fix, which simply defines the macro in xenctrl.h if it isn't defined already.

-- Keir

#4 lore raw
Quoted 10 lines · Keir Fraser
Quoted 5 lines · Travis Betak

I guess it was not the correct fix =)

Yeah, I didn't take into account any predefined CFLAGS or MAKE. So your patch is much better.

Quoted 6 lines
Quoted 3 lines

Perhaps a better place to put the define is in the gdbserver-xen sparse directory's Makefile.in. That will narrow the scope of the define a bit. How does the following look to you? ...or something similar?

I just checked in a more general fix, which simply defines the macro in xenctrl.h if it isn't defined already.

Excellent, thanks.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#5 lore raw
In reply to Travis Betak
Quoted 23 lines · Travis Betak
Quoted 11 lines · Horms
Quoted 4 lines · Travis Betak

This may or may not be the correct place to put this fix but it does fix the following build error:

Hi Travis,

Ouch, that looks like a pretty horrible problem. Unfortunately I think your fix is broken on two counts.

Quoted 8 lines

1) It won't work if MAKE is defined, as $MAKE will be executed without CFLAGS doctoring

2) Any existing CFLAGS are clobered.

I'm not sure if the CFLAGS override approach is really the right way to go, but if it is, the following might work.

Quoted 8 lines

I guess it was not the correct fix =)

Yeah, I didn't take into account any predefined CFLAGS or MAKE. So your patch is much better.

Perhaps a better place to put the define is in the gdbserver-xen sparse directory's Makefile.in. That will narrow the scope of the define a bit. How does the following look to you? ...or something similar?

I like that idea a lot better. Does it work?

Quoted 40 lines

diff -r 2017f6e92bf8 tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
--- a/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in Thu Aug
31 14:46:28 2006 +0100
+++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in Thu Aug
31 13:17:18 2006 -0500

tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in +4 -1
@@ -92,13 +92,16 @@ GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS
 
 WARN_CFLAGS = -Wall
 
+# Xen specific CFLAGS
+XEN_CFLAGS = -D__XEN_TOOLS__
+
 # CFLAGS is specifically reserved for setting from the command line
 # when running make.  I.E.  "make CFLAGS=-Wmissing-prototypes".
 CFLAGS = @CFLAGS@
 
 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
 INTERNAL_CFLAGS =  $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
-	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
+	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} ${XEN_CFLAGS}
 
 # LDFLAGS is specifically reserved for setting from the command line
 # when running make.

diff -r 2017f6e92bf8 tools/debugger/gdb/gdbbuild

tools/debugger/gdb/gdbbuild +2 -2
@@ -18,7 +18,7 @@ if [ "$MAKE" ]; then
 if [ "$MAKE" ]; then
     $MAKE
 elif which gmake ; then
-    gmake -j4 CFLAGS=-D__XEN_TOOLS__
+    gmake -j4
 else
-    make -j4 CFLAGS=-D__XEN_TOOLS__
+    make -j4
 fi
Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#6 lore raw

Re: [PATCH] Fix gdbserver-xen build errorsA

Quoted 4 lines · Horms
Quoted 3 lines · Travis Betak

I guess it was not the correct fix =)

Quoted 8 lines
Quoted 6 lines

Yeah, I didn't take into account any predefined CFLAGS or MAKE. So your patch is much better.

Perhaps a better place to put the define is in the gdbserver-xen sparse directory's Makefile.in. That will narrow the scope of the define a bit. How does the following look to you? ...or something similar?

I like that idea a lot better. Does it work?

Well, it does but, as you saw, Keir checked in what is probably probably the best fix.

--travis

#7 lore raw

Re: [PATCH] Fix gdbserver-xen build errorsA

Quoted 10 lines · Travis Betak
Quoted 7 lines · Horms
Quoted 6 lines · Travis Betak

I guess it was not the correct fix =)

Yeah, I didn't take into account any predefined CFLAGS or MAKE. So your patch is much better.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Perhaps a better place to put the define is in the gdbserver-xen sparse directory's Makefile.in. That will narrow the scope of the define a bit. How does the following look to you? ...or something similar?

I like that idea a lot better. Does it work?

Well, it does but, as you saw, Keir checked in what is probably probably the best fix.

Yes, I think his idea is better still.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/