Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:

This is an attempt to work-around a couple of nasty bugs in librdbg's
Makefiles and configuration:

Configure and build RTEMS as below:
  configure --enable-networking --enable-rdbg --target=i386-rtems
  make RTEMS_BSP=i386ex

After a few minutes you will notice that building aborts in librdbg ....

Analysis:

  1) librdbg is tried to be built, though librdbg is not supported and the
     required directory hierarchy librdbg/i386/i386ex/  is not existant.

     The cause for this is incorrect setting of HAS_RDBG in most
     make/custom/*.cfg files (except pc386.cfg). At the moment all
     custom/*.cfg files (except pc386.cfg) in general are required to contain
     HAS_RDBG=no. However, having HAS_NETWORKING=no in most custom/*.cfg
     files and the toplevel configure script suppress building librdbg for
     all CPUs except of i386.

     => The i386ex BSP falls though this scheme and librdbg is tried to be
        build (CPU=i386 and HAS_NETWORKING=yes).

  2) The Makefile.ins below lib/librdbg in general support i386/pc386 only
     and are not capable to be used for multiple CPUs or BSPs (RPCGEN
     generates it's target and bsp-specific files into librdbg/, therefore no
     other CPU or BSP can ever be built afterwards). This problem is hidden
     until now, because only a single CPU/BSP pair (i386/pc386) is really
     supported.

  3) The Makefile.ins below lib/librdbg can delete source files due to
     improper handling of source files (make clean removes the *.x files in
     the source-tree when configuring inside of the source-tree).


The patch below tries to work-around these problems for the i386ex and
the pc386 BSPs. This work-around is rather fragile (it applies rpcgen
-D, I don't know how portable this is) and incomplete (all custom/*.cfg
except of pc386.cfg should contain HAS_RDBG=no), nevertheless it should
work.
This commit is contained in:
Joel Sherrill
1999-04-19 13:11:13 +00:00
parent 4ad3d3727b
commit 9572c41d09
7 changed files with 17 additions and 167 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ pre_install_src: env make_src_makefiles
for i in `cat make_src_makefiles` ; do \
DIR=`dirname $$i`; \
cd $$DIR; \
$(MAKE) preinstall; \
$(MAKE) RTEMS_BSP=${RTEMS_BSP} preinstall; \
cd $$CURRDIR; \
done
+4 -82
View File
@@ -13,90 +13,12 @@ INSTALL = @INSTALL@
RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@
PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@:@srcdir@/$(RTEMS_CPU)
VPATH = @srcdir@
LIBNAME=librdbg.a
LIB=${ARCH}/${LIBNAME}
include $(RTEMS_ROOT)/make/custom/${RTEMS_BSP}.cfg
include $(RTEMS_ROOT)/make/directory.cfg
# C and C++ source names, if any, go here -- minus the .c or .cc
C_PIECES= rdbg servcon servbkpt servrpc excep \
servtgt servtsp servutil _servtgt rdbg_f \
ptrace
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
# Asm source names, if any, go here -- minus the .s
ASM_PIECES= rdbg_cpu_asm
ASM_FILES=$(ASM_PIECES:%=%.s)
ASM_O_FILES=$(ASM_PIECES:%=${ARCH}/%.o)
# Generated C source names, if any, go here -- minus the .c
C_GEN_PIECES= remdeb_xdr remdeb_svc
C_GEN_FILES=$(C_GEN_PIECES:%=%.c)
C_GEN_O_FILES=$(C_GEN_PIECES:%=${ARCH}/%.o)
# H source names, if any, go here -- minus the .h
H_PIECES=remdeb
H_FILES=$(H_PIECES:%=%.h)
# X source names, if any, go here -- minus the .x
X_FILE1=remdeb.x
X_FILE2=remdeb_f.x
X_FILES=$(X_FILE1) $(X_FILE2)
SRCS=$(C_FILES) $(ASM_FILES) $(C_GEN_FILES) $(H_FILES)
OBJS=$(C_GEN_O_FILES) $(C_O_FILES) $(ASM_O_FILES)
RPCGEN=@RPCGEN@
AWK=@AWK@
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/lib.cfg
#
# Add local stuff here using +=
#
DEFINES +=
CPPFLAGS +=
CFLAGS +=
#
# Add your list of files to delete here. The config files
# already know how to delete some stuff, so you may want
# to just run 'make clean' first to see what gets missed.
# 'make clobber' already includes 'make clean'
#
CLEAN_ADDITIONS += $(LIB) $(H_FILES) $(X_FILES) $(C_GEN_FILES)
CLOBBER_ADDITIONS +=
all: ${ARCH} $(LIB)
$(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
$(LIB): $(SRCS) ${OBJS}
$(make-library)
remdeb.h: $(X_FILES)
@rm -f $@
$(RPCGEN) -h remdeb.x -o $@
@rm -f $(PROJECT_INCLUDE)/rdbg/$@
$(INSTALL_CHANGE) -m 444 $@ $(PROJECT_INCLUDE)/rdbg
remdeb_xdr.c: $(X_FILES)
@rm -f $@
$(RPCGEN) -c remdeb.x -o $@
remdeb_svc.c: $(X_FILES)
@rm -f $@ tmpSvc.c
$(RPCGEN) -s udp remdeb.x -o tmpSvc.c
$(AWK) -f @srcdir@/awk.svc THEPROG="remdeb.h" tmpSvc.c >$@
@rm -f tmpSvc.c
preinstall:
@rm -f $(X_FILES)
@cp @srcdir@/$(X_FILE1) .
@cp @srcdir@/$(RTEMS_CPU)/$(RTEMS_BSP)/$(X_FILE2) .
SUB_DIRS=$(RTEMS_CPU)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
+1 -1
View File
@@ -107,7 +107,7 @@ enum ptracereq
RPT_PGETTHREADREGS = 85 /* portable version */
};
#include "remdeb_f.x"
#include FRONTEND
const MAXDEBUGGEE= 150;
const NAMEMAX = 17;
+4 -82
View File
@@ -13,90 +13,12 @@ INSTALL = @INSTALL@
RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@
PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@:@srcdir@/$(RTEMS_CPU)
VPATH = @srcdir@
LIBNAME=librdbg.a
LIB=${ARCH}/${LIBNAME}
include $(RTEMS_ROOT)/make/custom/${RTEMS_BSP}.cfg
include $(RTEMS_ROOT)/make/directory.cfg
# C and C++ source names, if any, go here -- minus the .c or .cc
C_PIECES= rdbg servcon servbkpt servrpc excep \
servtgt servtsp servutil _servtgt rdbg_f \
ptrace
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
# Asm source names, if any, go here -- minus the .s
ASM_PIECES= rdbg_cpu_asm
ASM_FILES=$(ASM_PIECES:%=%.s)
ASM_O_FILES=$(ASM_PIECES:%=${ARCH}/%.o)
# Generated C source names, if any, go here -- minus the .c
C_GEN_PIECES= remdeb_xdr remdeb_svc
C_GEN_FILES=$(C_GEN_PIECES:%=%.c)
C_GEN_O_FILES=$(C_GEN_PIECES:%=${ARCH}/%.o)
# H source names, if any, go here -- minus the .h
H_PIECES=remdeb
H_FILES=$(H_PIECES:%=%.h)
# X source names, if any, go here -- minus the .x
X_FILE1=remdeb.x
X_FILE2=remdeb_f.x
X_FILES=$(X_FILE1) $(X_FILE2)
SRCS=$(C_FILES) $(ASM_FILES) $(C_GEN_FILES) $(H_FILES)
OBJS=$(C_GEN_O_FILES) $(C_O_FILES) $(ASM_O_FILES)
RPCGEN=@RPCGEN@
AWK=@AWK@
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/lib.cfg
#
# Add local stuff here using +=
#
DEFINES +=
CPPFLAGS +=
CFLAGS +=
#
# Add your list of files to delete here. The config files
# already know how to delete some stuff, so you may want
# to just run 'make clean' first to see what gets missed.
# 'make clobber' already includes 'make clean'
#
CLEAN_ADDITIONS += $(LIB) $(H_FILES) $(X_FILES) $(C_GEN_FILES)
CLOBBER_ADDITIONS +=
all: ${ARCH} $(LIB)
$(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
$(LIB): $(SRCS) ${OBJS}
$(make-library)
remdeb.h: $(X_FILES)
@rm -f $@
$(RPCGEN) -h remdeb.x -o $@
@rm -f $(PROJECT_INCLUDE)/rdbg/$@
$(INSTALL_CHANGE) -m 444 $@ $(PROJECT_INCLUDE)/rdbg
remdeb_xdr.c: $(X_FILES)
@rm -f $@
$(RPCGEN) -c remdeb.x -o $@
remdeb_svc.c: $(X_FILES)
@rm -f $@ tmpSvc.c
$(RPCGEN) -s udp remdeb.x -o tmpSvc.c
$(AWK) -f @srcdir@/awk.svc THEPROG="remdeb.h" tmpSvc.c >$@
@rm -f tmpSvc.c
preinstall:
@rm -f $(X_FILES)
@cp @srcdir@/$(X_FILE1) .
@cp @srcdir@/$(RTEMS_CPU)/$(RTEMS_BSP)/$(X_FILE2) .
SUB_DIRS=$(RTEMS_CPU)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
+1 -1
View File
@@ -107,7 +107,7 @@ enum ptracereq
RPT_PGETTHREADREGS = 85 /* portable version */
};
#include "remdeb_f.x"
#include FRONTEND
const MAXDEBUGGEE= 150;
const NAMEMAX = 17;
+3
View File
@@ -25,6 +25,9 @@ CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
# to enable it.
HAS_NETWORKING=no
# This BSP does not support librdbg
HAS_RDBG=no
# This section makes the target dependent options file.
# NDEBUG (C library)
+3
View File
@@ -21,6 +21,9 @@ CPU_CFLAGS =
# -O4 is ok for RTEMS
CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
# This BSP does not support librdbg
HAS_RDBG=no
# This section makes the target dependent options file.
# NDEBUG (C library)