<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 --- - __clear_cache builtin is not disable with -fno-builtins on ARM"
   href="http://llvm.org/bugs/show_bug.cgi?id=16915">16915</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__clear_cache builtin is not disable with -fno-builtins on ARM
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>s_llvm@nedprod.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>This is a slightly difficult bug to explain without being able to supply
source. Still, I'll try.

I've added a new compiler-rt build target which looks like this:

Configs += full-arm asan-arm
Arch.full-arm := arm
Arch.asan-arm := arm

CFLAGS.full-arm = $(CFLAGS) -target armv7-unknown-nto-qnx8.0.0eabi -fno-builtin
-fno-rtti
CFLAGS.asan-arm := $(CFLAGS) -fPIE -fno-builtin -fno-rtti \
    -target armv7-unknown-nto-qnx8.0.0eabi --sysroot=$(QNX_TARGET) -mllvm
-arm-enable-ehabi

FUNCTIONS.full-arm := $(CommonFunctions) $(ArchFunctions.arm)
FUNCTIONS.asan-arm := $(AsanFunctions) $(InterceptionFunctions) \
                                          $(SanitizerCommonFunctions)

So, in other words, I've created a full support library for ARM, and it gets
compiled with -fno-builtin because I'm compiling hard editions of the builtins.

The problem is that trying to compile __clear_cache from lib/clear_cache.c
still errors because I'm trying to reimplement a builtin. I think this is
because the ARM target isn't correctly disabling __clear_cache when
-fno-builtins is specified, and that would be a bug.

To work around it I simply renamed lib/clear_cache.c to
lib/clear_cache.c.disabled and all now works, albeit minus a __clear_cache
implementation in the libclang_rt-full-arm.a.

Niall</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>