Index: Makefile.in =================================================================== --- Makefile.in (revision 118) +++ Makefile.in (working copy) @@ -29,6 +29,7 @@ cd cctools && $(MAKE) install -d cctools/as/aarm_dir/as $(PREFIX)/bin/arm-apple-darwin-as install -d cctools/ld/ld_dir/ld.NEW $(PREFIX)/bin/arm-apple-darwin-ld + install -d cctools/misc/libtool.NEW $(PREFIX)/bin/arm-apple-darwin-libtool driver: cd driver && $(MAKE) Index: driver/arm-cc-specs.in =================================================================== --- driver/arm-cc-specs.in (revision 118) +++ driver/arm-cc-specs.in (working copy) @@ -18,7 +18,7 @@ ASFLAGS=-arch arm LD=@prefix@/bin/arm-apple-darwin-ld LDFLAGS=-syslibroot @prefix@/heavenly @prefix@/csu/crt1.o % -lSystem -lgcc_s_v6.1 -lm -larmfp -LDFLAGS_DYLIB=-syslibroot @prefix@/heavenly -lSystem -lgcc_s_v6.1 -L@prefix@/csu -ldylib1.o -single_module -dylib -dynamic -LDFLAGS_BUNDLE=-syslibroot @prefix@/heavenly -bundle -lSystem -lgcc_s_v6.1 -L@prefix@/csu @prefix@/csu/bundle1.o -dynamic LDFLAGS_FRAMEWORKSDIR=-F@prefix@/heavenly/System/Library/Frameworks - +LIBTOOL=@prefix@/bin/arm-apple-darwin-libtool +LIBTOOL_FLAGS_DYLIB=-syslibroot @prefix@/heavenly -lSystem -lgcc_s_v6.1 -L@prefix@/csu -single_module -dynamic +LIBTOOL_FLAGS_BUNDLE=-syslibroot @prefix@/heavenly -bundle -lSystem -lgcc_s_v6.1 -L@prefix@/csu @prefix@/csu/bundle1.o -dynamic Index: driver/cc.c =================================================================== --- driver/cc.c (revision 118) +++ driver/cc.c (working copy) @@ -332,22 +332,31 @@ char * get_full_path(char *prog_name) { - char *path, *dir, *test_path; + char *envp, *dir, *path, *test_path; if (prog_name[0] == '/' || prog_name[0] == '.') return strdup(prog_name); - path = getenv("PATH"); + envp = getenv("PATH"); + if (!envp) + return NULL; + + /* Don't directly modify the environment */ + path = strdup(envp); if (!path) return NULL; + for (dir = strtok(path, ":"); dir != NULL; dir = strtok(NULL, ":")) { + asprintf(&test_path, "%s/%s", dir, prog_name); if (!access(test_path, X_OK)) { + free(path); return test_path; } free(test_path); } + free(path); return NULL; } @@ -688,9 +697,14 @@ } /* Run the linking step. */ - if (req_todo & TODO_LINK) - execute_step("LD", make_dylib ? "LDFLAGS_DYLIB" : make_bundle ? "LDFLAGS_BUNDLE" : "LDFLAGS", - linker_args, 2, "-o", output_path); + if (req_todo & TODO_LINK) { + if (make_dylib) + execute_step("LIBTOOL", "LIBTOOL_FLAGS_DYLIB", linker_args, 2, "-o", output_path); + else if (make_bundle) + execute_step("LIBTOOL", "LIBTOOL_FLAGS_BUNDLE", linker_args, 2, "-o", output_path); + else + execute_step("LD", "LDFLAGS", linker_args, 2, "-o", output_path); + } } void clean_up_temporary_files() Index: cctools/include/mach/machine.h =================================================================== --- cctools/include/mach/machine.h (revision 118) +++ cctools/include/mach/machine.h (working copy) @@ -296,6 +296,7 @@ #define CPU_SUBTYPE_ARM_A440 ((cpu_subtype_t) 3) #define CPU_SUBTYPE_ARM_M4 ((cpu_subtype_t) 4) #define CPU_SUBTYPE_ARM_A680 ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_ARM_1176JZ ((cpu_subtype_t) 6) /* * MC88000 subtypes Index: cctools/misc/libtool.c =================================================================== --- cctools/misc/libtool.c (revision 118) +++ cctools/misc/libtool.c (working copy) @@ -2369,7 +2369,7 @@ if((archs[i].arch_flag.cputype & CPU_ARCH_ABI64) == CPU_ARCH_ABI64) add_execute_list("ld64"); else - add_execute_list("ld"); + add_execute_list("arm-apple-darwin-ld"); // XXX run our own arm-aware linker for non-ABI64 targets. if(narchs != 0 && cmd_flags.arch_only_flag.name == NULL) add_execute_list("-arch_multiple"); if(archs != NULL){ Index: cctools/as/arm.c =================================================================== --- cctools/as/arm.c (revision 118) +++ cctools/as/arm.c (working copy) @@ -161,8 +161,8 @@ * Uninteresting machine-dependent boilerplate code * ------------------------------------------------------------------------- */ -const cpu_type_t md_cputype = 12; -const cpu_type_t md_cpusubtype = 6; +const cpu_type_t md_cputype = CPU_TYPE_ARM; +const cpu_type_t md_cpusubtype = CPU_SUBTYPE_ARM_1176JZ; const enum byte_sex md_target_byte_sex = LITTLE_ENDIAN_BYTE_SEX; const char md_comment_chars[] = "@"; Index: cctools/libstuff/arch.c =================================================================== --- cctools/libstuff/arch.c (revision 118) +++ cctools/libstuff/arch.c (working copy) @@ -62,7 +62,7 @@ { "m88k", CPU_TYPE_MC88000, CPU_SUBTYPE_MC88000_ALL }, { "i860", CPU_TYPE_I860, CPU_SUBTYPE_I860_ALL }, { "veo", CPU_TYPE_VEO, CPU_SUBTYPE_VEO_ALL }, - { "arm", CPU_TYPE_ARM, 12 }, + { "arm", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_1176JZ }, /* specific architecture implementations */ { "ppc601", CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_601 }, { "ppc603", CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_603 }, @@ -88,7 +88,6 @@ { "hppa7100LC", CPU_TYPE_HPPA, CPU_SUBTYPE_HPPA_7100LC }, { "veo1", CPU_TYPE_VEO, CPU_SUBTYPE_VEO_1 }, { "veo2", CPU_TYPE_VEO, CPU_SUBTYPE_VEO_2 }, - { "arm", CPU_TYPE_ARM, 12 }, { NULL, 0, 0 } };