diff --exclude Makefile -ur cctools-698.1/ar/ar.c mycctools-698.1/ar/ar.c --- cctools-698.1/ar/ar.c 2006-04-29 01:41:59.000000000 +0200 +++ mycctools-698.1/ar/ar.c 2009-03-30 17:30:22.747026880 +0200 @@ -84,6 +84,7 @@ #include "extern.h" #include "stuff/execute.h" #include "stuff/unix_standard_mode.h" +#include "stuff/allocate.h" CHDR chdr; u_int options; @@ -276,7 +277,7 @@ if(run_ranlib){ /* run ranlib -f or -q on the archive */ reset_execute_list(); - add_execute_list("ranlib"); + add_execute_list(makestr(BINDIR, "/", RANLIBPROG, NULL)); if(options & AR_S) add_execute_list("-f"); else diff --exclude Makefile -ur cctools-698.1/ar/archive.c mycctools-698.1/ar/archive.c --- cctools-698.1/ar/archive.c 2004-11-12 21:16:56.000000000 +0100 +++ mycctools-698.1/ar/archive.c 2009-03-30 19:05:31.768947463 +0200 @@ -68,6 +68,9 @@ #include #include +#include +#include +#include "stuff/ofile.h" #include #include @@ -84,6 +87,8 @@ #include "archive.h" #include "extern.h" +extern void error2(char *name); + typedef struct ar_hdr HDR; static char hb[sizeof(HDR) + 1]; /* real header */ @@ -107,11 +112,11 @@ goto opened; } if (errno != EEXIST) - error(archive); + error2(archive); mode &= ~O_EXCL; } if ((fd = open(archive, mode, DEFFILEMODE)) < 0) - error(archive); + error2(archive); /* * Attempt to place a lock on the opened file - if we get an @@ -142,7 +147,7 @@ case EISDIR: case EDEADLK: case ESTALE: - error(archive); + error2(archive); break; /* Locking is supported but we are out of resources right now */ @@ -151,7 +156,7 @@ /* Locking seems to not be working */ case ENOTSUP: case EHOSTUNREACH: - case EBADRPC: +// case EBADRPC: default: /* Filesystem does not support locking */ break; @@ -167,7 +172,7 @@ if ((nr = read(fd, buf, SARMAG) != SARMAG)) { if (nr >= 0) badfmt(); - error(archive); + error2(archive); } else if (bcmp(buf, ARMAG, SARMAG)) { unsigned long magic; memcpy(&magic, buf, sizeof(unsigned long)); @@ -183,7 +188,7 @@ badfmt(); } } else if (write(fd, ARMAG, SARMAG) != SARMAG) - error(archive); + error2(archive); if ((mode & O_ACCMODE) == O_RDWR) archive_opened_for_writing = 1; @@ -223,7 +228,7 @@ if (!nr) return (0); if (nr < 0) - error(archive); + error2(archive); badfmt(); } @@ -256,7 +261,7 @@ nr = read(fd, chdr.name, len); if (nr != len) { if (nr < 0) - error(archive); + error2(archive); badfmt(); } chdr.name[len] = 0; @@ -310,24 +315,24 @@ name, OLDARMAXNAME, name); (void)fflush(stderr); } - (void)sprintf(hb, HDR3, name, (long int)sb->st_mtimespec.tv_sec, + (void)sprintf(hb, HDR3, name, (long int)sb->st_mtime, (unsigned int)(u_short)sb->st_uid, (unsigned int)(u_short)sb->st_gid, - sb->st_mode, sb->st_size, ARFMAG); + sb->st_mode, (long long int)sb->st_size, ARFMAG); lname = 0; } else if (lname > sizeof(hdr->ar_name) || strchr(name, ' ')) (void)sprintf(hb, HDR1, AR_EFMT1, (lname + 3) & ~3, - (long int)sb->st_mtimespec.tv_sec, + (long int)sb->st_mtime, (unsigned int)(u_short)sb->st_uid, (unsigned int)(u_short)sb->st_gid, - sb->st_mode, sb->st_size + ((lname + 3) & ~3), + sb->st_mode, (long long int)sb->st_size + ((lname + 3) & ~3), ARFMAG); else { lname = 0; - (void)sprintf(hb, HDR2, name, (long int)sb->st_mtimespec.tv_sec, + (void)sprintf(hb, HDR2, name, (long int)sb->st_mtime, (unsigned int)(u_short)sb->st_uid, (unsigned int)(u_short)sb->st_gid, - sb->st_mode, sb->st_size, ARFMAG); + sb->st_mode, (long long int)sb->st_size, ARFMAG); } size = sb->st_size; } else { @@ -337,7 +342,7 @@ } if (write(cfp->wfd, hb, sizeof(HDR)) != sizeof(HDR)) - error(cfp->wname); + error2(cfp->wname); /* * For Rhapsody if long names are used then the name is padded with * '\0's to a 4 byte size. This keeps members on 4-byte boundaries @@ -345,13 +350,13 @@ */ if (lname) { if (write(cfp->wfd, name, lname) != (int)lname) - error(cfp->wname); + error2(cfp->wname); already_written = lname; if ((lname % 4) != 0) { static char pad[3] = "\0\0\0"; if (write(cfp->wfd, pad, 4-(lname%4)) != (int)(4-(lname%4))) - error(cfp->wname); + error2(cfp->wname); already_written += 4 - (lname % 4); } } @@ -395,23 +400,23 @@ sz -= nr; for (off = 0; off < nr; nr -= off, off += nw) if ((nw = write(to, buf + off, nr)) < 0) - error(cfp->wname); + error2(cfp->wname); } if (sz) { if (nr == 0) badfmt(); - error(cfp->rname); + error2(cfp->rname); } if (cfp->flags & RPAD && (size + chdr.lname) & 1 && (nr = read(from, buf, 1)) != 1) { if (nr == 0) badfmt(); - error(cfp->rname); + error2(cfp->rname); } if (cfp->flags & WPAD && (size + already_written) & 1 && write(to, &pad, 1) != 1) - error(cfp->wname); + error2(cfp->wname); } /* @@ -426,5 +431,5 @@ len = chdr.size + ((chdr.size + chdr.lname) & 1); if (lseek(fd, len, SEEK_CUR) == (off_t)-1) - error(archive); + error2(archive); } diff --exclude Makefile -ur cctools-698.1/ar/contents.c mycctools-698.1/ar/contents.c --- cctools-698.1/ar/contents.c 2003-08-13 02:02:29.000000000 +0200 +++ mycctools-698.1/ar/contents.c 2009-03-30 19:06:46.044295610 +0200 @@ -68,7 +68,7 @@ #include #include -#include +#include #include #include @@ -80,6 +80,7 @@ #include "archive.h" #include "extern.h" +#include "config.h" /* * contents -- @@ -102,9 +103,13 @@ else if (!(file = files(argv))) goto next; if (options & AR_V) { +#ifndef HAVE_STRMODE + /* Now defined in emulated.c */ + extern void strmode(int mode, char *bp); +#endif (void)strmode(chdr.mode, buf); (void)printf("%s %6d/%-6d %8qd ", - buf + 1, chdr.uid, chdr.gid, chdr.size); + buf + 1, chdr.uid, chdr.gid, (long long int)chdr.size); tp = localtime(&chdr.date); (void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp); (void)printf("%s %s\n", buf, file); diff --exclude Makefile -ur cctools-698.1/ar/misc.c mycctools-698.1/ar/misc.c --- cctools-698.1/ar/misc.c 2003-08-13 02:02:39.000000000 +0200 +++ mycctools-698.1/ar/misc.c 2009-03-30 17:33:05.597598349 +0200 @@ -81,6 +81,8 @@ #include "extern.h" #include "pathnames.h" +void error2(char *name); + char *tname = "temporary file"; /* temporary file "name" */ int @@ -105,7 +107,7 @@ sigfillset(&set); (void)sigprocmask(SIG_BLOCK, &set, &oset); if ((fd = mkstemp(path)) == -1) - error(tname); + error2(tname); (void)unlink(path); (void)sigprocmask(SIG_SETMASK, &oset, NULL); return (fd); @@ -164,12 +166,12 @@ badfmt() { - errno = EFTYPE; + errno = EINVAL; err(1, "%s", archive); } void -error(name) +error2(name) char *name; { diff --exclude Makefile -ur cctools-698.1/as/arm.c mycctools-698.1/as/arm.c --- cctools-698.1/as/arm.c 2008-03-26 01:37:24.000000000 +0100 +++ mycctools-698.1/as/arm.c 2009-03-30 17:43:31.532108027 +0200 @@ -745,7 +745,7 @@ || (symbol_get_value_expression (sp)->X_op_symbol && walk_no_bignums (symbol_get_value_expression (sp)->X_op_symbol))); } -#endif NOTYET +#endif /* NOTYET */ return 0; } @@ -2300,7 +2300,7 @@ /* No need to force the alignment, since we will have been coming from ARM mode, which is word-aligned. */ record_alignment (now_seg, 1); -#endif NOTYET +#endif /* NOTYET */ } mapping_state (MAP_THUMB); break; @@ -2317,7 +2317,7 @@ frag_align (2, 0, 0); record_alignment (now_seg, 1); -#endif NOTYET +#endif /* NOTYET */ } mapping_state (MAP_ARM); break; @@ -2372,7 +2372,7 @@ thumb_mode = 2; #ifdef NOTYET record_alignment (now_seg, 1); -#endif NOTYET +#endif /* NOTYET */ } demand_empty_rest_of_line (); @@ -2497,7 +2497,7 @@ as_bad (_("symbol `%s' already defined"), S_GET_NAME (symbolP)); pseudo_set (symbolP); -#endif NOTYET +#endif /* NOTYET */ demand_empty_rest_of_line (); @@ -2577,14 +2577,14 @@ if (temp #ifdef NOTYET && !need_pass_2 -#endif NOTYET +#endif /* NOTYET */ ) { #ifdef NOTYET if (!fill_p && subseg_text_p (now_seg)) frag_align_code (temp, 0); else -#endif NOTYET +#endif /* NOTYET */ { char fill[4]; md_number_to_chars(fill, temp_fill, 4); @@ -2595,9 +2595,9 @@ #ifdef NOTYET record_alignment (now_seg, temp); -#endif NOTYET +#endif /* NOTYET */ } -#endif NOTYET +#endif/* NOTYET */ static void s_bss (int ignore ATTRIBUTE_UNUSED) @@ -2610,7 +2610,7 @@ mapping_state (MAP_DATA); #else as_fatal(".bss directive not supported, use .zerofill for Mach-O files"); -#endif NOTYET +#endif /* NOTYET */ } static void @@ -2619,12 +2619,12 @@ /* Never make frag if expect extra pass. */ #ifdef NOTYET if (!need_pass_2) -#endif NOTYET +#endif /* NOTYET */ frag_align (1, 0, 0, 0); #ifdef NOTYET record_alignment (now_seg, 1); -#endif NOTYET +#endif /* NOTYET */ demand_empty_rest_of_line (); } @@ -2812,12 +2812,12 @@ Only make a frag if we have to. */ #ifdef NOTYET if (!need_pass_2) -#endif NOTYET +#endif /* NOTYET */ frag_align (2, 0, 0, 0); #ifdef NOTYET record_alignment (now_seg, 2); -#endif NOTYET +#endif /* NOTYET */ sprintf (sym_name, "$$lit_\002%x", pool->id); @@ -2891,7 +2891,7 @@ { "file", (void (*) (int)) dwarf2_directive_file, 0 }, { "loc", dwarf2_directive_loc, 0 }, { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, -#endif NOTYET +#endif /* NOTYET */ #endif { "extend", float_cons, 'x' }, { "ldouble", float_cons, 'x' }, @@ -12772,7 +12772,7 @@ #ifdef NOTYET new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0, pc_rel, reloc); -#endif NOTYET +#endif /* NOTYET */ break; } @@ -13137,7 +13137,7 @@ S_SET_VALUE (last_label_seen, (valueT) frag_now_fix ()); S_SET_SEGMENT (last_label_seen, now_seg); } -#endif NOTYET +#endif /* NOTYET */ memset (&inst, '\0', sizeof (inst)); inst.reloc.type = BFD_RELOC_UNUSED; @@ -17733,7 +17733,7 @@ if (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v1)) opcode_select (16); } -#endif NOTYET +#endif /* NOTYET */ void md_begin (void) @@ -17951,7 +17951,7 @@ mach = bfd_mach_arm_unknown; bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); -#endif NOTYET +#endif /* NOTYET */ if (force_cpusubtype_ALL) md_cpusubtype = CPU_SUBTYPE_ARM_ALL; @@ -17976,6 +17976,7 @@ ARM_FEATURE (ARM_AEXT_V6ZK, FPU_VFP_V2); cpu_variant = arm_arch_v6zk_vfp_v2; } +/* case CPU_SUBTYPE_ARM_V7: { static const arm_feature_set arm_arch_v7_vfp_v3_plus_neon_v1 = @@ -17983,6 +17984,7 @@ cpu_variant = arm_arch_v7_vfp_v3_plus_neon_v1; } break; +*/ } } diff --exclude Makefile -ur cctools-698.1/as/driver.c mycctools-698.1/as/driver.c --- cctools-698.1/as/driver.c 2006-11-18 00:03:01.000000000 +0100 +++ mycctools-698.1/as/driver.c 2009-03-30 19:09:00.615115166 +0200 @@ -59,11 +59,15 @@ */ bufsize = MAXPATHLEN; p = buf; +#ifdef __APPLE__ i = _NSGetExecutablePath(p, &bufsize); if(i == -1){ p = allocate(bufsize); _NSGetExecutablePath(p, &bufsize); } +#else + strcpy(p, "/proc/self/exe"); +#endif prefix = realpath(p, resolved_name); p = rindex(prefix, '/'); if(p != NULL) diff --exclude Makefile -ur cctools-698.1/as/frags.c mycctools-698.1/as/frags.c --- cctools-698.1/as/frags.c 2008-02-29 02:02:40.000000000 +0100 +++ mycctools-698.1/as/frags.c 2009-03-30 17:46:54.950323239 +0200 @@ -39,6 +39,12 @@ NULL, /* fr_opcode */ rs_fill, /* fr_type */ 0, /* fr_subtype */ +#ifdef ARM + NULL, + 0, + 0, + 0, +#endif {0} /* fr_literal [0] */ }; diff --exclude Makefile -ur cctools-698.1/as/read.c mycctools-698.1/as/read.c --- cctools-698.1/as/read.c 2008-03-26 01:37:24.000000000 +0100 +++ mycctools-698.1/as/read.c 2009-03-30 17:36:51.703615115 +0200 @@ -2502,7 +2502,7 @@ *p = 0; if(strlen(segname) > sizeof(s.segname)){ as_bad("segment-name: %s too long (maximum %ld characters)", - segname, sizeof(s.segname)); + segname, (long int)sizeof(s.segname)); ignore_rest_of_line(); *p = c; return; @@ -2511,7 +2511,7 @@ *q = 0; if(strlen(sectname) > sizeof(s.sectname)){ as_bad("section-name: %s too long (maximum %ld characters)", - sectname, sizeof(s.sectname)); + sectname, (long int)sizeof(s.sectname)); ignore_rest_of_line(); return; } @@ -2661,7 +2661,7 @@ *p = 0; if(strlen(segname) > sizeof(s.segname)){ as_bad("segment-name: %s too long (maximum %ld characters)", - segname, sizeof(s.segname)); + segname, (long int)sizeof(s.segname)); ignore_rest_of_line(); *p = c; return; @@ -2670,7 +2670,7 @@ *q = 0; if(strlen(sectname) > sizeof(s.sectname)){ as_bad("section-name: %s too long (maximum %ld characters)", - sectname, sizeof(s.sectname)); + sectname, (long int)sizeof(s.sectname)); ignore_rest_of_line(); *p = c; *q = d; diff --exclude Makefile -ur cctools-698.1/as/sections.c mycctools-698.1/as/sections.c --- cctools-698.1/as/sections.c 2007-06-06 03:00:46.000000000 +0200 +++ mycctools-698.1/as/sections.c 2009-03-30 17:37:02.127523585 +0200 @@ -25,6 +25,7 @@ */ #include #include +#include #include "sections.h" #include "obstack.h" #include "xmalloc.h" diff --exclude Makefile -ur cctools-698.1/include/stuff/bytesex.h mycctools-698.1/include/stuff/bytesex.h --- cctools-698.1/include/stuff/bytesex.h 2008-03-28 01:49:09.000000000 +0100 +++ mycctools-698.1/include/stuff/bytesex.h 2009-03-30 17:24:17.970226714 +0200 @@ -233,6 +233,7 @@ /* current i386 thread states */ #if i386_THREAD_STATE == 1 +#define __darwin_i386_float_state i386_float_state __private_extern__ void swap_i386_float_state( struct __darwin_i386_float_state *fpu, enum byte_sex target_byte_sex); diff --exclude Makefile -ur cctools-698.1/ld/ld.c mycctools-698.1/ld/ld.c --- cctools-698.1/ld/ld.c 2008-02-04 23:28:55.000000000 +0100 +++ mycctools-698.1/ld/ld.c 2009-03-30 19:11:00.522063918 +0200 @@ -457,7 +457,9 @@ * This is for the ProjectBuilder (formally MakeApp) interface. */ static int talking_to_ProjectBuilder = 0; +#if 0 static mach_port_t ProjectBuilder_port; +#endif static void check_for_ProjectBuilder(void); /* The signal hander routine for SIGINT, SIGTERM, SIGBUS & SIGSEGV */ @@ -2539,7 +2541,7 @@ "-segs_read_only_addr 0x%x and " "-segs_read_write_addr 0x%x because " "LD_SPLITSEGS_NEW_LIBRARIES environment is " - "set",(unsigned int)seg1addr, 0, arch_rw_addr); + "set",(unsigned int)seg1addr, 0, (unsigned int)arch_rw_addr); } seg1addr_specified = FALSE; seg1addr = 0; @@ -3330,6 +3332,7 @@ void check_for_ProjectBuilder(void) { +#if 0 char *portName; #if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__) char *hostName; @@ -3353,6 +3356,7 @@ if(ProjectBuilder_port == MACH_PORT_NULL) return; talking_to_ProjectBuilder = 1; +#endif } /* @@ -3364,6 +3368,7 @@ tell_ProjectBuilder( char *message) { +#if 0 make_alert(ProjectBuilder_port, 2, /* eventType */ NULL, 0, /* functionName, not used by ProjectBuilder */ @@ -3371,6 +3376,7 @@ NULL, 0, /* directory */ 0, /* line */ message, strlen(message)+1 > 1024 ? 1024 : strlen(message)+1); +#endif } /* diff --exclude Makefile -ur cctools-698.1/ld/ld.h mycctools-698.1/ld/ld.h --- cctools-698.1/ld/ld.h 2007-04-26 01:56:58.000000000 +0200 +++ mycctools-698.1/ld/ld.h 2009-03-30 18:45:50.291311275 +0200 @@ -24,6 +24,9 @@ #define __private_extern__ __declspec(private_extern) #endif +#undef __private_extern__ +#define __private_extern__ extern __attribute__((visibility("hidden"))) + /* * Global types, variables and routines declared in the file ld.c. * @@ -376,3 +379,7 @@ #ifdef DEBUG __private_extern__ unsigned long debug; /* link-editor debugging */ #endif /* DEBUG */ + +#undef __private_extern__ +#include "extern.h" + diff --exclude Makefile -ur cctools-698.1/ld/pass1.c mycctools-698.1/ld/pass1.c --- cctools-698.1/ld/pass1.c 2007-09-08 02:51:28.000000000 +0200 +++ mycctools-698.1/ld/pass1.c 2009-03-30 19:11:54.597588923 +0200 @@ -1424,14 +1424,14 @@ if(ranlibs[i].ran_off % sizeof(short) != 0){ error("malformed table of contents in: %s (ranlib struct %lu " "library member offset not a multiple of %lu bytes, can't" - " load from it)", file_name, i, sizeof(short)); + " load from it)", file_name, i, (long unsigned int)sizeof(short)); return; } #else if(ranlibs[i].ran_off % sizeof(long) != 0){ error("malformed table of contents in: %s (ranlib struct %lu " "library member offset not a multiple of %lu bytes, can't" - " load from it)", file_name, i, sizeof(long)); + " load from it)", file_name, i, (long unsigned int)sizeof(long)); return; } #endif @@ -5999,7 +5999,11 @@ * symbols and if found sets *(int *)fail_p. */ static int +#if !defined(__APPLE__) +symbol_address_compare (const void *a_p, const void *b_p, void *fail_p) +#else symbol_address_compare (void *fail_p, const void *a_p, const void *b_p) +#endif { const struct nlist * const * aa = a_p; const struct nlist * a = *aa; @@ -6150,8 +6154,13 @@ sst = allocate (sizeof (struct nlist *) * cur_obj->symtab->nsyms); for (i = 0; i < cur_obj->symtab->nsyms; i++) sst[i] = st + i; - qsort_r (sst, cur_obj->symtab->nsyms, sizeof (struct nlist *), &has_stabs, - symbol_address_compare); +#if !defined(__APPLE__) + void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *thunk); + + qsort_r (sst, cur_obj->symtab->nsyms, sizeof (struct nlist *), symbol_address_compare, &has_stabs); +#else + qsort_r (sst, cur_obj->symtab->nsyms, sizeof (struct nlist *), &has_stabs, symbol_address_compare); +#endif if (has_stabs) { error_with_cur_obj("has both STABS and DWARF debugging info"); free (sst); diff --exclude Makefile -ur cctools-698.1/ld/pass1.h mycctools-698.1/ld/pass1.h --- cctools-698.1/ld/pass1.h 2006-04-29 01:51:57.000000000 +0200 +++ mycctools-698.1/ld/pass1.h 2009-03-30 18:46:30.426959054 +0200 @@ -24,6 +24,9 @@ #define __private_extern__ __declspec(private_extern) #endif +#undef __private_extern__ +#define __private_extern__ extern __attribute__((visibility("hidden"))) + /* * Global types, variables and routines declared in the file pass1.c. * @@ -178,3 +181,7 @@ char *strtab, unsigned long strsize); #endif /* RLD */ + +#undef __private_extern__ +#include "extern.h" + diff --exclude Makefile -ur cctools-698.1/ld/specs.c mycctools-698.1/ld/specs.c --- cctools-698.1/ld/specs.c 2006-04-29 01:51:58.000000000 +0200 +++ mycctools-698.1/ld/specs.c 2009-03-30 18:49:51.805192547 +0200 @@ -171,7 +171,7 @@ sizeof(s.segname)) == 0) error("segment names: %s and %s not unique to %lu " "characters\n", segment_specs[i].segname, - segment_specs[j].segname, sizeof(s.segname)); + segment_specs[j].segname, (long unsigned int)sizeof(s.segname)); } for(j = 0; j < segment_specs[i].nsection_specs; j++){ for(k = j + 1; k < segment_specs[i].nsection_specs; k++){ @@ -182,7 +182,7 @@ "to %lu characters\n", segment_specs[i].section_specs[j].sectname, segment_specs[i].section_specs[k].sectname, - segment_specs[i].segname, sizeof(s.segname)); + segment_specs[i].segname, (long unsigned int)sizeof(s.segname)); } } } diff --exclude Makefile -ur cctools-698.1/ld/symbols.c mycctools-698.1/ld/symbols.c --- cctools-698.1/ld/symbols.c 2008-02-04 23:29:09.000000000 +0100 +++ mycctools-698.1/ld/symbols.c 2009-03-30 18:49:59.093128614 +0200 @@ -3588,7 +3588,7 @@ print("Number of merged_symbol_lists = %lu (containing %d pointers " "each)\n", n, SYMBOL_LIST_HASH_SIZE); print("sizeof(struct merged_symbol_list) is %lu (total %lu)\n", - sizeof(struct merged_symbol_list), + (long unsigned int)sizeof(struct merged_symbol_list), n * sizeof(struct merged_symbol_list)); print("Number of used pointers in the lists = %lu (%.2f%%)\n", u, ((double)u) / ((double)(SYMBOL_LIST_HASH_SIZE * n)) * @@ -3613,7 +3613,7 @@ } print("The SYMBOL_LIST_HASH_SIZE is %d\n", SYMBOL_LIST_HASH_SIZE); print("sizeof(struct merged_symbol_root) is %lu\n", - sizeof(struct merged_symbol_root)); + (long unsigned int)sizeof(struct merged_symbol_root)); print("Number of additional chunks: %lu (size of these %lu)\n", c, c * sizeof(struct merged_symbol_chunk)); print("Number of hash entries used: %lu (%.2f%%) average #buckets " diff --exclude Makefile -ur cctools-698.1/ld/uuid.c mycctools-698.1/ld/uuid.c --- cctools-698.1/ld/uuid.c 2007-06-06 03:00:47.000000000 +0200 +++ mycctools-698.1/ld/uuid.c 2009-03-30 18:50:31.124847620 +0200 @@ -37,6 +37,8 @@ #endif /* !(defined(KLD) && defined(__STATIC__)) */ #include "ld.h" #include +#include +#include "config.h" /* * uuid() is called to set the uuid[] bytes for the uuid load command. @@ -48,8 +50,10 @@ { struct uuid_command u; #if !(defined(KLD) && defined(__STATIC__)) +#if 0 void (*uuid_func)(uint8_t *out); NSSymbol nssymbol; +#endif int fd; ssize_t n; @@ -59,11 +63,16 @@ * dynamically lookup uuid_generate_random() and if it is defined we * call it indirectly. */ +#if HAVE_NSISSYMBOLNAMEDEFINED if(NSIsSymbolNameDefined("_uuid_generate_random")){ nssymbol = (void *)NSLookupAndBindSymbol("_uuid_generate_random"); uuid_func = NSAddressOfSymbol(nssymbol); uuid_func(uuid); } +#else + uuid_generate_random(uuid); + if (1) { } +#endif /* * Since we don't have uuid_generate() just read bytes from /dev/urandom */ diff --exclude Makefile -ur cctools-698.1/libstuff/ofile.c mycctools-698.1/libstuff/ofile.c --- cctools-698.1/libstuff/ofile.c 2008-04-21 19:07:38.000000000 +0200 +++ mycctools-698.1/libstuff/ofile.c 2009-03-30 19:13:22.872814634 +0200 @@ -43,7 +43,15 @@ #include #include #import +#undef MACHINE_THREAD_STATE +#undef MACHINE_THREAD_STATE_COUNT +#undef THREAD_STATE_NONE +#undef VALID_THREAD_STATE_FLAVOR #import +#undef MACHINE_THREAD_STATE +#undef MACHINE_THREAD_STATE_COUNT +#undef THREAD_STATE_NONE +#undef VALID_THREAD_STATE_FLAVOR #import #import #import @@ -4049,7 +4057,7 @@ } break; } -#endif PPC_THREAD_STATE64_COUNT +#endif /* PPC_THREAD_STATE64_COUNT */ if(cputype == CPU_TYPE_MC88000){ m88k_thread_state_grf_t *cpu; m88k_thread_state_xrf_t *fpu; diff --exclude Makefile -ur cctools-698.1/misc/install_name_tool.c mycctools-698.1/misc/install_name_tool.c --- cctools-698.1/misc/install_name_tool.c 2008-03-21 20:15:04.000000000 +0100 +++ mycctools-698.1/misc/install_name_tool.c 2009-03-30 17:16:24.434380619 +0200 @@ -30,6 +30,7 @@ #include "stuff/breakout.h" #include "stuff/round.h" #include "stuff/allocate.h" +#include "config.h" /* used by error routines as the name of the program */ char *progname = NULL; diff --exclude Makefile -ur cctools-698.1/misc/libtool.c mycctools-698.1/misc/libtool.c --- cctools-698.1/misc/libtool.c 2008-07-10 02:51:58.000000000 +0200 +++ mycctools-698.1/misc/libtool.c 2009-03-30 19:14:47.052077149 +0200 @@ -51,7 +51,6 @@ #include "stuff/lto.h" #endif /* LTO_SUPPORT */ -#include "make.h" #include #if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__) #include @@ -331,11 +330,16 @@ (void)umask(oumask); /* see if this is being run as ranlib */ - p = strrchr(argv[0], '/'); + p = strrchr(argv[0], '-'); if(p != NULL) p++; - else - p = argv[0]; + else { + p = strrchr(argv[0], '/'); + if(p != NULL) + p++; + else + p = argv[0]; + } if(strncmp(p, "ranlib", sizeof("ranlib") - 1) == 0) cmd_flags.ranlib = TRUE; @@ -2833,6 +2837,7 @@ char *arch_name, char *fileName) { +#if 0 char message_buf[1024]; mach_port_t ProjectBuilder_port; char *portName; @@ -2868,6 +2873,7 @@ NULL, 0, 0, message_buf, strlen(message_buf) + 1); +#endif } /* @@ -2915,7 +2921,7 @@ */ for(i = 0; i < narchs || (i == 0 && narchs == 0); i++){ reset_execute_list(); - add_execute_list("ld"); + add_execute_list(makestr(BINDIR, "/", LDPROG, NULL)); if(narchs != 0 && cmd_flags.arch_only_flag.name == NULL) add_execute_list("-arch_multiple"); if(archs != NULL){ @@ -3015,7 +3021,7 @@ if(narchs > 1){ tellProjectBuilder("Combining into %s", "", cmd_flags.output); reset_execute_list(); - add_execute_list("lipo"); + add_execute_list(makestr(BINDIR, "/", LIPOPROG, NULL)); add_execute_list("-create"); add_execute_list("-output"); add_execute_list(cmd_flags.output); diff --exclude Makefile -ur cctools-698.1/misc/redo_prebinding.c mycctools-698.1/misc/redo_prebinding.c --- cctools-698.1/misc/redo_prebinding.c 2008-02-04 23:30:15.000000000 +0100 +++ mycctools-698.1/misc/redo_prebinding.c 2009-03-30 19:15:26.163733940 +0200 @@ -108,6 +108,7 @@ #import #import #import +#include "config.h" #include @@ -9744,6 +9745,7 @@ has_resource_fork( char *filename) { +#ifdef HAVE_GETATTRLIST int err; struct attrlist alist; struct fileinfobuf finfo; @@ -9795,6 +9797,7 @@ */ if((finfo.finderinfo[0] != 0) || (finfo.finderinfo[1] != 0)) return(TRUE); +#endif return(FALSE); } diff --exclude Makefile -ur cctools-698.1/misc/strip.c mycctools-698.1/misc/strip.c --- cctools-698.1/misc/strip.c 2008-04-01 20:35:49.000000000 +0200 +++ mycctools-698.1/misc/strip.c 2009-03-30 19:15:52.395503503 +0200 @@ -232,10 +232,12 @@ struct dylib_reference *refs, unsigned long nextrefsyms); +#ifdef NOTDEF static void make_ld_r_object( struct arch *arch, struct member *member, struct object *object); +#endif static void strip_LC_UUID_commands( struct arch *arch, @@ -3438,6 +3440,7 @@ return(FALSE); } +#if NOTDEF /* * make_ld_r_object() takes the object file contents referenced by the passed * data structures, writes that to a temporary file, runs "ld -r" plus the @@ -3509,7 +3512,7 @@ * Create the ld -r command line and execute it. */ reset_execute_list(); - add_execute_list("ld"); + add_execute_list(makestr(BINDIR, "/", LDPROG, NULL)); add_execute_list("-keep_private_externs"); add_execute_list("-r"); if(Sflag) @@ -3617,6 +3620,7 @@ free(input_file); free(output_file); } +#endif /* * strip_LC_UUID_commands() is called when -no_uuid is specified to remove any