From 9572c41d0911684bdcd4c3d14c8b19ff8def65b3 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 19 Apr 1999 13:11:13 +0000 Subject: Patch from Ralf Corsepius : 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. --- c/Makefile.in | 2 +- c/src/lib/librdbg/Makefile.in | 86 ++----------------------------------------- c/src/lib/librdbg/remdeb.x | 2 +- c/src/librdbg/src/Makefile.in | 86 ++----------------------------------------- c/src/librdbg/src/remdeb.x | 2 +- make/custom/force386.cfg | 3 ++ make/custom/i386ex.cfg | 3 ++ 7 files changed, 17 insertions(+), 167 deletions(-) diff --git a/c/Makefile.in b/c/Makefile.in index 5c6a1f5926..0996b05732 100644 --- a/c/Makefile.in +++ b/c/Makefile.in @@ -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 diff --git a/c/src/lib/librdbg/Makefile.in b/c/src/lib/librdbg/Makefile.in index 50a2e2d3d4..1d1dcdc98a 100644 --- a/c/src/lib/librdbg/Makefile.in +++ b/c/src/lib/librdbg/Makefile.in @@ -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) \ diff --git a/c/src/lib/librdbg/remdeb.x b/c/src/lib/librdbg/remdeb.x index e4cb998ebc..86ce9efb37 100644 --- a/c/src/lib/librdbg/remdeb.x +++ b/c/src/lib/librdbg/remdeb.x @@ -107,7 +107,7 @@ enum ptracereq RPT_PGETTHREADREGS = 85 /* portable version */ }; -#include "remdeb_f.x" +#include FRONTEND const MAXDEBUGGEE= 150; const NAMEMAX = 17; diff --git a/c/src/librdbg/src/Makefile.in b/c/src/librdbg/src/Makefile.in index 50a2e2d3d4..1d1dcdc98a 100644 --- a/c/src/librdbg/src/Makefile.in +++ b/c/src/librdbg/src/Makefile.in @@ -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) \ diff --git a/c/src/librdbg/src/remdeb.x b/c/src/librdbg/src/remdeb.x index e4cb998ebc..86ce9efb37 100644 --- a/c/src/librdbg/src/remdeb.x +++ b/c/src/librdbg/src/remdeb.x @@ -107,7 +107,7 @@ enum ptracereq RPT_PGETTHREADREGS = 85 /* portable version */ }; -#include "remdeb_f.x" +#include FRONTEND const MAXDEBUGGEE= 150; const NAMEMAX = 17; diff --git a/make/custom/force386.cfg b/make/custom/force386.cfg index 10640dc2bb..57c832e2b9 100644 --- a/make/custom/force386.cfg +++ b/make/custom/force386.cfg @@ -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) diff --git a/make/custom/i386ex.cfg b/make/custom/i386ex.cfg index cb85c78fba..a3dee793eb 100644 --- a/make/custom/i386ex.cfg +++ b/make/custom/i386ex.cfg @@ -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) -- cgit v1.2.3