Revision: 91434 https://trac.macports.org/changeset/91434 Author: jeremyhu@macports.org Date: 2012-04-01 14:56:40 -0700 (Sun, 01 Apr 2012) Log Message: ----------- apple-gcc42: Build on Tiger Modified Paths: -------------- trunk/dports/lang/apple-gcc42/Portfile Added Paths: ----------- trunk/dports/lang/apple-gcc42/files/driverdriver-armcheck.patch Modified: trunk/dports/lang/apple-gcc42/Portfile =================================================================== --- trunk/dports/lang/apple-gcc42/Portfile 2012-04-01 20:59:09 UTC (rev 91433) +++ trunk/dports/lang/apple-gcc42/Portfile 2012-04-01 21:56:40 UTC (rev 91434) @@ -69,6 +69,7 @@ # incpath.patch : Don't prepend the -isysroot option argument to the compiler's own search paths # universal.patch : Set $CBUILD to $CHOST if $CBUILD is x86_64 and $CHOST is i686 (ie, don't "cross-compile") # driverdriver-num_infiles.patch : Fix linking with no input files (ie all static archives passed with -l...) +# driverdriver-armcheck.patch : Build fix for the driverdriver when arm support is not available (eg: Tiger) patchfiles \ system-libstdc++.patch \ @@ -82,7 +83,8 @@ werror-local-alloc.patch \ incpath.patch \ universal.patch \ - driverdriver-num_infiles.patch + driverdriver-num_infiles.patch \ + driverdriver-armcheck.patch # gcj fails to build: # gcc/java/lang.c: In function 'java_init': @@ -99,17 +101,6 @@ # system "cd ${workpath} && tar xjf ${distpath}/${dcore}" #} -platform darwin { - if {${os.major} < 9} { - depends_lib - depends_run - pre-fetch { - ui_error "$name does not build on Tiger or earlier." - error "unsupported platform" - } - } -} - post-patch { # Install documentation in a MacPorts location reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc @@ -117,6 +108,10 @@ # arch returns i386 even when we want x86_64 reinplace "/^BUILD=/ s:arch:echo ${build_arch}:" ${worksrcpath}/build_gcc + # This is set to isysroot/Developer/SDKs/MacOSX10.5.sdk mmacosx-version-min=10.5 + # which is not always right. Our CFLAGS should take care of this instead + reinplace "/^MULTILIB_EXTRA_OPTS/d" ${worksrcpath}/gcc/config/rs6000/t-darwin + if {${build_arch} == "ppc"} { reinplace "/^PPC_SYSROOT=/ s:=.*$:=/:" ${worksrcpath}/build_gcc } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.5.sdk]} { @@ -127,6 +122,10 @@ reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.3.9.sdk:" ${worksrcpath}/build_gcc } + if {${os.major} < 9} { + reinplace "/vproc.h/d" ${worksrcpath}/gcc/libgcov.c + } + # Disable -Werror for our bootstrap gcc if {${configure.compiler} == "clang" || ${configure.compiler} == "macports-clang"} { Added: trunk/dports/lang/apple-gcc42/files/driverdriver-armcheck.patch =================================================================== --- trunk/dports/lang/apple-gcc42/files/driverdriver-armcheck.patch (rev 0) +++ trunk/dports/lang/apple-gcc42/files/driverdriver-armcheck.patch 2012-04-01 21:56:40 UTC (rev 91434) @@ -0,0 +1,47 @@ +--- driverdriver.c.orig 2012-04-01 14:51:20.000000000 -0700 ++++ driverdriver.c 2012-04-01 14:52:27.000000000 -0700 +@@ -123,6 +123,7 @@ struct arch_config_guess_map arch_config + {"ppc", "powerpc"}, + {"ppc64", "powerpc"}, + {"x86_64", "i686"}, ++#ifdef CPU_TYPE_ARM + /* Note: It's required that all supported ARM architectures be listed + * here explicitly */ + {"arm", "arm"}, +@@ -131,6 +132,7 @@ struct arch_config_guess_map arch_config + {"xscale", "arm"}, + {"armv6", "arm"}, + {"armv7", "arm"}, ++#endif + {NULL, NULL} + }; + +@@ -212,10 +214,12 @@ get_arch_name (const char *name) + else map++; + } + a_info = (NXArchInfo *) NXGetArchInfoFromName (name); ++#ifdef CPU_TYPE_ARM + /* radr://7148788 emit diagnostic for ARM architectures not explicitly + * handled by the driver. */ + if (a_info && a_info->cputype == CPU_TYPE_ARM) + a_info = NULL; ++#endif + } else { + a_info = (NXArchInfo *) NXGetLocalArchInfo(); + if (a_info) { +@@ -778,6 +782,7 @@ add_arch_options (int index, const char + current_argv[arch_index] = "-march=pentium2"; + else if (!strcmp (arches[index], "x86_64")) + current_argv[arch_index] = "-m64"; ++#ifdef CPU_TYPE_ARM + else if (!strcmp (arches[index], "arm")) + current_argv[arch_index] = "-march=armv4t"; + else if (!strcmp (arches[index], "armv4t")) +@@ -790,6 +795,7 @@ add_arch_options (int index, const char + current_argv[arch_index] = "-march=armv6k"; + else if (!strcmp (arches[index], "armv7")) + current_argv[arch_index] = "-march=armv7a"; ++#endif + else + count = 0; +
participants (1)
-
jeremyhu@macports.org