Re: [Tack-devel] ACK compiles on NetBSD-macppc, sort of...
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: Perry E. M. <pe...@pi...> - 2006-07-21 20:14:00
|
"Gregory T. (tim) Kelly" <gt...@di...> writes: > At 8:53 AM -0400 7/21/06, Perry E. Metzger wrote: >>You should structure things so that ACK doesn't know what the type of >>off_t is -- different platforms have it different lengths. This is >>pretty straightforward to do, and POSIX conforming code does not need >>to know what length it is in general. > > Unfortunately off_t is defined in several of the ACK headers. Then remove it. That is POSIXly incorrect. Instead, any header that needs off_t defined should include it. > I've generally defeated this with directives: > > #if !defined(BSD) > #define long off_t > #endif Don't bother. It is wrong. Dike it out, and include the proper include file, or you won't have portable code. Remember ACK predates modern systems by quite some years. Much of what it does made sense 15 or 18 years ago, but not now. >>> and a deprecated function call (ftime, replaced by gettimeofday), >> >>It is in libcompat, but in general, you should make things stick to >>the lowest common denominator of modern POSIX. getttimeofday is >>available on just about everything. > > The final version of moncalls.c can be changed to reflect this. I > left ftime in place for pre-BSD4.2 systems. If you can find me a single pre-BSD4.2 system that's operating in the wild, I'd be interested to hear about it. Indeed, I'd be interested in hearing of any 4.2 system that is still booted. I suspect you would be hard pressed even to find an operating 4.3 system, though there are one or two vaxes that I know of that are sometimes booted into 4.3 for kicks. >>> I'm still trying to put the pieces together, but I think one step >>> that will initially prevent usability on BSD is going to be the >>> lack of an ack.out -> elf linker/converter. It took me a day or >>> two to realize ack.out is not a.out, but then again I'm a little >>> slow on the uptake. >> >>Well, this is an assembler issue, right? It should be straightforward >>to generate ELF instead of other formats. You pretty much *need* ELF >>on all modern platforms -- Linux and all the rest use ELF too. You >>probably also need to be able to properly embed debugging symbols... > > I can't answer that at this time. What is there to answer? :) > The platform specific converter (which I believe is in step 8) would > handle the ack.out->elf conversion. Going to ELF natively would > require breaking with the structure, if I understand the structure > correctly. You may not have much of a choice... > It is probably important to consider that Tanenbaum's group went > with multiple address space segmentation for a virtual memory model, > while the rest of the world went with singe address space paging. Er, huh???? > Rather than having to go through some of the very twisted hoops (and > at least on PPC 32-bit ELF, broken hoops) to achieve various memory > protections for each section, Minix just puts each section in its > own address space (segment). Er, the original Minix didn't have a choice, and modern Minix is demand paged, not segment swapped. All modern operating systems are demand paged. There isn't even support for segmentation on PPC -- the x86 alone of modern processors still sort of has it but it is a rather lame holdover in the architecture. Perry |