Mail Archives: djgpp-workers/1998/07/05/08:51:46
The following summarizes my experience in building the latest alpha. Some
of the problems and patches overlap what was already reported here,
but I decided to leave them here anyway, so that DJ would have several
alternative solutions to choose from ;-).
For the record: I tried this on Windows 95.
Here are the problems I've seen (patches attached at the end):
- It ships with CROSS_BUILD=1, and uses CROSS_* in many places, which
fails for native DOS builds. It also echoes "gcc-dos" on DOS, which
is confusing. Patches attached.
- src/libc/compat/stdio/vfscanf.s is missing.
- If rebuilding libc indeed requires stubediting make.exe, how about
doing it automatically as part of the procedure?
- regcomp.c, regerror.c, engine.c regexec.c trigger numerous warnings.
- "Load error: no DOS memory" when compiling posix/unistd/execlp.c
(typing "make" after that picks up where the previous one left
off). Seems like Windows 95 DPMI host is leaking DOS memory.
Suggest to mention that in the instructions.
- makefile.inc builds libc/makefile.oh only when MAKEFILE_LIB != 1,
but makefile.lib sets MAKEFILE_LIB = 1, so if libc/makefile.oh is
deleted, it cannot be rebuilt. And "make clean" deletes it, so
after "make clean" you are in trouble.
The same happens for all immediate subdirectories of src/ (debug,
libemu, libm, etc.) I'm not sure how to fix this.
- mkdoc.exe always remakes libc2.tex, and info: always remakes
libc.info. Can't they have real dependencies, so they won't
regenerate files which already exist?
- The build process expects libgcc.a to be in $(TOP)/../lib. Patch
included to fix this.
- fsdb and stubedit emit warnings.
- ../hostbin/dxegen is built as a cross-executable on DOS (the name of
`ld' is only good for Unix). Patch included.
*** src/makefile.~0 Thu Jan 1 23:21:04 1998
--- src/makefile Sun Jul 5 12:12:08 1998
***************
*** 13,19 ****
../info \
../lib
! all : misc.exe $(DIRS) makemake.exe subs
misc.exe : misc.c
gcc -O2 misc.c -o misc.exe
--- 13,19 ----
../info \
../lib
! all : misc.exe $(DIRS) makemake.exe ../lib/libgcc.a subs
misc.exe : misc.c
gcc -O2 misc.c -o misc.exe
***************
*** 26,31 ****
--- 26,34 ----
copyrite.exe : copyrite.cc
gcc -O2 copyrite.cc -o copyrite.exe
+
+ ../lib/libgcc.a: $(DJDIR)/lib/libgcc.a misc.exe
+ ./misc.exe cp $< $@
subs:
$(MAKE) -C stub native
*** src/makefile.d~0 Sat May 30 18:17:16 1998
--- src/makefile.def Sun Jul 5 08:43:52 1998
***************
*** 14,20 ****
LD = ld
BISON = bison
! CROSS_BUILD = 1
! #CROSS_BUILD = 0
# You may need to replace coff-go32 with coff-i386 in lib/djgpp.djl
--- 14,20 ----
LD = ld
BISON = bison
! #CROSS_BUILD = 1
! CROSS_BUILD = 0
# You may need to replace coff-go32 with coff-i386 in lib/djgpp.djl
*** src/makefile.i~0 Sat May 30 21:33:24 1998
--- src/makefile.inc Sun Jul 5 09:40:24 1998
***************
*** 7,34 ****
.SUFFIXES: .o .i .c .cc .s
ifneq ($(CROSS_BUILD),1)
! XGCC = $(CROSS_GCC) @$(TOP)/../gcc.opt -I. -I- -I$(TOP)/../../include $(CFLAGS)
! XLGCC = $(CROSS_GCC) -s @$(TOP)/../gcc-l.opt -I. -I- -I$(TOP)/../../include $(CFLAGS)
else
GCC_OPT := $(shell cat $(TOP)/../gcc.opt)
GCCL_OPT := $(shell cat $(TOP)/../gcc-l.opt)
XGCC = $(CROSS_GCC) $(GCC_OPT) -I. -I- -I$(TOP)/../../include $(CFLAGS)
XLGCC = $(CROSS_GCC) $(GCCL_OPT) -I. -I- -I$(TOP)/../../include $(CFLAGS)
endif
MISC = $(TOP)/../misc.exe
%.o : %.c
! @$(MISC) echo - $(CROSS_GCC) '...' -c $<
@$(XGCC) -c $<
%.o : %.cc
! @$(MISC) echo - $(CROSS_GCC) '...' -c $<
@$(XGCC) -c $<
%.o : %.S
! @$(MISC) echo - $(CROSS_GCC) '...' -c $<
@$(XGCC) -c $<
%.o : %.s
! @$(MISC) echo - $(CROSS_GCC) '...' -c $<
@$(XGCC) -x assembler-with-cpp -c $<
%.i : %.c
--- 7,38 ----
.SUFFIXES: .o .i .c .cc .s
ifneq ($(CROSS_BUILD),1)
! XGCC = $(GCC) @$(TOP)/../gcc.opt -I. -I- -I$(TOP)/../../include $(CFLAGS)
! XLGCC = $(GCC) -s @$(TOP)/../gcc-l.opt -I. -I- -I$(TOP)/../../include $(CFLAGS)
! XLD = $(LD)
! GCC_NAME = $(GCC)
else
GCC_OPT := $(shell cat $(TOP)/../gcc.opt)
GCCL_OPT := $(shell cat $(TOP)/../gcc-l.opt)
XGCC = $(CROSS_GCC) $(GCC_OPT) -I. -I- -I$(TOP)/../../include $(CFLAGS)
XLGCC = $(CROSS_GCC) $(GCCL_OPT) -I. -I- -I$(TOP)/../../include $(CFLAGS)
+ XLD = $(CROSS_LD)
+ GCC_NAME = $(CROSS_GCC)
endif
MISC = $(TOP)/../misc.exe
%.o : %.c
! @$(MISC) echo - $(GCC_NAME) '...' -c $<
@$(XGCC) -c $<
%.o : %.cc
! @$(MISC) echo - $(GCC_NAME) '...' -c $<
@$(XGCC) -c $<
%.o : %.S
! @$(MISC) echo - $(GCC_NAME) '...' -c $<
@$(XGCC) -c $<
%.o : %.s
! @$(MISC) echo - $(GCC_NAME) '...' -c $<
@$(XGCC) -x assembler-with-cpp -c $<
%.i : %.c
***************
*** 54,60 ****
C = $(LIB)/crt0.o
L = $(LIB)/libc.a
! LINK = $(CROSS_LD) -s $(LDFLAGS) $(filter %.o,$^) $(filter-out %.o,$^) -o $@ ${LIB}/libgcc.a -T ${TOP}/../../lib/djgpp.djl
EXE = $(HOSTBIN)/stubify.exe $@
OBJS := $(addsuffix .o, $(basename $(SRC)))
--- 58,64 ----
C = $(LIB)/crt0.o
L = $(LIB)/libc.a
! LINK = $(XLD) -s $(LDFLAGS) $(filter %.o,$^) $(filter-out %.o,$^) -o $@ ${LIB}/libgcc.a -T ${TOP}/../../lib/djgpp.djl
EXE = $(HOSTBIN)/stubify.exe $@
OBJS := $(addsuffix .o, $(basename $(SRC)))
*** src/makefile.l~0 Thu Jan 1 21:10:04 1998
--- src/makefile.lib Sun Jul 5 09:23:56 1998
***************
*** 16,35 ****
include makefile.oi
endif
$(LIB)/lib$(LIBNAME).a : $(OBJS) makefile.rf $(TOP)/../ident.c
! $(CROSS_GCC) -c -DLIB=lib$(LIBNAME) $(TOP)/../ident.c -o id_$(LIBNAME).o
@-$(MISC) rm $@
ifeq ($(CROSS_BUILD),0)
! $(CROSS_AR) q $(LIB)/lib$(LIBNAME).a @makefile.rf id_$(LIBNAME).o
else
! $(CROSS_AR) q $(LIB)/lib$(LIBNAME).a `cat makefile.rf` id_$(LIBNAME).o
endif
! $(CROSS_AR) s $(LIB)/lib$(LIBNAME).a
newlib:
$(MISC) rm $(LIB)/lib$(LIBNAME).a
! $(CROSS_AR) q $(LIB)/lib$(LIBNAME).a @makefile.rf id_$(LIBNAME).o
! $(CROSS_AR) s $(LIB)/lib$(LIBNAME).a
clean ::
$(TOP)/../makemake.exe
--- 16,45 ----
include makefile.oi
endif
+ ifeq ($(CROSS_BUILD),0)
+ XAR = $(AR)
+ else
+ XAR = $(CROSS_AR)
+ endif
+
$(LIB)/lib$(LIBNAME).a : $(OBJS) makefile.rf $(TOP)/../ident.c
! $(XGCC) -c -DLIB=lib$(LIBNAME) $(TOP)/../ident.c -o id_$(LIBNAME).o
@-$(MISC) rm $@
ifeq ($(CROSS_BUILD),0)
! $(XAR) q $(LIB)/lib$(LIBNAME).a @makefile.rf id_$(LIBNAME).o
else
! $(XAR) q $(LIB)/lib$(LIBNAME).a `cat makefile.rf` id_$(LIBNAME).o
endif
! $(XAR) s $(LIB)/lib$(LIBNAME).a
newlib:
$(MISC) rm $(LIB)/lib$(LIBNAME).a
! ifeq ($(CROSS_BUILD),0)
! $(XAR) q $(LIB)/lib$(LIBNAME).a @makefile.rf id_$(LIBNAME).o
! else
! $(XAR) q $(LIB)/lib$(LIBNAME).a `cat makefile.rf` id_$(LIBNAME).o
! endif
! $(XAR) s $(LIB)/lib$(LIBNAME).a
clean ::
$(TOP)/../makemake.exe
*** src/dxe/makefile.~0 Thu Jan 1 23:25:10 1998
--- src/dxe/makefile Sun Jul 5 12:31:18 1998
***************
*** 16,22 ****
$(XLGCC) dxegen.c -o $@
$(HOSTBIN)/dxegen.exe : dxegen.c
! $(GCC) -DDXE_LD=\"$(CROSS_LD)\" dxegen.c -o $@
clean ::
@-$(MISC) rm *.o $(HOSTBIN)/dxegen.exe
--- 16,22 ----
$(XLGCC) dxegen.c -o $@
$(HOSTBIN)/dxegen.exe : dxegen.c
! $(GCC) -DDXE_LD=\"$(XLD)\" dxegen.c -o $@
clean ::
@-$(MISC) rm *.o $(HOSTBIN)/dxegen.exe
- Raw text -