<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Makefile.rules broken for OS X >= 10.10"
   href="http://llvm.org/bugs/show_bug.cgi?id=19951">19951</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Makefile.rules broken for OS X >= 10.10
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Makefiles
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marcello.seri@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Compilation of llvm 3.3 is impossible in MacOSX 10.10 Yosemite. The variable
DARWIN_VERSION is stripped improperly giving rise to errors like the following:

clang++ -I/private/tmp/llvm33-9zPU/llvm-3.3.src/include
-I/private/tmp/llvm33-9zPU/llvm-3.3.src/lib/Transforms/Hello  -D_DEBUG
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -O3  -fvisibility-inlines-hidden -fno-exceptions
-fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual  -O3 -Wl,-rpath
-Wl,@executable_path/../lib
-L/private/tmp/llvm33-9zPU/llvm-3.3.src/Release+Asserts/lib
-L/private/tmp/llvm33-9zPU/llvm-3.3.src/Release+Asserts/lib  -m64  -pedantic
-Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings      
-Wl,-flat_namespace -Wl,-undefined,suppress -dynamiclib
-mmacosx-version-min=10.1 -o
/private/tmp/llvm33-9zPU/llvm-3.3.src/Release+Asserts/lib/LLVMHello.dylib
/private/tmp/llvm33-9zPU/llvm-3.3.src/lib/Transforms/Hello/Release+Asserts/Hello.o
\
      
-Wl,-exported_symbols_list,/private/tmp/llvm33-9zPU/llvm-3.3.src/lib/Transforms/Hello/Release+Asserts/Hello.exports.sed
-lz -lpthread -lffi -lm 
ld: -rpath can only be used when targeting Mac OS X 10.5 or later


The problem can be fixed as follows:

diff --git a/Makefile.rules b/Makefile.rules
index f0c542b..ec05ac3 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -571,9 +571,9 @@ ifeq ($(HOST_OS),Darwin)
   DARWIN_VERSION := `sw_vers -productVersion`
  endif
   # Strip a number like 10.4.7 to 10.4
-  DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E
's/(10.[0-9]).*/\1/')
+  DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E
's/(10.[0-9]+).*/\1/')
   # Get "4" out of 10.4 for later pieces in the makefile.
-  DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E
's/10.([0-9]).*/\1/')
+  DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E
's/10.([0-9]+).*/\1/')

   LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
   SharedLinkOptions := -dynamiclib</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>