<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56028>56028</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            error: definition of builtin function '__sync_synchronize'
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sunch20
      </td>
    </tr>
</table>

<pre>
    I use Clang 10 to replace GCC to compile C file, but it report error as:
```
../../lib/libc/src/exit/atexit.c:101:6: error: definition of builtin function '__sync_synchronize'
void __sync_synchronize(void)
     ^
1 error generated.
```
the compile options I used as: 
```
-g -gdwarf-2 -O2 -fno-builtin -ffreestanding -fno-pic -funsigned-char -ffunction-sections -fdata-sections -Wall -Wno-pragmas -fstack-protector-strong -Wformat=2 -nostdinc -nostdlib -std=gnu99 -Wpointer-arith -Wstrict-prototypes -fno-exceptions -pipe -fno-omit-frame-pointer -Winvalid-pch -fno-short-enums --target=arm-none-eabi -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -D__LITEOS__ -DSECUREC_IN_KERNEL=0 -D_ALL_SOURCE -DLOSCFG_KERNEL_CPP_EXCEPTIONS_SUPPORT -DTESTSTM32F429IGTX -DSTM32F429xx
```
I understand the option `-fno-builtin` is to disable the builtin function, it should solve my error, but I don't know why it doesn't work?


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVFtvqzgQ_jXkxXIEJtcHHrqUVNFmm6hJ1fOGjG3AW7CRbXI5v_6Mge4erfq2CMZz-TwzHs9QaP5I9qi3AqUNVRWKQuQ0MqJrKBPoJU29yHTbyQYgqIQlICkqeoek8zhtHBLGaIOoDeKnIHwOwqdgFU7vIM7nAdkNpJHFSBks1ngq7tLBQp1n5gx8RGEEdAXf6NkzXJRSSSe1QrqE8LJxUqGyV2zQBWSd5_ah2EBqo5X8CYm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