Index: Portfile
===================================================================
--- Portfile	(revision 141025)
+++ Portfile	(working copy)
@@ -2,8 +2,9 @@
 PortGroup               compiler_blacklist_versions 1.0
 
 name                    libcxx
+epoch                   1
 version                 3.9.1
-epoch                   1
+revision                1
 categories              lang
 platforms               darwin
 license                 MIT NCSA
@@ -44,7 +45,13 @@
 
     if {${os.major} < 11} {
         post-activate {
-            system "cd / && tar xzf ${roots_path}/${root_name}.tgz"
+            set dirs /
+            if {${os.subplatform} eq "macosx"} {
+                lappend dirs ${developer_dir}/SDKs/MacOSX${macosx_version}.sdk
+            }
+            foreach d ${dirs} {
+                system -W ${d} "tar xzf ${roots_path}/${root_name}.tgz"
+            }
         }
     }
 }
@@ -102,8 +109,8 @@
         xinstall -m 755 ${worksrcpath}/lib/libc++.1.dylib ${destroot}${roots_path}/${root_name}/usr/lib
         ln -s libc++.1.dylib ${destroot}${roots_path}/${root_name}/usr/lib/libc++.dylib
 
-        system "cd ${destroot}${roots_path}/${root_name} && tar czf ../${root_name}.tgz ."
-        file delete -force ${destroot}${roots_path}/${root_name}
+        system -W ${destroot}${roots_path}/${root_name} "tar czf ../${root_name}.tgz ."
+        delete ${destroot}${roots_path}/${root_name}
     }
 } else {
     distfiles
