Mail Archives: djgpp/1994/10/30/04:12:40
>>>>> On Sat, 29 Oct 1994 18:05:21 -0400 (EDT), Kimberley Burchett <OKRA AT max DOT tiac DOT net> said:
KB> On Sat, 29 Oct 1994, Dag Nummedal wrote:
> DJ Delorie (Apr 7 94):
> >I've just uploaded to ftp.cygnus.com:pub/dj the following files:
> >
> >-rw-r--r-- 1 97 20 9025 Apr 7 15:39 dll-940219.zip
>
> I don't know how stable the library is, but it should at least be a good
> starting point.
KB> I got this, but the makefile breaks with a segmentation violation. I
KB> assume this is from the C++ compiler and I tried downgrading to 1.11, but
KB> I could only find the C pieces - not the C++ ones. :/
KB> I'd go over the makefile to see what exactly is breaking, but my mind
KB> is not really working recently and when I tried it before I just got
KB> hopelessly confused.
KB> Kim
I have managed to make it work under 1.12, the main problem is that my
"nm" (from 1.12) using a different output format. The diff is appended
here.
BTW, I even tried use it under linux, the dlltest worked very well, so I
guess it is trival to run a djgpp program under linux, as long as it
only use the stdio functions. But I doubt how useful is this.
Oh, there is an another question, I don't know how a program can use a
global variable in dll.
diff -u --recursive dll/makefile /dos/djgpp/dll/makefile
--- dll/makefile Sat Feb 19 04:47:18 1994
+++ /dos/djgpp/dll/makefile Sun Oct 30 01:24:06 1994
@@ -12,11 +12,11 @@
libgrdll.o : libgrdll.s
as $^ -o $@
-libgrdll.s : mkdlllib.exe libgr.o
- mkdlllib.exe libgr.o libgrdll.s
+libgrdll.s : mkdlllib.exe libgrx.o
+ mkdlllib.exe libgrx.o libgrdll.s
-libgr.o : mkdlo.bat
- mkdlo /111/lib/libgr.a libgr.o
+libgrx.o : mkdlo.bat
+ mkdlo /djgpp/lib/libgrx.a libgrx.o
test.o : test.c
gcc -O2 -c test.c
@@ -34,10 +34,10 @@
gcc -o $@ $^
gccdll.h : mkdll.exe
- nm $(LIBRARY_PATH)/libgcc.a | sort -u | mkdll > gccdll.h
+ nm --demangle /djgpp/lib/libgcc.a | sort -u | mkdll > gccdll.h
-grdll.h : mkdll.exe libgr.o
- nm libgr.o | mkdll -u > grdll.h
+grdll.h : mkdll.exe libgrx.o
+ nm --demangle libgrx.o | mkdll -u > grdll.h
mkdll.exe : mkdll
coff2exe mkdll
diff -u --recursive dll/mkdll.cc /dos/djgpp/dll/mkdll.cc
--- dll/mkdll.cc Sat Feb 19 00:29:40 1994
+++ /dos/djgpp/dll/mkdll.cc Sun Oct 30 02:00:22 1994
@@ -3,6 +3,7 @@
char *invalids[] = {
"__builtin_saveregs",
+ "__udiv_w_sdiv",
0
};
@@ -11,9 +12,9 @@
void doit(char *buf)
{
char sn[300];
- if (buf[10] == 'g' && buf[12] == 'e')
+ if (buf[9] == 'T')
{
- sscanf(buf, "%*s %*s %*s %*s %*s _%s", sn);
+ strcpy(sn,buf + 11);
for (int i=0; invalids[i]; i++)
if (strcmp(invalids[i], sn) == 0)
return;
@@ -24,9 +25,9 @@
void doU(char *buf)
{
char sn[300];
- if (strncmp(buf+18, "*UND*", 5) == 0)
+ if (buf[9] == 'U')
{
- sscanf(buf, "%*s %*s %*s _%s", sn);
+ strcpy(sn,buf + 11);
printf("MKDLL(\"_%s\", %s)\n", sn, sn);
}
}
@@ -38,6 +39,7 @@
do_unds = 1;
while (fgets(buf, 300, stdin))
{
+ buf[strlen(buf)-1] = '\0';
if (do_unds)
doU(buf);
else
diff -u --recursive dll/mkdlllib.cc /dos/djgpp/dll/mkdlllib.cc
--- dll/mkdlllib.cc Sat Feb 19 00:41:36 1994
+++ /dos/djgpp/dll/mkdlllib.cc Sun Oct 30 00:15:48 1994
@@ -87,8 +87,9 @@
while (fgets(buf, 1000, p))
{
buf[strlen(buf)-1] = 0;
- if (isxdigit(buf[0]) && buf[10] == 'g' && buf[12] == 'e')
- emit(ofile, templ, buf+28);
+// if (isxdigit(buf[0]) && buf[10] == 'g' && buf[12] == 'e')
+ if (isxdigit(buf[0]) && buf[9] == 'T')
+ emit(ofile, templ, buf+11);
}
pclose(p);
fclose(ofile);
diff -u --recursive dll/mkdlo.bat /dos/djgpp/dll/mkdlo.bat
--- dll/mkdlo.bat Sat Feb 19 00:21:04 1994
+++ /dos/djgpp/dll/mkdlo.bat Sun Oct 30 02:01:08 1994
@@ -2,7 +2,7 @@
mkdir ltmp
cd ltmp
ar x %1
-ld -d -S -x -r -o ../%2 *.o
-del *.o
+ld -d -S -x -r -o ../%2 *.o *.oo
+del *.o *.oo
cd ..
rmdir ltmp
---
Dong Liu <dliu AT ace DOT njit DOT edu>
Electrical and Computer Engineering Department
New Jersey Institute of Technology, Newark, NJ 07102
- Raw text -