[92177] trunk/dports/devel/cctools
jeremyhu at macports.org
jeremyhu at macports.org
Fri Apr 20 23:06:30 PDT 2012
Revision: 92177
https://trac.macports.org/changeset/92177
Author: jeremyhu at macports.org
Date: 2012-04-20 23:06:25 -0700 (Fri, 20 Apr 2012)
Log Message:
-----------
cctools: Use our libLTO.dylib
Modified Paths:
--------------
trunk/dports/devel/cctools/Portfile
Added Paths:
-----------
trunk/dports/devel/cctools/files/lto.patch
Modified: trunk/dports/devel/cctools/Portfile
===================================================================
--- trunk/dports/devel/cctools/Portfile 2012-04-21 03:29:44 UTC (rev 92176)
+++ trunk/dports/devel/cctools/Portfile 2012-04-21 06:06:25 UTC (rev 92177)
@@ -4,7 +4,7 @@
name cctools
# XCode 4.3
version 822
-revision 1
+revision 2
set llvm_version 3.0
categories devel
platforms darwin
@@ -25,7 +25,7 @@
depends_build path:lib/libprunetrie.a:ld64
depends_run port:llvm-${llvm_version}
-patchfiles PR-11136237.patch
+patchfiles PR-11136237.patch lto.patch
if {${os.arch} == "powerpc"} {
# XCode 3.1.4
@@ -40,6 +40,7 @@
} elseif {${os.major} <= 9} {
# XCode 3.2.6
version 795
+ revision 1
distname cctools-${version}
checksums rmd160 0932fa5a96b81e50528211abfec01a9b66790485 \
sha256 7fab7044b648e92a9fefd493a1bb6daa4246f24c5838d8b5c913a446e6bbd2ef
@@ -47,7 +48,7 @@
} elseif {${os.major} == 10} {
# XCode 4.2 (but we should be able to run the XCode 4.3 version on SL)
version 809
- revision 1
+ revision 2
distname cctools-${version}
checksums rmd160 f433124035ac0ef403bdc6edec087bdedd0b4375 \
sha256 03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad
@@ -66,8 +67,9 @@
reinplace "/^SUBDIRS_32/s/ld//" ${worksrcpath}/Makefile
reinplace "/^COMMON_SUBDIRS/s/ ld / /" ${worksrcpath}/Makefile
- # Use our chosen version of llvm-mc
+ # Use our chosen version of llvm
reinplace "s:\"llvm-mc\":\"llvm-mc-mp-${llvm_version}\":" ${worksrcpath}/as/driver.c
+ reinplace "s:@@LLVM_LIBDIR@@:${prefix}/libexec/llvm-${llvm_version}/lib:" ${worksrcpath}/libstuff/lto.c
foreach file [glob ${worksrcpath}/{*/,}Makefile] {
reinplace "s:/usr/local:${prefix}:g" ${file}
@@ -89,12 +91,14 @@
pre-build {
build.args-append \
+ RC_ProjectSourceVersion=${version} \
USE_DEPENDENCY_FILE=NO \
BUILD_DYLIBS=NO \
LTO=-DLTO_SUPPORT \
CC="${configure.cc}" \
CXX="${configure.cxx}" \
RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \
+ RC_ARCHS="[get_canonical_archs]" \
LLVM_MC="llvm-mc-mp-${llvm_version}" \
SDK="-I${prefix}/include"
@@ -109,12 +113,14 @@
pre-destroot {
destroot.args-append \
+ RC_ProjectSourceVersion=${version} \
USE_DEPENDENCY_FILE=NO \
BUILD_DYLIBS=NO \
LTO=-DLTO_SUPPORT \
CC="${configure.cc}" \
CXX="${configure.cxx}" \
RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \
+ RC_ARCHS="[get_canonical_archs]" \
LLVM_MC="llvm-mc-mp-${llvm_version}" \
SDK="-I${prefix}/include"
Added: trunk/dports/devel/cctools/files/lto.patch
===================================================================
--- trunk/dports/devel/cctools/files/lto.patch (rev 0)
+++ trunk/dports/devel/cctools/files/lto.patch 2012-04-21 06:06:25 UTC (rev 92177)
@@ -0,0 +1,35 @@
+--- libstuff/lto.c.orig 2012-04-20 22:44:19.000000000 -0700
++++ libstuff/lto.c 2012-04-20 22:51:04.000000000 -0700
+@@ -119,11 +119,19 @@ void **pmod) /* maybe NULL */
+ lto_path = makestr(prefix, "../lib/libLTO.dylib", NULL);
+
+ lto_handle = dlopen(lto_path, RTLD_NOW);
++ free(lto_path);
+ if(lto_handle == NULL){
+- free(lto_path);
+- lto_path = NULL;
+- lto_handle = dlopen("/Developer/usr/lib/libLTO.dylib",
+- RTLD_NOW);
++ const char *lto_paths[] = {
++ "@@LLVM_LIBDIR@@/libLTO.dylib",
++ "/Developer/usr/lib/libLTO.dylib",
++ "/usr/lib/libLTO.dylib",
++ "/Applications/Xcode.app/usr/lib/libLTO.dylib",
++ NULL
++ };
++ const char **p;
++ for(p = lto_paths; *p && !lto_handle ; p++) {
++ lto_handle = dlopen(*p, RTLD_NOW);
++ }
+ }
+ if(lto_handle == NULL)
+ return(0);
+@@ -147,8 +154,6 @@ void **pmod) /* maybe NULL */
+ lto_get_sym_attr == NULL ||
+ lto_get_sym_name == NULL){
+ dlclose(lto_handle);
+- if(lto_path != NULL)
+- free(lto_path);
+ return(0);
+ }
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120420/aae4824c/attachment.html>
More information about the macports-changes
mailing list