1 diff -rub ./include/architecture/i386/fpu.h ./include/architecture/i386/fpu.h
2 --- ./include/architecture/i386/fpu.h Thu May 6 19:24:30 1999
3 +++ ./include/architecture/i386/fpu.h Mon Aug 25 12:56:22 2003
8 -#import <architecture/i386/sel.h>
9 +#include <architecture/i386/sel.h>
12 * Floating point 'environment'
13 diff -rub ./include/architecture/i386/frame.h ./include/architecture/i386/frame.h
14 --- ./include/architecture/i386/frame.h Thu May 6 19:24:33 1999
15 +++ ./include/architecture/i386/frame.h Mon Aug 25 12:56:22 2003
20 -#import <architecture/i386/sel.h>
21 +#include <architecture/i386/sel.h>
24 * The actual hardware exception frame
25 diff -rub ./include/architecture/m88k/fp_regs.h ./include/architecture/m88k/fp_regs.h
26 --- ./include/architecture/m88k/fp_regs.h Wed Oct 9 18:47:37 2002
27 +++ ./include/architecture/m88k/fp_regs.h Mon Aug 25 12:56:22 2003
29 #ifndef _ARCH_M88K_FP_REGS_H_
30 #define _ARCH_M88K_FP_REGS_H_
32 -#import <architecture/m88k/reg_help.h>
33 +#include <architecture/m88k/reg_help.h>
36 * m88k_xrf_t -- data types that MAY be in extended register file
37 diff -rub ./include/architecture/m88k/reg_help.h ./include/architecture/m88k/reg_help.h
38 --- ./include/architecture/m88k/reg_help.h Wed Oct 9 18:47:39 2002
39 +++ ./include/architecture/m88k/reg_help.h Mon Aug 25 12:56:22 2003
41 #ifndef _ARCH_M88K_REG_HELP_H_
42 #define _ARCH_M88K_REG_HELP_H_
44 -#import <architecture/nrw/reg_help.h>
45 +#include <architecture/nrw/reg_help.h>
47 /* Stack pointer must always be a multiple of 16 */
49 diff -rub ./include/mach/m88k/thread_status.h ./include/mach/m88k/thread_status.h
50 --- ./include/mach/m88k/thread_status.h Wed Oct 9 18:48:16 2002
51 +++ ./include/mach/m88k/thread_status.h Mon Aug 25 12:56:22 2003
53 #ifndef _MACH_M88K_THREAD_STATE_
54 #define _MACH_M88K_THREAD_STATE_
56 -#import <architecture/m88k/fp_regs.h>
57 -#import <architecture/m88k/reg_help.h>
58 +#include <architecture/m88k/fp_regs.h>
59 +#include <architecture/m88k/reg_help.h>
61 /**************************************************************************
62 * Data Typedefs used by thread_getstatus() and thread_setstatus() *
63 diff -rub ./include/mach/machine.h ./include/mach/machine.h
64 --- ./include/mach/machine.h Mon Feb 10 19:52:25 2003
65 +++ ./include/mach/machine.h Mon Aug 25 12:56:22 2003
67 #ifndef _MACH_MACHINE_H_
68 #define _MACH_MACHINE_H_
70 -#import <mach/machine/vm_types.h>
71 -#import <mach/boolean.h>
72 +#include <mach/machine/vm_types.h>
73 +#include <mach/boolean.h>
76 * For each host, there is a maximum possible number of
77 diff -rub ./include/mach-o/hppa/swap.h ./include/mach-o/hppa/swap.h
78 --- ./include/mach-o/hppa/swap.h Thu May 6 19:25:11 1999
79 +++ ./include/mach-o/hppa/swap.h Mon Aug 25 12:56:22 2003
82 * @APPLE_LICENSE_HEADER_END@
84 -#import <architecture/byte_order.h>
85 -#import <mach/hppa/thread_status.h>
86 +#include <architecture/byte_order.h>
87 +#include <mach/hppa/thread_status.h>
89 extern void swap_hppa_integer_thread_state(
90 struct hp_pa_integer_thread_state *regs,
91 diff -rub ./include/mach-o/i860/swap.h ./include/mach-o/i860/swap.h
92 --- ./include/mach-o/i860/swap.h Thu May 6 19:25:19 1999
93 +++ ./include/mach-o/i860/swap.h Mon Aug 25 12:56:22 2003
96 * @APPLE_LICENSE_HEADER_END@
98 -#import <architecture/byte_order.h>
99 -#import <mach/i860/thread_status.h>
100 +#include <architecture/byte_order.h>
101 +#include <mach/i860/thread_status.h>
103 extern void swap_i860_thread_state_regs(
104 struct i860_thread_state_regs *cpu,
105 diff -rub ./include/mach-o/m68k/swap.h ./include/mach-o/m68k/swap.h
106 --- ./include/mach-o/m68k/swap.h Thu May 6 19:25:26 1999
107 +++ ./include/mach-o/m68k/swap.h Mon Aug 25 12:56:22 2003
110 * @APPLE_LICENSE_HEADER_END@
112 -#import <architecture/byte_order.h>
113 -#import <mach/m68k/thread_status.h>
114 +#include <architecture/byte_order.h>
115 +#include <mach/m68k/thread_status.h>
117 extern void swap_m68k_thread_state_regs(
118 struct m68k_thread_state_regs *cpu,
119 diff -rub ./include/mach-o/m88k/swap.h ./include/mach-o/m88k/swap.h
120 --- ./include/mach-o/m88k/swap.h Thu May 6 19:25:31 1999
121 +++ ./include/mach-o/m88k/swap.h Mon Aug 25 12:56:22 2003
124 * @APPLE_LICENSE_HEADER_END@
126 -#import <architecture/byte_order.h>
127 -#import <mach/m88k/thread_status.h>
128 +#include <architecture/byte_order.h>
129 +#include <mach/m88k/thread_status.h>
131 extern void swap_m88k_thread_state_grf_t(
132 m88k_thread_state_grf_t *cpu,
133 diff -rub ./include/mach-o/rld.h ./include/mach-o/rld.h
134 --- ./include/mach-o/rld.h Tue Oct 2 15:19:03 2001
135 +++ ./include/mach-o/rld.h Mon Aug 25 12:56:22 2003
137 #ifndef _MACHO_RLD_H_
138 #define _MACHO_RLD_H_
140 -#include <streams/streams.h>
141 +//~ #include <streams/streams.h>
142 #include <mach-o/loader.h>
144 extern long rld_load(
145 diff -rub ./include/mach-o/sparc/swap.h ./include/mach-o/sparc/swap.h
146 --- ./include/mach-o/sparc/swap.h Thu May 6 19:25:56 1999
147 +++ ./include/mach-o/sparc/swap.h Mon Aug 25 12:56:22 2003
150 * @APPLE_LICENSE_HEADER_END@
152 -#import <architecture/byte_order.h>
153 -#import <mach/sparc/thread_status.h>
154 +#include <architecture/byte_order.h>
155 +#include <mach/sparc/thread_status.h>
157 void swap_sparc_thread_state_regs(
158 struct sparc_thread_state_regs *cpu,
159 diff -rub ./include/standalone/libsa.h ./include/standalone/libsa.h
160 --- ./include/standalone/libsa.h Mon Sep 11 15:03:00 2000
161 +++ ./include/standalone/libsa.h Mon Aug 25 12:56:22 2003
164 /* Exported API for standalone library */
165 #if !(defined(KLD) && defined(__STATIC__))
166 -#import <mach/mach.h>
167 +#include <mach/mach.h>
168 #else /* defined(KLD) && defined(__STATIC__) */
169 #include <mach/kern_return.h>
170 #endif /* !(defined(KLD) && defined(__STATIC__)) */
171 -#import <mach-o/loader.h>
174 +#include <mach-o/loader.h>
180 diff -rub ./include/stuff/allocate.h ./include/stuff/allocate.h
181 --- ./include/stuff/allocate.h Thu May 6 19:26:24 1999
182 +++ ./include/stuff/allocate.h Mon Aug 25 13:08:44 2003
185 * @APPLE_LICENSE_HEADER_END@
187 -#if defined(__MWERKS__) && !defined(__private_extern__)
188 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
189 #define __private_extern__ __declspec(private_extern)
190 +#elif ( defined(__linux__) && !defined(__private_extern__) )
191 +#define __private_extern__ extern
194 /* defined in allocate.c */
195 diff -rub ./include/stuff/arch.h ./include/stuff/arch.h
196 --- ./include/stuff/arch.h Mon Nov 19 12:09:40 2001
197 +++ ./include/stuff/arch.h Mon Aug 25 13:10:15 2003
199 #ifndef _STUFF_ARCH_H_
200 #define _STUFF_ARCH_H_
202 -#if defined(__MWERKS__) && !defined(__private_extern__)
203 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
204 #define __private_extern__ __declspec(private_extern)
205 +#elif ( defined(__linux__) && !defined(__private_extern__) )
206 +#define __private_extern__ extern
209 * This file contains the current known set of flags and constants for the
210 * known architectures.
212 -#import <mach/machine.h>
213 -#import <stuff/bytesex.h>
214 +#include <mach/machine.h>
215 +#include <stuff/bytesex.h>
218 * The structure describing an architecture flag with the string of the flag
219 diff -rub ./include/stuff/best_arch.h ./include/stuff/best_arch.h
220 --- ./include/stuff/best_arch.h Thu May 6 19:26:29 1999
221 +++ ./include/stuff/best_arch.h Mon Aug 25 13:10:13 2003
224 * @APPLE_LICENSE_HEADER_END@
226 -#if defined(__MWERKS__) && !defined(__private_extern__)
227 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
228 #define __private_extern__ __declspec(private_extern)
229 +#elif ( defined(__linux__) && !defined(__private_extern__) )
230 +#define __private_extern__ extern
233 #include <mach/machine.h>
234 diff -rub ./include/stuff/breakout.h ./include/stuff/breakout.h
235 --- ./include/stuff/breakout.h Mon May 6 14:03:46 2002
236 +++ ./include/stuff/breakout.h Mon Aug 25 13:10:12 2003
239 * @APPLE_LICENSE_HEADER_END@
241 -#if defined(__MWERKS__) && !defined(__private_extern__)
242 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
243 #define __private_extern__ __declspec(private_extern)
244 +#elif ( defined(__linux__) && !defined(__private_extern__) )
245 +#define __private_extern__ extern
248 -#import "stuff/ofile.h"
249 +#include "stuff/ofile.h"
252 * The input files are broken out in to their object files and then placed in
253 diff -rub ./include/stuff/bytesex.h ./include/stuff/bytesex.h
254 --- ./include/stuff/bytesex.h Mon Nov 19 12:09:42 2001
255 +++ ./include/stuff/bytesex.h Mon Aug 25 13:10:10 2003
257 #ifndef _STUFF_BYTESEX_H_
258 #define _STUFF_BYTESEX_H_
260 -#if defined(__MWERKS__) && !defined(__private_extern__)
261 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
262 #define __private_extern__ __declspec(private_extern)
263 +#elif ( defined(__linux__) && !defined(__private_extern__) )
264 +#define __private_extern__ extern
267 -#import <mach-o/fat.h>
268 -#import <mach-o/loader.h>
269 -#import <mach/m68k/thread_status.h>
270 -#import <mach/ppc/thread_status.h>
271 -#import <mach/m88k/thread_status.h>
272 -#import <mach/i860/thread_status.h>
273 -#import <mach/i386/thread_status.h>
274 -#import <mach/hppa/thread_status.h>
275 -#import <mach/sparc/thread_status.h>
276 -#import <mach-o/nlist.h>
277 -#import <mach-o/reloc.h>
278 -#import <mach-o/ranlib.h>
279 -#import "stuff/bool.h"
280 +#include <mach-o/fat.h>
281 +#include <mach-o/loader.h>
282 +#include <mach/m68k/thread_status.h>
283 +#include <mach/ppc/thread_status.h>
284 +#include <mach/m88k/thread_status.h>
285 +#include <mach/i860/thread_status.h>
286 +#include <mach/i386/thread_status.h>
287 +#include <mach/hppa/thread_status.h>
288 +#include <mach/sparc/thread_status.h>
289 +#include <mach-o/nlist.h>
290 +#include <mach-o/reloc.h>
291 +#include <mach-o/ranlib.h>
292 +#include "stuff/bool.h"
296 diff -rub ./include/stuff/errors.h ./include/stuff/errors.h
297 --- ./include/stuff/errors.h Thu May 6 19:26:40 1999
298 +++ ./include/stuff/errors.h Mon Aug 25 13:09:00 2003
301 * @APPLE_LICENSE_HEADER_END@
303 -#if defined(__MWERKS__) && !defined(__private_extern__)
304 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
305 #define __private_extern__ __declspec(private_extern)
306 +#elif ( defined(__linux__) && !defined(__private_extern__) )
307 +#define __private_extern__ extern
310 -#import "mach/mach.h"
311 +#include "mach/mach.h"
313 /* user defined (imported) */
314 __private_extern__ char *progname;
315 diff -rub ./include/stuff/execute.h ./include/stuff/execute.h
316 --- ./include/stuff/execute.h Thu May 6 19:26:42 1999
317 +++ ./include/stuff/execute.h Mon Aug 25 13:10:04 2003
320 * @APPLE_LICENSE_HEADER_END@
322 -#if defined(__MWERKS__) && !defined(__private_extern__)
323 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
324 #define __private_extern__ __declspec(private_extern)
325 +#elif ( defined(__linux__) && !defined(__private_extern__) )
326 +#define __private_extern__ extern
330 diff -rub ./include/stuff/hash_string.h ./include/stuff/hash_string.h
331 --- ./include/stuff/hash_string.h Thu May 6 19:26:45 1999
332 +++ ./include/stuff/hash_string.h Mon Aug 25 13:10:32 2003
335 * @APPLE_LICENSE_HEADER_END@
337 -#if defined(__MWERKS__) && !defined(__private_extern__)
338 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
339 #define __private_extern__ __declspec(private_extern)
340 +#elif ( defined(__linux__) && !defined(__private_extern__) )
341 +#define __private_extern__ extern
344 __private_extern__ long hash_string(
345 diff -rub ./include/stuff/hppa.h ./include/stuff/hppa.h
346 --- ./include/stuff/hppa.h Thu May 6 19:26:47 1999
347 +++ ./include/stuff/hppa.h Mon Aug 25 13:10:40 2003
350 * @APPLE_LICENSE_HEADER_END@
352 -#if defined(__MWERKS__) && !defined(__private_extern__)
353 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
354 #define __private_extern__ __declspec(private_extern)
355 +#elif ( defined(__linux__) && !defined(__private_extern__) )
356 +#define __private_extern__ extern
359 __private_extern__ void calc_hppa_HILO(
360 diff -rub ./include/stuff/ofile.h ./include/stuff/ofile.h
361 --- ./include/stuff/ofile.h Mon Feb 10 19:52:33 2003
362 +++ ./include/stuff/ofile.h Mon Aug 25 13:10:51 2003
364 #ifndef _STUFF_OFILE_H_
365 #define _STUFF_OFILE_H_
367 -#if defined(__MWERKS__) && !defined(__private_extern__)
368 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
369 #define __private_extern__ __declspec(private_extern)
370 +#elif ( defined(__linux__) && !defined(__private_extern__) )
371 +#define __private_extern__ extern
377 #define AR_EFMT1 "#1/" /* extended format #1 */
379 -#import <mach-o/loader.h>
380 +#include <mach-o/loader.h>
382 -#import <mach-o/dyld.h>
383 +#include <mach-o/dyld.h>
385 -#import "stuff/bytesex.h"
386 -#import "stuff/bool.h"
387 -#import "stuff/arch.h"
388 +#include "stuff/bytesex.h"
389 +#include "stuff/bool.h"
390 +#include "stuff/arch.h"
394 diff -rub ./include/stuff/print.h ./include/stuff/print.h
395 --- ./include/stuff/print.h Thu May 6 19:26:55 1999
396 +++ ./include/stuff/print.h Mon Aug 25 13:10:58 2003
399 * @APPLE_LICENSE_HEADER_END@
401 -#if defined(__MWERKS__) && !defined(__private_extern__)
402 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
403 #define __private_extern__ __declspec(private_extern)
404 +#elif ( defined(__linux__) && !defined(__private_extern__) )
405 +#define __private_extern__ extern
411 __private_extern__ void print(
412 const char *format, ...)
413 diff -rub ./include/stuff/reloc.h ./include/stuff/reloc.h
414 --- ./include/stuff/reloc.h Thu May 6 19:26:57 1999
415 +++ ./include/stuff/reloc.h Mon Aug 25 13:11:02 2003
418 * @APPLE_LICENSE_HEADER_END@
420 -#if defined(__MWERKS__) && !defined(__private_extern__)
421 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
422 #define __private_extern__ __declspec(private_extern)
423 +#elif ( defined(__linux__) && !defined(__private_extern__) )
424 +#define __private_extern__ extern
427 -#import <mach/machine.h>
428 -#import "stuff/bool.h"
429 +#include <mach/machine.h>
430 +#include "stuff/bool.h"
432 __private_extern__ unsigned long reloc_pair_r_type(
434 diff -rub ./include/stuff/round.h ./include/stuff/round.h
435 --- ./include/stuff/round.h Fri Mar 14 18:18:29 2003
436 +++ ./include/stuff/round.h Mon Aug 25 13:11:06 2003
439 * @APPLE_LICENSE_HEADER_END@
441 -#if defined(__MWERKS__) && !defined(__private_extern__)
442 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
443 #define __private_extern__ __declspec(private_extern)
444 +#elif ( defined(__linux__) && !defined(__private_extern__) )
445 +#define __private_extern__ extern
449 diff -rub ./include/stuff/symbol_list.h ./include/stuff/symbol_list.h
450 --- ./include/stuff/symbol_list.h Thu Oct 24 17:04:30 2002
451 +++ ./include/stuff/symbol_list.h Mon Aug 25 13:19:46 2003
453 #include <mach-o/nlist.h>
454 #include <stuff/bool.h>
456 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
457 +#define __private_extern__ __declspec(private_extern)
458 +#elif ( defined(__linux__) && !defined(__private_extern__) )
459 +#define __private_extern__ extern
463 * Data structures to perform selective stripping of symbol table entries.
465 diff -rub ./include/stuff/vm_flush_cache.h ./include/stuff/vm_flush_cache.h
466 --- ./include/stuff/vm_flush_cache.h Thu May 6 19:27:05 1999
467 +++ ./include/stuff/vm_flush_cache.h Mon Aug 25 13:11:15 2003
470 * @APPLE_LICENSE_HEADER_END@
472 -#if defined(__MWERKS__) && !defined(__private_extern__)
473 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
474 #define __private_extern__ __declspec(private_extern)
475 +#elif ( defined(__linux__) && !defined(__private_extern__) )
476 +#define __private_extern__ extern
479 -#import <mach/mach.h>
480 +#include <mach/mach.h>
481 __private_extern__ kern_return_t vm_flush_cache(
482 mach_port_t target_task,
483 vm_address_t address,
484 diff -rub ./ld/Makefile ./ld/Makefile
485 --- ./ld/Makefile Fri Mar 14 18:18:29 2003
486 +++ ./ld/Makefile Sat Sep 6 20:17:46 2003
488 -DKERNEL -DKERNEL_PRIVATE -DAPPLE -DNeXT -DLIBSA_PRIVATE
491 -MIG = $(NEXT_ROOT)/usr/bin/mig
494 ifeq "macos" "$(RC_OS)"
495 - X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] && \
496 + X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] && \
497 [ "$(RC_RELEASE)" != "Bunsen" ] && \
498 [ "$(RC_RELEASE)" != "Gonzo" ] && \
499 [ "$(RC_RELEASE)" != "Kodiak" ]; then \
503 ifneq "mwccppc" "$(notdir $(CC))"
504 + ifeq "Linux" "$(shell uname)"
505 + GCC_FLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../../macosx-include
507 GCC_FLAGS = -Wall $(X_CFLAGS)
511 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
512 +# Hack: Add ../misc to the path because it contains seg_hack and ver_string
513 +ifneq ($(findstring ../misc,$(PATH)),../misc)
514 + PATH:=../misc:../../misc:$(PATH)
517 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
518 echo YES ; else echo NO ; \
522 fvmlibs.c layout.c specs.c pass2.c generic_reloc.c rld.c sets.c \
523 4byte_literals.c 8byte_literals.c literal_pointers.c dylibs.c \
524 indirect_sections.c mod_sections.c i860_reloc.c ppc_reloc.c \
525 - m88k_reloc.c hppa_reloc.c sparc_reloc.c coalesced_sections.c
526 + m88k_reloc.c hppa_reloc.c sparc_reloc.c coalesced_sections.c fake-mach.c
527 OBJS = $(CFILES:.c=.o)
528 INSTALL_FILES = $(CFILES) $(HFILES) Makefile notes \
529 make.defs make_defs.h librld.ofileList
531 makeUser.c ld.c: make.h
533 make.h makeUser.c: make.defs
534 - $(MIG) $(MIG_FLAGS) $(SRCROOT)/make.defs
536 + #~ $(MIG) $(MIG_FLAGS) $(SRCROOT)/make.defs
537 + #~ rm -f makeServer.c
538 + cp $(SRCROOT)/makeUser.c .
541 ifeq "mwccppc" "$(notdir $(CC))"
542 diff -rub ./ld/layout.c ./ld/layout.c
543 --- ./ld/layout.c Wed May 28 18:29:27 2003
544 +++ ./ld/layout.c Mon Aug 25 23:22:05 2003
546 #include "stuff/openstep_mach.h"
547 #include <mach-o/fat.h>
548 #include <mach-o/loader.h>
549 -#import <mach/m68k/thread_status.h>
550 -#import <mach/ppc/thread_status.h>
551 -#import <mach/m88k/thread_status.h>
552 -#import <mach/i860/thread_status.h>
553 -#import <mach/i386/thread_status.h>
554 -#import <mach/hppa/thread_status.h>
555 -#import <mach/sparc/thread_status.h>
556 +#include <mach/m68k/thread_status.h>
557 +#include <mach/ppc/thread_status.h>
558 +#include <mach/m88k/thread_status.h>
559 +#include <mach/i860/thread_status.h>
560 +#include <mach/i386/thread_status.h>
561 +#include <mach/hppa/thread_status.h>
562 +#include <mach/sparc/thread_status.h>
563 #include <mach-o/nlist.h>
564 #include <mach-o/reloc.h>
566 +#include <mach/kern_return.h>
568 #if defined(RLD) && !defined(SA_RLD) && !(defined(KLD) && defined(__STATIC__))
569 +typedef void NXStream;
570 #include <mach-o/rld.h>
571 -#include <streams/streams.h>
572 +//~ #include <streams/streams.h>
573 #endif /* defined(RLD) && !defined(SA_RLD) &&
574 !(defined(KLD) && defined(__STATIC__)) */
575 #include "stuff/arch.h"
578 #include "mach-o/sarld.h"
579 #include "indirect_sections.h"
581 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
582 +#define __private_extern__ __declspec(private_extern)
583 +#elif ( defined(__linux__) && !defined(__private_extern__) )
584 +#define __private_extern__ extern
587 +/** gcc on Linux defines powerpc, if we are compiling on a powerpc. */
591 __private_extern__ long RLD_DEBUG_OUTPUT_FILENAME_flag;
592 diff -rub ./ld/rld.c ./ld/rld.c
593 --- ./ld/rld.c Wed May 28 18:29:32 2003
594 +++ ./ld/rld.c Mon Aug 25 22:11:47 2003
596 #include "stuff/openstep_mach.h"
597 #include <mach-o/fat.h>
598 #include <mach-o/nlist.h>
601 #include <mach-o/kld.h>
602 -#else /* !defined(KLD) */
604 +//~ #else /* !defined(KLD) */
605 +typedef void NXStream;
606 #include <mach-o/rld.h>
607 -#include <streams/streams.h>
608 +//~ #include <streams/streams.h>
609 #include <objc/zone.h>
611 #include <mach-o/rld_state.h>
612 diff -rub ./libstuff/Makefile ./libstuff/Makefile
613 --- ./libstuff/Makefile Fri Mar 14 18:18:30 2003
614 +++ ./libstuff/Makefile Sat Sep 6 20:12:21 2003
618 ifeq "macos" "$(RC_OS)"
619 - X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] && \
620 + X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] && \
621 [ "$(RC_RELEASE)" != "Bunsen" ] && \
622 [ "$(RC_RELEASE)" != "Gonzo" ] && \
623 [ "$(RC_RELEASE)" != "Kodiak" ]; then \
628 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
629 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
630 echo YES ; else echo NO ; \
633 ifeq "mwccppc" "$(notdir $(CC))"
634 CFLAGS = $(OFLAG) -g -gccinc -I$(SRCROOT)/../include
636 + ifeq "Linux" "$(shell uname)"
637 + CFLAGS = $(OFLAG) -g -I$(SRCROOT)/../include -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../../macosx-include
639 CFLAGS = $(OFLAG) -g -I$(SRCROOT)/../include -Wall $(X_CFLAGS)
643 ifneq "" "$(wildcard /bin/mkdirs)"
645 breakout.c writeout.c checkout.c fatal_arch.c ofile_get_word.c \
646 vm_flush_cache.c hash_string.c dylib_roots.c guess_short_name.c \
647 SymLoc.c get_arch_from_host.c crc32.c macosx_deployment_target.c \
649 + symbol_list.c fake-mach.c
650 OBJS = $(CFILES:.c=.o)
651 INSTALL_FILES = $(CFILES) Makefile notes
661 RC_CFLAGS="$(RC_CFLAGS)" \
663 OFILE_DIR=$(OBJROOT)/dynamic_obj \
670 RC_CFLAGS="$(RC_CFLAGS)" \
675 - COPTS="-dynamic -pg" \
678 RC_CFLAGS="$(RC_CFLAGS)" \
679 RC_ARCHS="$(RC_ARCHS)"; \
681 OFILE_DIR=$(OBJROOT)/profile_obj \
684 - COPTS="-dynamic -pg" \
687 RC_CFLAGS="$(RC_CFLAGS)" \
688 RC_ARCHS="$(RC_ARCHS)"; \
692 $(PRODUCT): $(OFILE_DIR) $(SYMROOT) $(OBJS)
693 - libtool -static -o $(SYMROOT)/$(PRODUCT) $(OBJS)
694 + ar r $(SYMROOT)/$(PRODUCT) $(OBJS)
695 + ranlib $(SYMROOT)/$(PRODUCT)
697 ifeq "NO" "$(USE_DEPENDENCY_FILE)"
699 diff -rub ./libstuff/SymLoc.c ./libstuff/SymLoc.c
700 --- ./libstuff/SymLoc.c Thu Oct 24 17:04:50 2002
701 +++ ./libstuff/SymLoc.c Mon Aug 25 13:17:40 2003
705 -#import <sys/types.h>
708 +#include <sys/types.h>
710 #define _POSIX_SOURCE
714 -#import "stuff/bool.h"
715 -#import "stuff/errors.h"
716 -#import "stuff/allocate.h"
717 -#import "stuff/SymLoc.h"
720 +#include "stuff/bool.h"
721 +#include "stuff/errors.h"
722 +#include "stuff/allocate.h"
723 +#include "stuff/SymLoc.h"
726 symLocForDylib(const char *installName, const char *releaseName,
727 diff -rub ./libstuff/bytesex.c ./libstuff/bytesex.c
728 --- ./libstuff/bytesex.c Mon Nov 19 12:10:07 2001
729 +++ ./libstuff/bytesex.c Mon Aug 25 13:17:40 2003
732 #include <mach-o/fat.h>
733 #include <mach-o/loader.h>
734 -#import <mach/m68k/thread_status.h>
735 -#import <mach/ppc/thread_status.h>
736 -#import <mach/m88k/thread_status.h>
737 -#import <mach/i860/thread_status.h>
738 -#import <mach/i386/thread_status.h>
739 -#import <mach/hppa/thread_status.h>
740 -#import <mach/sparc/thread_status.h>
741 +#include <mach/m68k/thread_status.h>
742 +#include <mach/ppc/thread_status.h>
743 +#include <mach/m88k/thread_status.h>
744 +#include <mach/i860/thread_status.h>
745 +#include <mach/i386/thread_status.h>
746 +#include <mach/hppa/thread_status.h>
747 +#include <mach/sparc/thread_status.h>
748 #include <mach-o/nlist.h>
749 #include <mach-o/reloc.h>
750 #include <mach-o/ranlib.h>
751 diff -rub ./libstuff/crc32.c ./libstuff/crc32.c
752 --- ./libstuff/crc32.c Wed Feb 13 17:53:36 2002
753 +++ ./libstuff/crc32.c Mon Aug 25 13:19:21 2003
756 #include <sys/types.h>
758 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
759 +#define __private_extern__ __declspec(private_extern)
760 +#elif ( defined(__linux__) && !defined(__private_extern__) )
761 +#define __private_extern__ extern
764 static const u_int32_t crctab[] = {
766 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
767 diff -rub ./libstuff/ofile.c ./libstuff/ofile.c
768 --- ./libstuff/ofile.c Wed Apr 16 16:15:01 2003
769 +++ ./libstuff/ofile.c Tue Sep 2 20:15:34 2003
772 * @APPLE_LICENSE_HEADER_END@
774 +#include "machine/endian.h"
779 #include <sys/file.h>
780 #include <mach-o/fat.h>
781 #include <mach-o/loader.h>
782 -#import <mach/m68k/thread_status.h>
783 -#import <mach/ppc/thread_status.h>
784 -#import <mach/m88k/thread_status.h>
785 -#import <mach/i860/thread_status.h>
786 -#import <mach/i386/thread_status.h>
787 -#import <mach/sparc/thread_status.h>
788 +#include <mach/m68k/thread_status.h>
789 +#include <mach/ppc/thread_status.h>
790 +#include <mach/m88k/thread_status.h>
791 +#include <mach/i860/thread_status.h>
792 +#include <mach/i386/thread_status.h>
793 +#include <mach/sparc/thread_status.h>
794 #include <mach-o/nlist.h>
795 #include <mach-o/reloc.h>
796 #include "stuff/bool.h"
798 memset(ofile, '\0', sizeof(struct ofile));
800 /* Open the file and map it in */
801 - if((fd = open(file_name, O_RDONLY)) == -1){
802 + if((fd = open(file_name, O_RDWR)) == -1){
804 return(NSObjectFileImageAccess);
810 - /* see if this file is Mach-O file */
812 else if(size >= sizeof(struct mach_header) &&
813 (magic == MH_MAGIC || magic == SWAP_LONG(MH_MAGIC))){
814 ofile->file_type = OFILE_Mach_O;
815 diff -rub ./libstuff/print.c ./libstuff/print.c
816 --- ./libstuff/print.c Thu May 6 19:30:58 1999
817 +++ ./libstuff/print.c Mon Aug 25 13:17:40 2003
820 * @APPLE_LICENSE_HEADER_END@
823 -#import "stuff/print.h"
825 +#include "stuff/print.h"
828 * All printing of all messages for ofile functions goes through this function.
829 diff -rub ./libstuff/swap_headers.c ./libstuff/swap_headers.c
830 --- ./libstuff/swap_headers.c Fri Oct 4 17:54:48 2002
831 +++ ./libstuff/swap_headers.c Mon Aug 25 13:17:40 2003
833 * @APPLE_LICENSE_HEADER_END@
835 #include <mach-o/loader.h>
836 -#import <mach/m68k/thread_status.h>
837 -#import <mach/ppc/thread_status.h>
838 -#import <mach/m88k/thread_status.h>
839 -#import <mach/i860/thread_status.h>
840 -#import <mach/i386/thread_status.h>
841 -#import <mach/hppa/thread_status.h>
842 -#import <mach/sparc/thread_status.h>
843 +#include <mach/m68k/thread_status.h>
844 +#include <mach/ppc/thread_status.h>
845 +#include <mach/m88k/thread_status.h>
846 +#include <mach/i860/thread_status.h>
847 +#include <mach/i386/thread_status.h>
848 +#include <mach/hppa/thread_status.h>
849 +#include <mach/sparc/thread_status.h>
850 #include "stuff/bool.h"
851 #include "stuff/bytesex.h"
852 #include "stuff/errors.h"
853 diff -rub ./misc/Makefile ./misc/Makefile
854 --- ./misc/Makefile Fri Mar 14 18:18:30 2003
855 +++ ./misc/Makefile Sat Sep 6 20:17:36 2003
859 ifeq "macos" "$(RC_OS)"
860 - X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] && \
861 + X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] && \
862 [ "$(RC_RELEASE)" != "Bunsen" ] && \
863 [ "$(RC_RELEASE)" != "Gonzo" ] && \
864 [ "$(RC_RELEASE)" != "Kodiak" ]; then \
865 - echo -Wno-long-double -no-cpp-precomp; \
866 + echo -Wno-long-double -no-cpp-precomp ; \
871 CFLAGS = $(OFLAG) -g \
872 -I$(SRCROOT) -I$(SRCROOT)/../include -I$(OFILE_DIR)
874 + ifeq "Linux" "$(shell uname)"
875 + CFLAGS = $(OFLAG) -g -Wall $(X_CFLAGS) \
876 + -I$(SRCROOT) -I$(SRCROOT)/../include -I$(OFILE_DIR) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../macosx-include
878 CFLAGS = $(OFLAG) -g -Wall $(X_CFLAGS) \
879 -I$(SRCROOT) -I$(SRCROOT)/../include -I$(OFILE_DIR)
883 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
884 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
885 echo YES ; else echo NO ; \
889 LOCLIBDIR = /usr/local/lib
892 -CFILES2 = main.c lipo.c size.c strings.c nm.c checksyms.c inout.c \
893 - indr.c strip.c atom.c segedit.c kern_tool.c cmpdylib.c \
894 - dylib_pcsampler.c pagestuff.c redo_prebinding.c seg_addr_table.c \
895 - check_dylib.c seg_hack.c check_hints.c install_name_tool.c
896 +CFILES2 = seg_hack.c strip.c
897 ifeq "nextstep" "$(RC_OS)"
898 CFILES3 = file.c ar.c
904 -PROGS = lipo.NEW size.NEW strings.NEW nm.NEW \
905 - libtool.NEW checksyms.NEW indr.NEW strip.NEW nmedit.NEW \
906 - segedit.NEW kern_tool.NEW cmpdylib.NEW \
907 - dylib_pcsampler.NEW pagestuff.NEW redo_prebinding.NEW \
908 - seg_addr_table.NEW check_dylib.NEW seg_hack.NEW install_name_tool.NEW
909 +PROGS = seg_hack.NEW strip.NEW
911 teflon_all macos_all: $(PROGS)
914 lib_ofiles: $(OFILE_DIR) $(SYMROOT) libredo_prebinding.a
917 - vers_string -c $(VERS_STRING_FLAGS) cctools_misc > $(OFILE_DIR)/$@
918 + ./vers_string -c $(VERS_STRING_FLAGS) cctools_misc > $(OFILE_DIR)/$@
920 ifeq "NO" "$(USE_DEPENDENCY_FILE)"
923 $(OFILE_DIR)/seg_hack.o $(OFILE_DIR)/vers.o $(LIBSTUFF)
924 $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/seg_hack.NEW \
925 $(OFILE_DIR)/seg_hack.private.o
926 + cp $(SYMROOT)/seg_hack.NEW $(SYMROOT)/seg_hack
928 install_name_tool.NEW: install_name_tool.o vers.o
929 $(CC) $(CFLAGS) $(RC_CFLAGS) -nostdlib -r \
931 $(SYMROOT)/redo_prebinding.NEW \
932 $(SYMROOT)/libredo_prebinding.a \
933 $(SYMROOT)/kern_tool.NEW \
934 - $(SYMROOT)/cmpdylib.NEW
935 + $(SYMROOT)/cmpdylib.NEW \
936 + $(SYMROOT)/seg_hack
940 --- ld/makeUser.c Sat Sep 6 21:52:24 2003
941 +++ ld/makeUser.c Mon Aug 25 22:54:46 2003
945 + * stub generated Mon Aug 25 15:06:30 2003
946 + * with a MiG generated Tue Nov 5 01:17:50 PST 2002 by root@brixen
952 +#ifndef mig_internal
953 +#define mig_internal static
954 +#endif /* mig_internal */
956 +#ifndef mig_external
957 +#define mig_external
958 +#endif /* mig_external */
962 +#endif /* TypeCheck */
965 +#define LimitCheck 0
966 +#endif /* LimitCheck */
969 +#define min(a,b) ( ((a) < (b))? (a): (b) )
972 +#ifndef UseStaticTemplates
973 +#define UseStaticTemplates 0
974 +#endif /* UseStaticTemplates */
976 +#define _WALIGN_(x) (((x) + 3) & ~3)
977 +#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
978 +#ifndef __MachMsgErrorWithTimeout
979 +#define __MachMsgErrorWithTimeout(_R_) { \
981 + case MACH_SEND_INVALID_REPLY: \
982 + case MACH_RCV_INVALID_NAME: \
983 + case MACH_RCV_PORT_DIED: \
984 + case MACH_RCV_PORT_CHANGED: \
985 + case MACH_RCV_TIMED_OUT: \
986 + mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
989 + mig_put_reply_port(InP->Head.msgh_reply_port); \
992 +#endif /* __MachMsgErrorWithTimeout */
994 +#ifndef __MachMsgErrorWithoutTimeout
995 +#define __MachMsgErrorWithoutTimeout(_R_) { \
997 + case MACH_SEND_INVALID_REPLY: \
998 + case MACH_RCV_INVALID_NAME: \
999 + case MACH_RCV_PORT_DIED: \
1000 + case MACH_RCV_PORT_CHANGED: \
1001 + mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
1004 + mig_put_reply_port(InP->Head.msgh_reply_port); \
1007 +#endif /* __MachMsgErrorWithoutTimeout */
1009 +#ifndef __DeclareSendRpc
1010 +#define __DeclareSendRpc(_NUM_, _NAME_)
1011 +#endif /* __DeclareSendRpc */
1013 +#ifndef __BeforeSendRpc
1014 +#define __BeforeSendRpc(_NUM_, _NAME_)
1015 +#endif /* __BeforeSendRpc */
1017 +#ifndef __AfterSendRpc
1018 +#define __AfterSendRpc(_NUM_, _NAME_)
1019 +#endif /* __AfterSendRpc */
1021 +#ifndef __DeclareSendSimple
1022 +#define __DeclareSendSimple(_NUM_, _NAME_)
1023 +#endif /* __DeclareSendSimple */
1025 +#ifndef __BeforeSendSimple
1026 +#define __BeforeSendSimple(_NUM_, _NAME_)
1027 +#endif /* __BeforeSendSimple */
1029 +#ifndef __AfterSendSimple
1030 +#define __AfterSendSimple(_NUM_, _NAME_)
1031 +#endif /* __AfterSendSimple */
1033 +#define msgh_request_port msgh_remote_port
1034 +#define msgh_reply_port msgh_local_port
1038 +/* SimpleRoutine alert_old */
1039 +mig_external kern_return_t make_alert_old
1041 + mach_port_t makePort,
1043 + make_string_t functionName,
1044 + mach_msg_type_number_t functionNameCnt,
1045 + make_string_t fileName,
1046 + mach_msg_type_number_t fileNameCnt,
1048 + make_string_t message,
1049 + mach_msg_type_number_t messageCnt
1054 + mach_msg_header_t Head;
1057 + mach_msg_type_number_t functionNameCnt;
1058 + char functionName[1024];
1059 + mach_msg_type_number_t fileNameCnt;
1060 + char fileName[1024];
1062 + mach_msg_type_number_t messageCnt;
1063 + char message[1024];
1067 + * typedef struct {
1068 + * mach_msg_header_t Head;
1069 + * NDR_record_t NDR;
1070 + * kern_return_t RetCode;
1071 + * } mig_reply_error_t;
1078 + register Request *InP = &Mess.In;
1080 + mach_msg_return_t msg_result;
1081 + unsigned int msgh_size;
1082 + unsigned int msgh_size_delta;
1083 + __DeclareSendSimple(100, "alert_old")
1085 + InP->NDR = NDR_record;
1087 + InP->eventType = eventType;
1089 + if (functionNameCnt > 1024) {
1090 + { return MIG_ARRAY_TOO_LARGE; }
1092 + (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1094 + InP->functionNameCnt = functionNameCnt;
1096 + msgh_size_delta = _WALIGN_(functionNameCnt);
1097 + msgh_size = (sizeof(Request) - 3072) + msgh_size_delta;
1098 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1100 + if (fileNameCnt > 1024) {
1101 + { return MIG_ARRAY_TOO_LARGE; }
1103 + (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1105 + InP->fileNameCnt = fileNameCnt;
1107 + msgh_size_delta = _WALIGN_(fileNameCnt);
1108 + msgh_size += msgh_size_delta;
1109 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1113 + if (messageCnt > 1024) {
1114 + { return MIG_ARRAY_TOO_LARGE; }
1116 + (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1118 + InP->messageCnt = messageCnt;
1120 + msgh_size += _WALIGN_(messageCnt);
1122 + InP->Head.msgh_bits =
1123 + MACH_MSGH_BITS(19, 0);
1124 + /* msgh_size passed as argument */
1125 + InP->Head.msgh_request_port = makePort;
1126 + InP->Head.msgh_reply_port = MACH_PORT_NULL;
1127 + InP->Head.msgh_id = 100;
1129 + __BeforeSendSimple(100, "alert_old")
1130 + msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1131 + __AfterSendSimple(100, "alert_old")
1132 + return msg_result;
1136 +/* SimpleRoutine alert */
1137 +mig_external kern_return_t make_alert
1139 + mach_port_t makePort,
1141 + make_string_t functionName,
1142 + mach_msg_type_number_t functionNameCnt,
1143 + make_string_t fileName,
1144 + mach_msg_type_number_t fileNameCnt,
1145 + make_string_t directory,
1146 + mach_msg_type_number_t directoryCnt,
1148 + make_string_t message,
1149 + mach_msg_type_number_t messageCnt
1154 + mach_msg_header_t Head;
1157 + mach_msg_type_number_t functionNameCnt;
1158 + char functionName[1024];
1159 + mach_msg_type_number_t fileNameCnt;
1160 + char fileName[1024];
1161 + mach_msg_type_number_t directoryCnt;
1162 + char directory[1024];
1164 + mach_msg_type_number_t messageCnt;
1165 + char message[1024];
1169 + * typedef struct {
1170 + * mach_msg_header_t Head;
1171 + * NDR_record_t NDR;
1172 + * kern_return_t RetCode;
1173 + * } mig_reply_error_t;
1180 + register Request *InP = &Mess.In;
1182 + mach_msg_return_t msg_result;
1183 + unsigned int msgh_size;
1184 + unsigned int msgh_size_delta;
1185 + __DeclareSendSimple(101, "alert")
1187 + InP->NDR = NDR_record;
1189 + InP->eventType = eventType;
1191 + if (functionNameCnt > 1024) {
1192 + { return MIG_ARRAY_TOO_LARGE; }
1194 + (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1196 + InP->functionNameCnt = functionNameCnt;
1198 + msgh_size_delta = _WALIGN_(functionNameCnt);
1199 + msgh_size = (sizeof(Request) - 4096) + msgh_size_delta;
1200 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1202 + if (fileNameCnt > 1024) {
1203 + { return MIG_ARRAY_TOO_LARGE; }
1205 + (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1207 + InP->fileNameCnt = fileNameCnt;
1209 + msgh_size_delta = _WALIGN_(fileNameCnt);
1210 + msgh_size += msgh_size_delta;
1211 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1213 + if (directoryCnt > 1024) {
1214 + { return MIG_ARRAY_TOO_LARGE; }
1216 + (void)memcpy((char *) InP->directory, (const char *) directory, directoryCnt);
1218 + InP->directoryCnt = directoryCnt;
1220 + msgh_size_delta = _WALIGN_(directoryCnt);
1221 + msgh_size += msgh_size_delta;
1222 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1226 + if (messageCnt > 1024) {
1227 + { return MIG_ARRAY_TOO_LARGE; }
1229 + (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1231 + InP->messageCnt = messageCnt;
1233 + msgh_size += _WALIGN_(messageCnt);
1235 + InP->Head.msgh_bits =
1236 + MACH_MSGH_BITS(19, 0);
1237 + /* msgh_size passed as argument */
1238 + InP->Head.msgh_request_port = makePort;
1239 + InP->Head.msgh_reply_port = MACH_PORT_NULL;
1240 + InP->Head.msgh_id = 101;
1242 + __BeforeSendSimple(101, "alert")
1243 + msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1244 + __AfterSendSimple(101, "alert")
1245 + return msg_result;
1248 diff -bur ./Makefile /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/Makefile
1249 --- as/Makefile Fri Sep 6 18:27:10 2002
1250 +++ as/Makefile Sat Sep 6 23:52:22 2003
1252 export USE_APPLE_PB_SUPPORT = all
1254 ifeq "macos" "$(RC_OS)"
1255 - X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] && \
1256 + X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] && \
1257 [ "$(RC_RELEASE)" != "Bunsen" ] && \
1258 [ "$(RC_RELEASE)" != "Gonzo" ] && \
1259 [ "$(RC_RELEASE)" != "Kodiak" ]; then \
1263 ifneq "mwccppc" "$(notdir $(CC))"
1264 + ifeq "Linux" "$(shell uname)"
1265 + GCC_FLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../../macosx-include
1267 GCC_FLAGS = -Wall -Wno-precomp $(X_CFLAGS)
1271 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
1272 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
1273 echo YES ; else echo NO ; \
1276 diff -bur ./app.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/app.h
1277 --- as/app.h Tue Apr 30 00:37:17 2002
1278 +++ as/app.h Sat Sep 6 23:49:28 2003
1283 extern FILE *scrub_file;
1284 extern char *scrub_string;
1285 diff -bur ./as.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/as.h
1286 --- as/as.h Tue Apr 30 00:37:17 2002
1287 +++ as/as.h Sat Sep 6 23:49:28 2003
1292 -/* These #imports are for type definitions etc. */
1295 -#import <mach/machine.h>
1296 +/* These #includes are for type definitions etc. */
1298 +#include <assert.h>
1299 +#include <mach/machine.h>
1301 /* These defines are potentially useful */
1303 Only in /home/megacz/xwt/upstream/darwin-linker/src/cctools/as: asparc_dir
1304 diff -bur ./atof-ieee.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/atof-ieee.h
1305 --- as/atof-ieee.h Tue Apr 30 00:37:17 2002
1306 +++ as/atof-ieee.h Sat Sep 6 23:49:28 2003
1309 +#include "flonum.h"
1311 extern char *atof_ieee(
1313 diff -bur ./bignum.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/bignum.h
1314 --- as/bignum.h Tue Apr 30 00:37:17 2002
1315 +++ as/bignum.h Sat Sep 6 23:53:27 2003
1317 * Bignums are >= 0. *
1319 \***********************************************************************/
1320 +#ifndef __BIGNUM_H__
1321 +#define __BIGNUM_H__
1323 #define LITTLENUM_NUMBER_OF_BITS (16)
1324 #define LITTLENUM_RADIX (1 << LITTLENUM_NUMBER_OF_BITS)
1326 /* JF truncated this to get around a problem with GCC */
1327 #define LOG_TO_BASE_2_OF_10 (3.3219280948873623478703194294893901758651)
1328 /* WARNING: I haven't checked that the trailing digits are correct! */
1330 diff -bur ./expr.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/expr.h
1331 --- as/expr.h Fri Sep 6 18:27:10 2002
1332 +++ as/expr.h Sat Sep 6 23:49:28 2003
1334 along with GAS; see the file COPYING. If not, write to
1335 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
1337 -#import "struc-symbol.h"
1340 +#include "struc-symbol.h"
1341 +#include "bignum.h"
1342 +#include "flonum.h"
1345 * This table describes the use of segments as EXPRESSION types.
1346 diff -bur ./flonum.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/flonum.h
1347 --- as/flonum.h Fri Sep 6 18:27:10 2002
1348 +++ as/flonum.h Sat Sep 6 23:49:28 2003
1351 \***********************************************************************/
1354 +#include "bignum.h"
1356 /***********************************************************************\
1358 diff -bur ./frags.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/frags.h
1359 --- as/frags.h Tue Jan 14 23:35:18 2003
1360 +++ as/frags.h Sat Sep 6 23:49:28 2003
1362 along with GAS; see the file COPYING. If not, write to
1363 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
1366 -#import "struc-symbol.h"
1368 +#include "struc-symbol.h"
1371 * A code fragment (frag) is some known number of chars, followed by some
1372 diff -bur ./md.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/md.h
1373 --- as/md.h Tue Apr 30 00:37:17 2002
1374 +++ as/md.h Sat Sep 6 23:49:29 2003
1376 in a file named COPYING. Among other things, the copyright
1377 notice and this notice must be preserved on all copies. */
1379 -#import <mach/machine.h>
1380 -#import "stuff/bytesex.h"
1383 -#import "struc-symbol.h"
1386 +#include <mach/machine.h>
1387 +#include "stuff/bytesex.h"
1390 +#include "struc-symbol.h"
1394 /* These are the default cputype and cpusubtype for this target MACHINE */
1395 extern const cpu_type_t md_cputype;
1396 diff -bur ./read.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/read.h
1397 --- as/read.h Fri Sep 6 18:27:13 2002
1398 +++ as/read.h Sat Sep 6 23:49:29 2003
1400 along with GAS; see the file COPYING. If not, write to
1401 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
1406 #define PERMIT_WHITESPACE /* Define to make whitespace be allowed in */
1407 /* many syntactically unnecessary places. */
1408 diff -bur ./relax.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/relax.h
1409 --- as/relax.h Tue Apr 30 00:37:17 2002
1410 +++ as/relax.h Sat Sep 6 23:53:35 2003
1412 +#ifndef __RELAX_H__
1413 +#define __RELAX_H__
1414 /* The type used for a target address */
1415 typedef unsigned long relax_addressT;
1418 relax_substateT rlx_more; /* Next longer relax-state. */
1419 /* 0 means there is no 'next' relax-state. */
1422 diff -bur ./sections.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/sections.h
1423 --- as/sections.h Tue Apr 30 00:37:17 2002
1424 +++ as/sections.h Sat Sep 6 23:49:29 2003
1426 along with GAS; see the file COPYING. If not, write to
1427 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
1429 -#import <mach-o/loader.h>
1430 -#import "struc-symbol.h"
1431 +#include <mach-o/loader.h>
1432 +#include "struc-symbol.h"
1435 * For every section the user mentions in the assembley program, we make one
1436 diff -bur ./struc-symbol.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/struc-symbol.h
1437 --- as/struc-symbol.h Fri Sep 6 18:27:14 2002
1438 +++ as/struc-symbol.h Sat Sep 6 23:49:29 2003
1440 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
1443 -#import <mach-o/nlist.h>
1444 +#include <mach-o/nlist.h>
1445 #else /* !defined(NeXT_MOD) */
1447 #include "a.out.h" /* Needed to define struct nlist. Sigh. */
1448 diff -bur ./symbols.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/symbols.h
1449 --- as/symbols.h Tue Apr 30 00:37:17 2002
1450 +++ as/symbols.h Sat Sep 6 23:49:29 2003
1452 along with GAS; see the file COPYING. If not, write to
1453 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
1455 -#import "struc-symbol.h"
1457 +#include "struc-symbol.h"
1460 extern struct hash_control *sy_hash;
1461 extern struct obstack notes;
1462 --- as/make.h Sun Sep 7 00:01:26 2003
1463 +++ as/make.h Sat Sep 6 23:55:11 2003
1465 +#ifndef _make_user_
1466 +#define _make_user_
1470 +#include <string.h>
1471 +#include <mach/ndr.h>
1472 +#include <mach/boolean.h>
1473 +#include <mach/kern_return.h>
1474 +#include <mach/notify.h>
1475 +#include <mach/mach_types.h>
1476 +#include <mach/message.h>
1477 +#include <mach/mig_errors.h>
1478 +#include <mach/port.h>
1481 +#ifndef FUNCTION_PTR_T
1482 +#define FUNCTION_PTR_T
1483 +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
1486 + function_ptr_t function;
1487 +} function_table_entry;
1488 +typedef function_table_entry *function_table_t;
1489 +#endif /* FUNCTION_PTR_T */
1490 +#endif /* AUTOTEST */
1492 +#ifndef make_MSG_COUNT
1493 +#define make_MSG_COUNT 2
1494 +#endif /* make_MSG_COUNT */
1496 +#include <mach/std_types.h>
1497 +#include <mach/mig.h>
1498 +#include "make_defs.h"
1500 +#ifdef __BeforeMigUserHeader
1501 +__BeforeMigUserHeader
1502 +#endif /* __BeforeMigUserHeader */
1505 +/* SimpleRoutine alert_old */
1506 +#ifdef mig_external
1510 +#endif /* mig_external */
1511 +kern_return_t make_alert_old
1513 + mach_port_t makePort,
1515 + make_string_t functionName,
1516 + mach_msg_type_number_t functionNameCnt,
1517 + make_string_t fileName,
1518 + mach_msg_type_number_t fileNameCnt,
1520 + make_string_t message,
1521 + mach_msg_type_number_t messageCnt
1524 +/* SimpleRoutine alert */
1525 +#ifdef mig_external
1529 +#endif /* mig_external */
1530 +kern_return_t make_alert
1532 + mach_port_t makePort,
1534 + make_string_t functionName,
1535 + mach_msg_type_number_t functionNameCnt,
1536 + make_string_t fileName,
1537 + mach_msg_type_number_t fileNameCnt,
1538 + make_string_t directory,
1539 + mach_msg_type_number_t directoryCnt,
1541 + make_string_t message,
1542 + mach_msg_type_number_t messageCnt
1544 +/* typedefs for all requests */
1546 +#ifndef __Request__make_subsystem__defined
1547 +#define __Request__make_subsystem__defined
1549 + mach_msg_header_t Head;
1552 + mach_msg_type_number_t functionNameCnt;
1553 + char functionName[1024];
1554 + mach_msg_type_number_t fileNameCnt;
1555 + char fileName[1024];
1557 + mach_msg_type_number_t messageCnt;
1558 + char message[1024];
1559 + } __Request__alert_old_t;
1562 + mach_msg_header_t Head;
1565 + mach_msg_type_number_t functionNameCnt;
1566 + char functionName[1024];
1567 + mach_msg_type_number_t fileNameCnt;
1568 + char fileName[1024];
1569 + mach_msg_type_number_t directoryCnt;
1570 + char directory[1024];
1572 + mach_msg_type_number_t messageCnt;
1573 + char message[1024];
1574 + } __Request__alert_t;
1576 +#endif /* !__Request__make_subsystem__defined */
1578 +/* union of all requests */
1580 +#ifndef __RequestUnion__make_make_subsystem__defined
1581 +#define __RequestUnion__make_make_subsystem__defined
1582 +union __RequestUnion__make_make_subsystem {
1583 + __Request__alert_old_t Request_make_alert_old;
1584 + __Request__alert_t Request_make_alert;
1586 +#endif /* !__RequestUnion__make_make_subsystem__defined */
1587 +/* typedefs for all replies */
1589 +#ifndef __Reply__make_subsystem__defined
1590 +#define __Reply__make_subsystem__defined
1592 + mach_msg_header_t Head;
1594 + kern_return_t RetCode;
1595 + } __Reply__alert_old_t;
1598 + mach_msg_header_t Head;
1600 + kern_return_t RetCode;
1601 + } __Reply__alert_t;
1603 +#endif /* !__Reply__make_subsystem__defined */
1605 +/* union of all replies */
1607 +#ifndef __ReplyUnion__make_make_subsystem__defined
1608 +#define __ReplyUnion__make_make_subsystem__defined
1609 +union __ReplyUnion__make_make_subsystem {
1610 + __Reply__alert_old_t Reply_make_alert_old;
1611 + __Reply__alert_t Reply_make_alert;
1613 +#endif /* !__RequestUnion__make_make_subsystem__defined */
1615 +#ifndef subsystem_to_name_map_make
1616 +#define subsystem_to_name_map_make \
1617 + { "alert_old", 100 },\
1621 +#ifdef __AfterMigUserHeader
1622 +__AfterMigUserHeader
1623 +#endif /* __AfterMigUserHeader */
1625 +#endif /* _make_user_ */
1626 --- as/makeUser.c Sun Sep 7 00:01:26 2003
1627 +++ as/makeUser.c Sat Sep 6 23:55:11 2003
1631 + * stub generated Sat Sep 6 23:50:34 2003
1632 + * with a MiG generated Tue Nov 5 01:17:50 PST 2002 by root@brixen
1638 +#ifndef mig_internal
1639 +#define mig_internal static
1640 +#endif /* mig_internal */
1642 +#ifndef mig_external
1643 +#define mig_external
1644 +#endif /* mig_external */
1647 +#define TypeCheck 0
1648 +#endif /* TypeCheck */
1651 +#define LimitCheck 0
1652 +#endif /* LimitCheck */
1655 +#define min(a,b) ( ((a) < (b))? (a): (b) )
1658 +#ifndef UseStaticTemplates
1659 +#define UseStaticTemplates 0
1660 +#endif /* UseStaticTemplates */
1662 +#define _WALIGN_(x) (((x) + 3) & ~3)
1663 +#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
1664 +#ifndef __MachMsgErrorWithTimeout
1665 +#define __MachMsgErrorWithTimeout(_R_) { \
1667 + case MACH_SEND_INVALID_REPLY: \
1668 + case MACH_RCV_INVALID_NAME: \
1669 + case MACH_RCV_PORT_DIED: \
1670 + case MACH_RCV_PORT_CHANGED: \
1671 + case MACH_RCV_TIMED_OUT: \
1672 + mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
1675 + mig_put_reply_port(InP->Head.msgh_reply_port); \
1678 +#endif /* __MachMsgErrorWithTimeout */
1680 +#ifndef __MachMsgErrorWithoutTimeout
1681 +#define __MachMsgErrorWithoutTimeout(_R_) { \
1683 + case MACH_SEND_INVALID_REPLY: \
1684 + case MACH_RCV_INVALID_NAME: \
1685 + case MACH_RCV_PORT_DIED: \
1686 + case MACH_RCV_PORT_CHANGED: \
1687 + mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
1690 + mig_put_reply_port(InP->Head.msgh_reply_port); \
1693 +#endif /* __MachMsgErrorWithoutTimeout */
1695 +#ifndef __DeclareSendRpc
1696 +#define __DeclareSendRpc(_NUM_, _NAME_)
1697 +#endif /* __DeclareSendRpc */
1699 +#ifndef __BeforeSendRpc
1700 +#define __BeforeSendRpc(_NUM_, _NAME_)
1701 +#endif /* __BeforeSendRpc */
1703 +#ifndef __AfterSendRpc
1704 +#define __AfterSendRpc(_NUM_, _NAME_)
1705 +#endif /* __AfterSendRpc */
1707 +#ifndef __DeclareSendSimple
1708 +#define __DeclareSendSimple(_NUM_, _NAME_)
1709 +#endif /* __DeclareSendSimple */
1711 +#ifndef __BeforeSendSimple
1712 +#define __BeforeSendSimple(_NUM_, _NAME_)
1713 +#endif /* __BeforeSendSimple */
1715 +#ifndef __AfterSendSimple
1716 +#define __AfterSendSimple(_NUM_, _NAME_)
1717 +#endif /* __AfterSendSimple */
1719 +#define msgh_request_port msgh_remote_port
1720 +#define msgh_reply_port msgh_local_port
1724 +/* SimpleRoutine alert_old */
1725 +mig_external kern_return_t make_alert_old
1727 + mach_port_t makePort,
1729 + make_string_t functionName,
1730 + mach_msg_type_number_t functionNameCnt,
1731 + make_string_t fileName,
1732 + mach_msg_type_number_t fileNameCnt,
1734 + make_string_t message,
1735 + mach_msg_type_number_t messageCnt
1740 + mach_msg_header_t Head;
1743 + mach_msg_type_number_t functionNameCnt;
1744 + char functionName[1024];
1745 + mach_msg_type_number_t fileNameCnt;
1746 + char fileName[1024];
1748 + mach_msg_type_number_t messageCnt;
1749 + char message[1024];
1753 + * typedef struct {
1754 + * mach_msg_header_t Head;
1755 + * NDR_record_t NDR;
1756 + * kern_return_t RetCode;
1757 + * } mig_reply_error_t;
1764 + register Request *InP = &Mess.In;
1766 + mach_msg_return_t msg_result;
1767 + unsigned int msgh_size;
1768 + unsigned int msgh_size_delta;
1769 + __DeclareSendSimple(100, "alert_old")
1771 + InP->NDR = NDR_record;
1773 + InP->eventType = eventType;
1775 + if (functionNameCnt > 1024) {
1776 + { return MIG_ARRAY_TOO_LARGE; }
1778 + (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1780 + InP->functionNameCnt = functionNameCnt;
1782 + msgh_size_delta = _WALIGN_(functionNameCnt);
1783 + msgh_size = (sizeof(Request) - 3072) + msgh_size_delta;
1784 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1786 + if (fileNameCnt > 1024) {
1787 + { return MIG_ARRAY_TOO_LARGE; }
1789 + (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1791 + InP->fileNameCnt = fileNameCnt;
1793 + msgh_size_delta = _WALIGN_(fileNameCnt);
1794 + msgh_size += msgh_size_delta;
1795 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1799 + if (messageCnt > 1024) {
1800 + { return MIG_ARRAY_TOO_LARGE; }
1802 + (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1804 + InP->messageCnt = messageCnt;
1806 + msgh_size += _WALIGN_(messageCnt);
1808 + InP->Head.msgh_bits =
1809 + MACH_MSGH_BITS(19, 0);
1810 + /* msgh_size passed as argument */
1811 + InP->Head.msgh_request_port = makePort;
1812 + InP->Head.msgh_reply_port = MACH_PORT_NULL;
1813 + InP->Head.msgh_id = 100;
1815 + __BeforeSendSimple(100, "alert_old")
1816 + msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1817 + __AfterSendSimple(100, "alert_old")
1818 + return msg_result;
1822 +/* SimpleRoutine alert */
1823 +mig_external kern_return_t make_alert
1825 + mach_port_t makePort,
1827 + make_string_t functionName,
1828 + mach_msg_type_number_t functionNameCnt,
1829 + make_string_t fileName,
1830 + mach_msg_type_number_t fileNameCnt,
1831 + make_string_t directory,
1832 + mach_msg_type_number_t directoryCnt,
1834 + make_string_t message,
1835 + mach_msg_type_number_t messageCnt
1840 + mach_msg_header_t Head;
1843 + mach_msg_type_number_t functionNameCnt;
1844 + char functionName[1024];
1845 + mach_msg_type_number_t fileNameCnt;
1846 + char fileName[1024];
1847 + mach_msg_type_number_t directoryCnt;
1848 + char directory[1024];
1850 + mach_msg_type_number_t messageCnt;
1851 + char message[1024];
1855 + * typedef struct {
1856 + * mach_msg_header_t Head;
1857 + * NDR_record_t NDR;
1858 + * kern_return_t RetCode;
1859 + * } mig_reply_error_t;
1866 + register Request *InP = &Mess.In;
1868 + mach_msg_return_t msg_result;
1869 + unsigned int msgh_size;
1870 + unsigned int msgh_size_delta;
1871 + __DeclareSendSimple(101, "alert")
1873 + InP->NDR = NDR_record;
1875 + InP->eventType = eventType;
1877 + if (functionNameCnt > 1024) {
1878 + { return MIG_ARRAY_TOO_LARGE; }
1880 + (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
1882 + InP->functionNameCnt = functionNameCnt;
1884 + msgh_size_delta = _WALIGN_(functionNameCnt);
1885 + msgh_size = (sizeof(Request) - 4096) + msgh_size_delta;
1886 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1888 + if (fileNameCnt > 1024) {
1889 + { return MIG_ARRAY_TOO_LARGE; }
1891 + (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
1893 + InP->fileNameCnt = fileNameCnt;
1895 + msgh_size_delta = _WALIGN_(fileNameCnt);
1896 + msgh_size += msgh_size_delta;
1897 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1899 + if (directoryCnt > 1024) {
1900 + { return MIG_ARRAY_TOO_LARGE; }
1902 + (void)memcpy((char *) InP->directory, (const char *) directory, directoryCnt);
1904 + InP->directoryCnt = directoryCnt;
1906 + msgh_size_delta = _WALIGN_(directoryCnt);
1907 + msgh_size += msgh_size_delta;
1908 + InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
1912 + if (messageCnt > 1024) {
1913 + { return MIG_ARRAY_TOO_LARGE; }
1915 + (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
1917 + InP->messageCnt = messageCnt;
1919 + msgh_size += _WALIGN_(messageCnt);
1921 + InP->Head.msgh_bits =
1922 + MACH_MSGH_BITS(19, 0);
1923 + /* msgh_size passed as argument */
1924 + InP->Head.msgh_request_port = makePort;
1925 + InP->Head.msgh_reply_port = MACH_PORT_NULL;
1926 + InP->Head.msgh_id = 101;
1928 + __BeforeSendSimple(101, "alert")
1929 + msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
1930 + __AfterSendSimple(101, "alert")
1931 + return msg_result;
1934 --- ar/contents.c 30 Apr 2002 07:37:17 -0000 1.1.1.1
1935 +++ ar/contents.c 7 Sep 2003 08:55:11 -0000
1940 -#include <tzfile.h>
1943 #include "archive.h"
1944 @@ -103,12 +102,14 @@
1945 else if (!(file = files(argv)))
1947 if (options & AR_V) {
1949 (void)strmode(chdr.mode, buf);
1950 (void)printf("%s %6d/%-6d %8qd ",
1951 buf + 1, chdr.uid, chdr.gid, chdr.size);
1952 tp = localtime(&chdr.date);
1953 (void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp);
1954 (void)printf("%s %s\n", buf, file);
1957 (void)printf("%s\n", file);
1959 --- ar/misc.c 30 Apr 2002 07:37:17 -0000 1.1.1.1
1960 +++ ar/misc.c 7 Sep 2003 08:55:11 -0000
1962 #endif /* not lint */
1964 #include <sys/param.h>
1965 +#define EFTYPE 79 /* Inappropriate file type or format */
1969 --- ar/vers_string Sun Sep 7 01:55:10 2003
1970 +++ ar/vers_string Sun Sep 7 01:53:23 2003
1974 +# Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
1976 +# @APPLE_LICENSE_HEADER_START@
1978 +# "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
1979 +# Reserved. This file contains Original Code and/or Modifications of
1980 +# Original Code as defined in and that are subject to the Apple Public
1981 +# Source License Version 1.0 (the 'License'). You may not use this file
1982 +# except in compliance with the License. Please obtain a copy of the
1983 +# License at http://www.apple.com/publicsource and read it before using
1986 +# The Original Code and all software distributed under the License are
1987 +# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1988 +# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1989 +# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1990 +# FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
1991 +# License for the specific language governing rights and limitations
1992 +# under the License."
1994 +# @APPLE_LICENSE_HEADER_END@
1997 +# vers_string PROGRAM [STAMPED_NAME]
1999 +# Output a string suitable for use as a version identifier
2006 +program=$(basename $0);
2010 + echo "Usage: ${program} [<options>] <program> [<stamped_name>]";
2011 + echo " <program>: ???";
2012 + echo " <stamped_name>: ???";
2013 + echo "Options: ???";
2017 +# Handle command line
2021 +Format=''\''PROGRAM:'\''"${Program}"'\'' PROJECT:'\''"${Version}"'\'' DEVELOPER:'\''"${USER}"'\'' BUILT:'\''"${Date}"'\'''\''';
2023 +if ! args=$(getopt cflBn $*); then usage; fi;
2026 + case "${option}" in
2028 + Format=''\''#include <sys/cdefs.h>
2030 +#define __IDSTRING(name,string) \
2031 + static const char name[] __attribute__((__unused__)) = string
2033 +__IDSTRING(SGS_VERS,"@(#)PROGRAM:'\''"${Program}"'\'' PROJECT:'\''"${Version}"'\'' DEVELOPER:'\''"${USER}"'\'' BUILT:'\''"${Date}"'\''\n");
2034 +__IDSTRING(VERS_NUM,"'\''${Revision}'\''");'\''';
2038 + Format='"${Program}"'\''-'\''"${Revision}"';
2042 + Format=''\''#include <sys/cdefs.h>
2044 +#define __IDSTRING(name,string) \
2045 + const char name[] __attribute__((__unused__)) = string
2047 +__IDSTRING(SGS_VERS,"@(#)LIBRARY:'\''"${Program}"'\'' PROJECT:'\''"${Version}"'\'' DEVELOPER:'\''"${USER}"'\'' BUILT:'\''"${Date}"'\''\n");'\''';
2051 + date="NO DATE SET (-B used)";
2055 + Format='"${Revision}"';
2065 +Program=$1; if [ $# != 0 ]; then shift; fi;
2066 +Version=$1; if [ $# != 0 ]; then shift; fi;
2068 +if [ $# != 0 ]; then usage; fi;
2070 +if [ -z "${Program}" ]; then Program="Unknown"; fi;
2072 +if [ -n "${Version}" ]; then
2073 + if ! Revision=$(expr "${Version}" : '.*-\(.*\)'); then
2074 + echo "${program}: No hyphen in project root ${Version}" >&2
2078 + CurrentDir=$(/bin/pwd);
2079 + Version=$(basename "${CurrentDir}");
2080 + while [ "${Version}" != "${CurrentDir}" ]; do
2081 + if Revision=$(expr "${Version}" : '.*-\(.*\)'); then break; fi;
2082 + CurrentDir=$(dirname "${CurrentDir}");
2083 + Version=$(basename "${CurrentDir}");
2085 + if [ "${Version}" = "${CurrentDir}" ]; then
2086 + CurrentDir=$(/bin/pwd);
2087 + echo "${program}: No hyphen in project root ${CurrentDir}" >&2
2088 + echo "${program}: Could not determine version" >&2
2089 + Version="Unknown";
2094 +if [ -z "${USER}" ]; then USER=$(whoami); fi;
2096 +echo "$(eval echo "${Format}")";
2097 --- ar/Makefile 7 Sep 2002 01:27:09 -0000 1.1.1.2
2098 +++ ar/Makefile 7 Sep 2003 09:03:52 -0000
2100 ifeq "mwccppc" "$(notdir $(CC))"
2101 CFLAGS = -g $(OFLAG) -I$(SRCROOT)/../include
2103 - CFLAGS = -g $(OFLAG) -Wall -Wno-precomp -I$(SRCROOT)/../include
2104 + ifeq "Linux" "$(shell uname)"
2105 + CFLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__ -D__ppc__ -I/usr/include -I../../macosx-include -I../include
2107 + CFLAGS = -g $(OFLAG) -Wall -Wno-precomp -I$(SRCROOT)/../include
2111 LIBSTUFF = -L$(SYMROOT)/../libstuff -lstuff
2113 -USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
2114 +USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
2115 echo YES ; else echo NO ; \
2119 $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/$@ $(OBJS) $(LIBSTUFF)
2122 - vers_string -c $(VERS_STRING_FLAGS) $(PRODUCT) > $(OFILE_DIR)/$@
2123 + chmod +x vers_string
2124 + ./vers_string -c $(VERS_STRING_FLAGS) $(PRODUCT) > $(OFILE_DIR)/$@
2126 ifeq "NO" "$(USE_DEPENDENCY_FILE)"
2128 --- ar/archive.c 30 Apr 2002 07:37:17 -0000 1.1.1.1
2129 +++ ar/archive.c 7 Sep 2003 10:15:36 -0000
2132 #include <sys/param.h>
2133 #include <sys/stat.h>
2134 +#include <stuff/ofile.h>
2138 @@ -261,32 +262,17 @@
2139 * a space, use extended format 1.
2141 lname = strlen(name);
2142 - if (options & AR_TR) {
2143 if (lname > OLDARMAXNAME) {
2144 (void)fflush(stdout);
2145 warnx("warning: %s truncated to %.*s",
2146 name, OLDARMAXNAME, name);
2147 (void)fflush(stderr);
2149 - (void)sprintf(hb, HDR3, name, (long int)sb->st_mtimespec.tv_sec,
2150 + (void)sprintf(hb, HDR3, name, (long int)0,
2151 (unsigned int)(u_short)sb->st_uid,
2152 (unsigned int)(u_short)sb->st_gid,
2153 sb->st_mode, sb->st_size, ARFMAG);
2155 - } else if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
2156 - (void)sprintf(hb, HDR1, AR_EFMT1, (lname + 3) & ~3,
2157 - (long int)sb->st_mtimespec.tv_sec,
2158 - (unsigned int)(u_short)sb->st_uid,
2159 - (unsigned int)(u_short)sb->st_gid,
2160 - sb->st_mode, sb->st_size + ((lname + 3) & ~3),
2164 - (void)sprintf(hb, HDR2, name, (long int)sb->st_mtimespec.tv_sec,
2165 - (unsigned int)(u_short)sb->st_uid,
2166 - (unsigned int)(u_short)sb->st_gid,
2167 - sb->st_mode, sb->st_size, ARFMAG);
2172 --- ld/fake-mach.c Sun Sep 7 14:13:57 2003
2173 +++ ld/fake-mach.c Sun Sep 7 14:13:50 2003
2175 +/** fake-mach.c - A half baked implementation of mach kernel functions using the POSIX UNIX API.
2177 +* This was used to port Apple's Darwin linker (ld) to Linux. This allows Mac OS X applications to
2178 +* be cross complied on Linux. */
2180 +#include <stdlib.h>
2181 +#include <assert.h>
2182 +#include <sys/types.h>
2183 +#include <sys/uio.h>
2184 +#include <unistd.h>
2188 +#include <sys/mman.h>
2190 +// Mach include files for typedefs, return values, etc
2191 +//~ #include <mach/mach.h>
2192 +#include <mach/kern_return.h>
2193 +#include <mach/vm_types.h>
2194 +#include <mach/mach_types.h>
2195 +#include <mach/message.h>
2196 +#include <servers/bootstrap_defs.h>
2198 +/** The port for the current task. Ignored in this implementation. */
2199 +mach_port_t mach_task_self_ = 0;
2201 +/** The bootstrap port. Ignored in this implementation. */
2202 +mach_port_t bootstrap_port = 0;
2204 +#include <mach/ppc/ndr_def.h>
2206 +/** Maps the file descriptor into memory. Free the memory using vm_deallocate. Ignores findspace and offset. */
2207 +kern_return_t map_fd( int fd, vm_offset_t offset, vm_offset_t *va, boolean_t findspace, vm_size_t size)
2209 + void* space = NULL;
2213 + assert( offset == 0 );
2214 + //~ assert( *va == 0 );
2215 + assert( findspace == TRUE );
2217 + // Allocate memory
2218 + space = malloc( size );
2219 + assert( space != NULL );
2221 + // Read file into space
2222 + while(bytes < size) bytes += read( fd, ((char*)space) + bytes, size - bytes);
2223 + assert( bytes == size );
2226 + space = mmap( (void*) offset, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
2227 + // No permission: try to make it read only
2228 + if ( space == (void*) -1 && errno == EACCES )
2230 + space = mmap( (void*) offset, size, PROT_READ, MAP_SHARED, fd, 0 );
2232 + assert( space != NULL && space != (void*) -1 );
2235 + // Copy back the pointer
2236 + *va = (vm_offset_t) space;
2239 + return KERN_SUCCESS;
2242 +/** Returns a string appropriate to the error argument given. */
2243 +char* mach_error_string( int error_value )
2245 + char errorString[] = "Some fake mach error string.";
2247 + return errorString;
2250 +/** Returns the mach port for the current host. We fake it by returning zero. */
2251 +mach_port_t mach_host_self( void )
2256 +/** Returns the mach port for the current task. We fake it by returning zero. */
2257 +//~ mach_port_t mach_task_self( void )
2262 +/**The function vm_allocate allocates a region of virtual memory, placing it in the specified task's address space. Anywhere must be true, as the memory will be allocated anywhere. */
2263 +extern kern_return_t vm_allocate( mach_port_t target_task, vm_address_t *address, vm_size_t size, boolean_t anywhere )
2265 + assert( anywhere == TRUE );
2267 + // Anonymous memory map
2268 + *address = (vm_address_t) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANON, 0, 0 );
2269 + //~ *address = (vm_address_t) malloc( size );
2270 + assert( address != (vm_address_t) NULL );
2272 + return KERN_SUCCESS;
2275 +/**vm_deallocate relinquishes access to a region of a task's address space, causing further access to that memory to fail. This memory must have been allocated with vm_allocate. size is ignored. */
2276 +kern_return_t vm_deallocate( mach_port_t target_task, vm_address_t address, vm_size_t size )
2280 + assert( address != (vm_address_t) NULL );
2282 + // Free the memory
2283 + ret = munmap( (void*) address, size );
2284 + assert( ret == 0 );
2286 + //~ free( (void*) address );
2288 + return KERN_SUCCESS;
2291 +/** The function mach_port_allocate_name creates a new right in the specified task, with a specified name for the new right. In this implementation it does nothing. */
2292 +kern_return_t mach_port_allocate_name (mach_port_t task, mach_port_right_t right, mach_port_t name)
2294 + return KERN_SUCCESS;
2297 +/** The function mach_port_deallocate releases a user reference for a right in task's IPC name space. In this implementation it does nothing. */
2298 +kern_return_t mach_port_deallocate (mach_port_t task, mach_port_t name)
2300 + return KERN_SUCCESS;
2303 +/** host_info returns information about the host. It is not implemented in this implementation. */
2304 +kern_return_t host_info( host_t host, host_flavor_t flavor, host_info_t host_info_out, mach_msg_type_number_t *host_info_outCnt )
2307 + return KERN_FAILURE;
2310 +/** vm_msync unimplemented: It does nothing. */
2311 +kern_return_t vm_msync ( vm_map_t target_task, vm_address_t address, vm_size_t size, vm_sync_t sync_flags )
2313 + //~ assert( address != (vm_address_t) NULL );
2315 + //~ ret = msync( (void*) address, size, int flags);
2317 + return KERN_SUCCESS;
2320 +/** bootstrap_look_up unimplemented. */
2321 +kern_return_t bootstrap_look_up( mach_port_t bootstrap_port, name_t service_name, mach_port_t *service_port )
2324 + return KERN_FAILURE;
2327 +/** mach_msg unimplemented. Send and/or receive a message. If the message operation
2328 + * is interrupted, and the user did not request an indication
2329 + * of that fact, then restart the appropriate parts of the
2330 + * operation silently (trap version does not restart).
2332 +mach_msg_return_t mach_msg( mach_msg_header_t *msg, mach_msg_option_t option, mach_msg_size_t send_size,
2333 + mach_msg_size_t rcv_size, mach_port_name_t rcv_name, mach_msg_timeout_t timeout, mach_port_name_t notify)
2336 + return KERN_SUCCESS;