delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/04/20/00:37:27

Message-ID: <002d01c306f6$484d41d0$0100a8c0@acp42g>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Cc: <dborca AT yahoo DOT com>, <djgpp-workers AT delorie DOT com>
References: <10304190107 DOT AA25463 AT clio DOT rice DOT edu>
Subject: Re: dxe review
Date: Sun, 20 Apr 2003 14:35:32 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Reply-To: djgpp-workers AT delorie DOT com

> > Tomorrow I will play with the tests and see what I can do to some of the
> > packages that use the libiconv like grep 2.5.1
>
> I suggest building the DXE, then using dxe3res to create the interface
> layer (a C program).  Then compile it and put the obj into libiconv.a.
> To make it backward compatible with V2.03 you could also put a couple
> of the routines from libc into libiconv.

Finally had a play with the DXE test programs and they worked fine.

I tried two real world test with Allgro and Grep and unfortunatly both
failed as indicated below. Am I correct in my interpretation of the docs in
that the DXE code must not call code in LIBC which is linked with the app?
If I am wrong then any ideas on the problems below?

----------------------------------------------------------------------------
-----------
Test #1:
For my first real test I made a DXE for Allegeo. I used one of the small
examples as a test. The resulting exe crashed and burned as follows:-

DJ204 D:\dj204\test>test
LIBALLEG.DXE: module loading failed (unresolved symbol:
___dpmi_unlock_linear_region)
Abort!
Exiting due to signal SIGABRT
Raised at eip=0000f5f6
eax=0009c2f4 ebx=00000120 ecx=00017990 edx=00000008 esi=00008f38
edi=00001aec
ebp=0009c3bc esp=0009c2e4 program=D:\DJ204\TEST\TEST.EXE
cs: sel=01a7  base=02990000  limit=0018ffff
ds: sel=01af  base=02990000  limit=0018ffff
es: sel=01af  base=02990000  limit=0018ffff
fs: sel=017f  base=00006cc0  limit=0000ffff
gs: sel=01bf  base=00000000  limit=0010ffff
ss: sel=01af  base=02990000  limit=0018ffff
App stack: [0009c4e4..0001c4e4]  Exceptn stack: [0001c3b4..0001a474]

Call frame traceback EIPs:
  0x0000f506 __djgpp_traceback_exit+54, file dpmiexcp.c
  0x0000f5f6 raise+86, file dpmiexcp.c
  0x0000de20 abort+32, file abort.c
  0x0000dc5e _dlerrstatmod+94, file dxe3stat.c
  0x0000dd8f dlstatbind+159, file dxe3stat.c
  0x00001aba dlload_LIBALLEG+25, file fake
  0x0000db87 __crt1_startup+199, file crt1.c

DJ204 D:\dj204\test>symify test.exe

This is what I did to produce the exe and dxe files:-
dxe3gen -o LIBALLEG.DXE -I LIBALLEG_I.A --whole-archive -U LIBALLEG.A -D
"Allegro Graphics Library"
gcc -c -o test.O test.c
gcc -o TEST.EXE test.o LIBALLEG_I.A

----------------------------------------------------------------------------
-----------
Test #2:
As another test I tried to get Grep to use the libintl and libiconv as
DXE's, but this also failed.

Process:-
1) I generated the DXE files and ._I.A files as follows.
    dxe3gen -o libintl.DXE  -I libintl_I.A  --whole-archive -U libintl.A -D
"INTL Library"
    dxe3gen -o libiconv.DXE -I libiconv_I.A --whole-archive -U libiconv.A -D
"ICONV Library"
2) Copy the DXE  files into the gnu\grep\src directory
3) Modify the gnu\grep\src\makefile to use libintl_L.a and libiconv_I.a as
follows by changing one line in the makefile
Old:-  LDADD = -lintl -liconv ../lib/libgreputils.a
New:- LDADD = -lintl_I -liconv_I ../lib/libgreputils.a
4) Run "make" again

The following is the output from the resulting grep.exe:-
DJ204 D:\dj204\gnu\grep-2.51\src>grep
libintl.DXE: module loading failed (unresolved symbol: _getgid)
Abort!
Exiting due to signal SIGABRT
Raised at eip=0001e836
eax=000b7d94 ebx=00000120 ecx=0002faa0 edx=00000008 esi=0000cd44
edi=0000cacb
ebp=000b7e5c esp=000b7d84 program=D:\DJ204\GNU\GREP-2.51\SRC\GREP.EXE
cs: sel=01a7  base=02990000  limit=000bffff
ds: sel=01af  base=02990000  limit=000bffff
es: sel=01af  base=02990000  limit=000bffff
fs: sel=017f  base=00006cd0  limit=0000ffff
gs: sel=01bf  base=00000000  limit=0010ffff
ss: sel=01af  base=02990000  limit=000bffff
App stack: [000b7fb4..00037fb4]  Exceptn stack: [00037e54..00035f14]

Call frame traceback EIPs:
  0x0001e746 __djgpp_traceback_exit+54, file dpmiexcp.c
  0x0001e836 raise+86, file dpmiexcp.c
  0x00019510 abort+32, file abort.c
  0x0001caae _dlerrstatmod+94, file dxe3stat.c
  0x0001cbdf dlstatbind+159, file dxe3stat.c
  0x0000ca99 dlload_LIBINTL+25, file fake
  0x000182e7 __crt1_startup+199, file crt1.c

DJ204 D:\dj204\gnu\grep-2.51\src>symify grep.exe

Andrew


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019