Skip to content
Merged

Crt0 #76

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ AC_CONFIG_FILES([
Makefile.conf
dj64.pc
dj64_s.pc
dj64static.pc
djdev64.pc
djstub64.pc
dj32.pc
Expand Down
2 changes: 0 additions & 2 deletions debian/dj64-dev-static.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
usr/lib/*/i386-pc-dj64/lib/libc_s.a
usr/lib/*/i386-pc-dj64/lib64/libdj64_s.a
usr/lib/*/pkgconfig/dj64_s.pc
usr/lib/*/pkgconfig/dj64static.pc
3 changes: 3 additions & 0 deletions demos/asmsimp/32/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ info: $(TGT)
run: $(TGT)
dosemu -dumb $<

runelf: tmp.elf
dosemu -dumb -l $< -g 1

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
ifeq ($(wildcard $(DJMK)),)
Expand Down
4 changes: 4 additions & 0 deletions demos/asmsimp/djgpp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ info: $(TGT)

run: $(TGT)
dosemu -t $<

runelf: $(TGT)
djstubify $<
dosemu -dumb $<
3 changes: 3 additions & 0 deletions demos/asmsimp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ info: $(TGT)
run: $(TGT)
dosemu -dumb $<

runelf: libtmp.so
dosemu -dumb -l $<

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
ifeq ($(wildcard $(DJMK)),)
Expand Down
3 changes: 3 additions & 0 deletions demos/file/32/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ info: $(TGT)
run: $(TGT)
dosemu -t $<

runelf: tmp.elf
dosemu -dumb -K . -E "elfexec2 $<"

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
ifeq ($(wildcard $(DJMK)),)
Expand Down
4 changes: 4 additions & 0 deletions demos/file/djgpp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ info: $(TGT)

run: $(TGT)
dosemu -t $<

runelf: $(TGT)
djstubify $<
dosemu -dumb $<
3 changes: 3 additions & 0 deletions demos/file/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ info: $(TGT)
run: $(TGT)
dosemu -t $<

runelf: libtmp.so
dosemu -dumb -K . -E "elfexec $<"

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
ifeq ($(wildcard $(DJMK)),)
Expand Down
5 changes: 4 additions & 1 deletion demos/hello/32/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ info: $(TGT)
djstubify -i $<

run: $(TGT)
dosemu -dumb -l $(realpath $<)
dosemu -dumb -l $(realpath $<) -g 1

runelf: tmp.elf
dosemu -dumb -l $< -g 1

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
Expand Down
4 changes: 4 additions & 0 deletions demos/hello/djgpp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ info: $(TGT)

run: $(TGT)
dosemu -dumb $<

runelf: $(TGT)
djstubify $<
dosemu -dumb $<
3 changes: 3 additions & 0 deletions demos/hello/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ info: $(TGT)
run: $(TGT)
dosemu -dumb -l $(realpath $<)

runelf: libtmp.so
dosemu -dumb -l $<

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
ifeq ($(wildcard $(DJMK)),)
Expand Down
3 changes: 3 additions & 0 deletions demos/helloasm/32/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ info: $(TGT)
run: $(TGT)
dosemu -dumb $<

runelf: tmp.elf
dosemu -dumb -l $< -g 1

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
ifeq ($(wildcard $(DJMK)),)
Expand Down
4 changes: 4 additions & 0 deletions demos/helloasm/djgpp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ info: $(TGT)

run: $(TGT)
dosemu -dumb $<

runelf: $(TGT)
djstubify $<
dosemu -dumb $<
3 changes: 3 additions & 0 deletions demos/helloasm/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ info: $(TGT)
run: $(TGT)
dosemu -dumb $<

runelf: libtmp.so
dosemu -dumb -l $<

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
ifeq ($(wildcard $(DJMK)),)
Expand Down
3 changes: 3 additions & 0 deletions demos/int86/32/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ info: $(TGT)
run: $(TGT)
dosemu -t $<

runelf: tmp.elf
dosemu -dumb -K . -E "elfexec2 $<"

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
ifeq ($(wildcard $(DJMK)),)
Expand Down
4 changes: 4 additions & 0 deletions demos/int86/djgpp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ info: $(TGT)

run: $(TGT)
dosemu -t $<

runelf: $(TGT)
djstubify $<
dosemu -dumb $<
3 changes: 3 additions & 0 deletions demos/int86/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ info: $(TGT)
run: $(TGT)
dosemu -t $<

runelf: libtmp.so
dosemu -dumb -K . -E "elfexec $<"

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
ifeq ($(wildcard $(DJMK)),)
Expand Down
5 changes: 5 additions & 0 deletions demos/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ clean:
$(foreach D,$(DEMOS),$(MAKE) -C $(D) clean;)
$(foreach D,$(DEMOS),$(MAKE) -C $(D)/32 clean;)

run runelf:
$(foreach D,$(DEMOS),$(MAKE) -C $(D) $@;)
$(foreach D,$(DEMOS),$(MAKE) -C $(D)/32 $@;)
$(foreach D,$(DEMOS),$(MAKE) -C $(D)/djgpp $@;)

rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))

src_install: clean djgpp/clean
Expand Down
3 changes: 3 additions & 0 deletions demos/rmcb/32/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ info: $(TGT)
run: $(TGT)
dosemu -t $<

runelf: tmp.elf
dosemu -dumb -l $< -g 1

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj32)
ifeq ($(wildcard $(DJMK)),)
Expand Down
4 changes: 4 additions & 0 deletions demos/rmcb/djgpp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ info: $(TGT)

run: $(TGT)
dosemu -t $<

runelf: $(TGT)
djstubify $<
dosemu -dumb $<
3 changes: 3 additions & 0 deletions demos/rmcb/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ info: $(TGT)
run: $(TGT)
dosemu -t $<

runelf: libtmp.so
dosemu -dumb -l $<

# hook in dj64 - make sure to not do that before defining `all:` target
DJMK = $(shell pkg-config --silence-errors --variable=makeinc dj64)
ifeq ($(wildcard $(DJMK)),)
Expand Down
15 changes: 5 additions & 10 deletions dj64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,9 @@ GLOB_ASM ?= $(wildcard glob_asm.h)

ifneq ($(AS_OBJECTS),)
XLDFLAGS = -melf_i386 -static
ifeq ($(DJ64STATIC),1)
S3 := $(shell pkg-config --static --libs dj64static)
ifneq ($(.SHELLSTATUS),0)
$(error dj64-dev-static not installed)
endif
XLDFLAGS += $(S3)
DJ64_XLDFLAGS += -f 0x4000
else
XLDFLAGS += $(shell pkg-config --variable=crt0 dj64) $(XLD_IMB)=$(LOADADDR)
endif
DJ64_XLDFLAGS += -f 0x8000

$(XELF).elf: $(AS_OBJECTS) $(PLT_O)
$(XLD) $^ $(XLDFLAGS) -o $@
$(XSTRIP) $@
Expand Down Expand Up @@ -183,14 +176,16 @@ export script = $(_script)

tmp.s:
@eval "$$script"
else
endif

ifeq ($(DJ64STATIC),1)
S2 := $(shell pkg-config --variable=crt0 dj64_s)
ifneq ($(.SHELLSTATUS),0)
$(error dj64-dev-static not installed)
endif
DJ64_XLDFLAGS += -l $(S2) -f 0x4000
else
ifeq ($(AS_OBJECTS),)
DJ64_XLDFLAGS += -f 0x80
endif
endif
Expand Down
2 changes: 0 additions & 2 deletions dj64dev.spec.rpkg
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ May be needed on non-glibc systems.

%files dj64-devel-static
%defattr(-,root,root)
%{_prefix}/i386-pc-dj64/lib/libc_s.a
%{_prefix}/i386-pc-dj64/lib64/libdj64_s.a
%{_libdir}/pkgconfig/dj64_s.pc
%{_libdir}/pkgconfig/dj64static.pc
%end

%package dj32-devel
Expand Down
5 changes: 0 additions & 5 deletions dj64static.pc.in

This file was deleted.

1 change: 1 addition & 0 deletions include/libc/stubinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@ _Static_assert(sizeof(_GO32_StubInfo) == STUBINFO_END, "size mismatch");

#define SIFLG_STATIC 0x40
#define SIFLG_ELFEXEC (1 << 16)
#define SIFLG_SPLITPL (1 << 17)

#endif /* __dj_include_stub_h__ */
10 changes: 3 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SHLIB_EXT = so
EXTRA_NC_CONFIGURE_FLAGS =
endif

DJLIBC = $(TOP)/lib/libc_s.a
DJLIBC32 = $(TOP)/lib/libc32_s.a
DJCRT0 = $(TOP)/lib/crt0.elf
DJUCRT0 = $(TOP)/lib/uplt.o
Expand Down Expand Up @@ -54,10 +53,10 @@ subs:
# New makes have a way to avoid parallel invocation with the use of &:
need = 4.3
ifneq ($(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))),)
$(DJ64DEVL) $(DJ32LIBS) $(DJLIBC) $(DJLIBC32) &: subs
$(DJ64DEVL) $(DJ32LIBS) $(DJLIBC32) &: subs
else
.NOTPARALLEL:
$(DJ64DEVL) $(DJ32LIBS) $(DJLIBC) $(DJLIBC32) : subs
$(DJ64DEVL) $(DJ32LIBS) $(DJLIBC32) : subs
endif
$(MAKE) -C src

Expand All @@ -68,15 +67,14 @@ djdev64: djdev64.pc djstub64.pc
$(MAKE) -C src/djdev64

ifeq ($(USE64),1)
DJ64PC = dj64.pc dj64_s.pc dj64static.pc
DJ64PC = dj64.pc dj64_s.pc
endif
DJ64PC += dj32.pc
dj64: $(DJ64PC) $(DJ64DEVL)

install_dj64:
ifeq ($(USE64),1)
$(INSTALL) -d $(DESTDIR)$(sysroot)/lib
$(INSTALL) -m 0644 $(DJLIBC) $(DESTDIR)$(sysroot)/lib
$(INSTALL) -m 0644 $(DJCRT0) $(DESTDIR)$(sysroot)/lib
$(INSTALL) -m 0644 $(DJUCRT0) $(DESTDIR)$(sysroot)/lib
$(INSTALL) -d $(DESTDIR)$(sysroot)/bin
Expand All @@ -94,7 +92,6 @@ ifeq ($(USE64),1)
$(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 0644 dj64.pc $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 0644 dj64_s.pc $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 0644 dj64static.pc $(DESTDIR)$(libdir)/pkgconfig
ifeq ($(NCURSES),1)
$(MAKE) -C $(NC_BUILD) install
endif
Expand Down Expand Up @@ -130,7 +127,6 @@ endif
$(RM) -r $(DESTDIR)$(includedir)/djdev64
$(RM) $(DESTDIR)$(libdir)/pkgconfig/dj64.pc
$(RM) $(DESTDIR)$(libdir)/pkgconfig/dj64_s.pc
$(RM) $(DESTDIR)$(libdir)/pkgconfig/dj64static.pc
$(MAKE) -C demos src_uninstall
endif

Expand Down
Loading
Loading