On processors for D ~ decoupling

Sean Kelly sean at f4.ca
Fri Apr 7 12:16:34 PDT 2006


Walter Bright wrote:
> 
> I know you're still bothered by the issue of C's IO being pulled in. I 
> have another utility for you - \dm\bin\libunres. Libunres will identify 
> any symbols unresolved by a library.

For reference, here's the result of running this utility on the Ares 
version of the DMD GC and DMD runtime, respectively.  The dependencies 
should be roughly equivalent to the appropriate portions of Phobos. 
Note that "_gc_*" "_thread_*" and "_on*" are defined by the GC or 
standard library:


C:\bin\dmd\lib>libunres dmdgc.lib
Unresolved externals:
_D6object6Object5opCmpFC6ObjectZi
_D6object6Object6toHashFZk
_D6object6Object8opEqualsFC6ObjectZi
_D6object6Object8toStringFZAa
__Class_6Object
__d_framehandler
__d_local_unwind2
__d_monitorenter
__d_monitorexit
__end
__except_list
__imp__GetCurrentThreadId at 0
__imp__VirtualAlloc at 16
__imp__VirtualFree at 12
__nullext
__vtbl_9ClassInfo
__xi_a
_calloc
_free
_malloc
_memcpy
_memmove
_memset
_onOutOfMemory
_realloc
_thread_init
_thread_needLock
_thread_resumeAll
_thread_scanAll
_thread_suspendAll


C:\bin\dmd\lib>libunres dmdrt.lib
Unresolved externals:
__Ccmp
__Dmain
__LCMP@
__LDIV@
__ModuleInfo_3std1c4math
__ModuleInfo_3std1c5ctype
__ModuleInfo_3std1c5stdio
__ModuleInfo_3std1c6stdarg
__ModuleInfo_3std1c6stddef
__ModuleInfo_3std1c6stdlib
__ModuleInfo_3std1c6string
__ModuleInfo_3std1c7stdbool
__ULDIV@
___alloca
___fpclassify_d
___fpclassify_f
___fpclassify_ld
__assert
__except_list
__fltused
__global_unwind
__imp__DeleteCriticalSection at 4
__imp__EnterCriticalSection at 4
__imp__InitializeCriticalSection at 4
__imp__LeaveCriticalSection at 4
__imp__QueryPerformanceCounter at 4
__imp__QueryPerformanceFrequency at 4
__imp__RaiseException at 16
__iob
__local_except_handler
_calloc
_exit
_fclose
_fgetc
_fopen
_fprintf
_free
_gc_calloc
_gc_free
_gc_init
_gc_malloc
_gc_realloc
_gc_setFinalizer
_gc_sizeOf
_gc_term
_isalpha
_isgraph
_isspace
_malloc
_memcmp
_memcpy
_memicmp
_memmove
_memset
_onArrayBoundsError
_onAssert
_onOutOfMemory
_onSwitchError
_onUnicodeError
_printf
_qsort
_sprintf
_strlen
_strtoul
_strtoull
_unmangle_ident


The ModuleInfo dependencies could be eliminated by explicitly declaring 
forward references to the appropriate C routines instead of importing 
the D header modules.  The remaining dependency list is really pretty 
minimal.  I am somewhat surprised to see printf in there, though--I must 
have missed a "debug" prefix somewhere.


Sean



More information about the Digitalmars-d-announce mailing list