[28059] trunk/dports/cross
source_changes at macosforge.org
source_changes at macosforge.org
Sun Aug 19 09:31:39 PDT 2007
Revision: 28059
http://trac.macosforge.org/projects/macports/changeset/28059
Author: landonf at macports.org
Date: 2007-08-19 09:31:39 -0700 (Sun, 19 Aug 2007)
Log Message:
-----------
Include my patch for libtool support. Fixes linking of dylibs/bundles using static archives, eg:
arm-apple-darwin-cc -dynamiclib -o test.dylib input.a
Patch submitted to upstream, see:
http://developer.berlios.de/bugs/?func=detailbug&bug_id=11802&group_id=8664
Modified Paths:
--------------
trunk/dports/cross/arm-apple-darwin-binutils/Portfile
trunk/dports/cross/arm-apple-darwin-binutils/files/patch-Makefile.in
trunk/dports/cross/arm-apple-darwin-cc/Portfile
Added Paths:
-----------
trunk/dports/cross/arm-apple-darwin-binutils/files/patch-libtool-driver
trunk/dports/cross/arm-apple-darwin-cc/files/patch-libtool-driver
Modified: trunk/dports/cross/arm-apple-darwin-binutils/Portfile
===================================================================
--- trunk/dports/cross/arm-apple-darwin-binutils/Portfile 2007-08-19 15:57:25 UTC (rev 28058)
+++ trunk/dports/cross/arm-apple-darwin-binutils/Portfile 2007-08-19 16:31:39 UTC (rev 28059)
@@ -3,6 +3,7 @@
PortSystem 1.0
name arm-apple-darwin-binutils
version r118
+revision 1
categories cross iphone
maintainers landonf at macports.org openmaintainer at macports.org
description Binutils for arm-apple-darwin (iPhone) cross development
@@ -17,7 +18,8 @@
depends_build port:Libstreams
-patchfiles patch-Makefile.in
+patchfiles patch-Makefile.in \
+ patch-libtool-driver
set iphone_prefix ${prefix}/arm-apple-darwin
@@ -49,8 +51,10 @@
# Make the binaries externally visible.
system "cd ${destroot}/${prefix}/bin && ln -s ${iphone_prefix}/bin/arm-apple-darwin-ld ./"
system "cd ${destroot}/${prefix}/bin && ln -s ${iphone_prefix}/bin/arm-apple-darwin-as ./"
+ system "cd ${destroot}/${prefix}/bin && ln -s ${iphone_prefix}/bin/arm-apple-darwin-libtool ./"
# Set up non-prefixed binaries in the iphone bin directory
system "cd ${destroot}/${iphone_prefix}/bin && ln -s arm-apple-darwin-ld ld"
system "cd ${destroot}/${iphone_prefix}/bin && ln -s arm-apple-darwin-as as"
+ system "cd ${destroot}/${iphone_prefix}/bin && ln -s arm-apple-darwin-as libtool"
}
Modified: trunk/dports/cross/arm-apple-darwin-binutils/files/patch-Makefile.in
===================================================================
--- trunk/dports/cross/arm-apple-darwin-binutils/files/patch-Makefile.in 2007-08-19 15:57:25 UTC (rev 28058)
+++ trunk/dports/cross/arm-apple-darwin-binutils/files/patch-Makefile.in 2007-08-19 16:31:39 UTC (rev 28059)
@@ -9,14 +9,16 @@
heavenly:
install -d $(PREFIX)/heavenly && cp -Rn $(HEAVENLY)/* $(PREFIX)/heavenly
-@@ -27,8 +27,8 @@
+@@ -27,8 +27,9 @@
cctools:
install /usr/include/ar.h cctools/include
- cd cctools && $(MAKE)
+- cd cctools && $(MAKE)
++ cd cctools && $(MAKE) RC_CFLAGS=-DPREFIX=\"$(PREFIX)\"
- 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 cctools/as/aarm_dir/as $(DESTDIR)/$(PREFIX)/bin/arm-apple-darwin-as
+ install cctools/ld/ld_dir/ld.NEW $(DESTDIR)/$(PREFIX)/bin/arm-apple-darwin-ld
++ install cctools/misc/libtool.NEW $(DESTDIR)/$(PREFIX)/bin/arm-apple-darwin-libtool
driver:
cd driver && $(MAKE)
Added: trunk/dports/cross/arm-apple-darwin-binutils/files/patch-libtool-driver
===================================================================
--- trunk/dports/cross/arm-apple-darwin-binutils/files/patch-libtool-driver (rev 0)
+++ trunk/dports/cross/arm-apple-darwin-binutils/files/patch-libtool-driver 2007-08-19 16:31:39 UTC (rev 28059)
@@ -0,0 +1,61 @@
+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 }
+ };
+
Modified: trunk/dports/cross/arm-apple-darwin-cc/Portfile
===================================================================
--- trunk/dports/cross/arm-apple-darwin-cc/Portfile 2007-08-19 15:57:25 UTC (rev 28058)
+++ trunk/dports/cross/arm-apple-darwin-cc/Portfile 2007-08-19 16:31:39 UTC (rev 28059)
@@ -3,6 +3,7 @@
PortSystem 1.0
name arm-apple-darwin-cc
version r118
+revision 2
categories iphone
maintainers landonf at macports.org openmaintainer at macports.org
description Cross-compiler (driver) for arm-apple-darwin (iPhone)
@@ -20,7 +21,8 @@
patchfiles patch-Makefile.in \
patch-driver_Makefile.in \
- patch-driver_arm-cc-specs.in
+ patch-driver_arm-cc-specs.in \
+ patch-libtool-driver
set iphone_prefix ${prefix}/arm-apple-darwin
Added: trunk/dports/cross/arm-apple-darwin-cc/files/patch-libtool-driver
===================================================================
--- trunk/dports/cross/arm-apple-darwin-cc/files/patch-libtool-driver (rev 0)
+++ trunk/dports/cross/arm-apple-darwin-cc/files/patch-libtool-driver 2007-08-19 16:31:39 UTC (rev 28059)
@@ -0,0 +1,71 @@
+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 -L at prefix@/lib -larmfp
+-LDFLAGS_DYLIB=-syslibroot @prefix@/heavenly -lSystem -lgcc_s_v6.1 -L at prefix@/csu -ldylib1.o -single_module -dylib -dynamic
+-LDFLAGS_BUNDLE=-syslibroot @prefix@/heavenly -bundle -lSystem -lgcc_s_v6.1 -L at prefix@/csu @prefix@/csu/bundle1.o -dynamic
+ LDFLAGS_FRAMEWORKSDIR=-F at prefix@/heavenly/System/Library/Frameworks
+-
++LIBTOOL=@prefix@/bin/arm-apple-darwin-libtool
++LIBTOOL_FLAGS_DYLIB=-syslibroot @prefix@/heavenly -lSystem -lgcc_s_v6.1 -L at prefix@/csu -single_module -dynamic
++LIBTOOL_FLAGS_BUNDLE=-syslibroot @prefix@/heavenly -bundle -lSystem -lgcc_s_v6.1 -L at 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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070819/513e7222/attachment.html
More information about the macports-changes
mailing list