Subject: Re: EGCS / TARGET_MEM_FUNCTIONS
To: Todd Vierling <tv@pobox.com>
From: Erik Bertelsen <erik@mediator.uni-c.dk>
List: tech-toolchain
Date: 08/19/1998 10:00:30
While we are playing with EGCS, I have the following question/suggestion:
config/netbsd.h #defines TARGET_MEM_FUNCTIONS to implement struct copies,
etc. as calls to memcpy instead of bcopy. This is as expected in my
opinion.
config/alpha/netbsd.h also #defines TARGET_MEM_FUNCTIONS -- but isn't
this definition redundant ?
config/arm/netbsd.h and config/rs6000/netbsd.h actually #undefines
TARGET_MEM_FUNCTIONS, which I consider wrong (at least until told
otherwise). I discovered this a few days ago (with the previous
egcs 1.0x installed from the netbsd sources as a cross-compiler
for netbsd/ppc running on a powermac (linuxppc)), where I got
linker errors while building netbsd kernels caused by unsatisfied
external references to bcopy, some of which were implicit calls
generated by the compiler (e.g. for struct copying).
As libc has memxxx functions on all archs (my assumption) and as
the kernel is being updated to use mem- instead of b-functions,
we'll probably have to ensure that gcc doesn't generate calls to
bcopy on any archs.
If config/netbsd.h settings are used unless overridden in config/arch/netbsd.h,
my suggestion is to leave #define TARGET_MEM_FUNCTIONS in config/netbsd.h,
but to delete any #define/#undef TARGET_MEM_FUNCTIONS in all
config/arch/netbsd.h files.
- regards
Erik Bertelsen