<html>
<head>
<base href="https://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 --- - gcc POWER include headers- e.g. ppc-asm.h to be in clang"
href="https://llvm.org/bugs/show_bug.cgi?id=28286">28286</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>gcc POWER include headers- e.g. ppc-asm.h to be in clang
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>Headers
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>danielgb@au1.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Gcc contains a bunch of include headers on POWER hardware that aren't in clang.
One way to preserve compatibility with gcc the same headers need to be in
clang.
$ ls -la /usr/lib/gcc/powerpc64le-linux-gnu/6/include/
total 364
drwxr-xr-x 3 root root 4096 Jun 10 14:14 .
drwxr-xr-x 5 root root 4096 Jun 10 14:15 ..
-rw-r--r-- 1 root root 21205 May 11 03:54 altivec.h
-rw-r--r-- 1 root root 8761 May 11 06:19 backtrace.h
-rw-r--r-- 1 root root 2989 May 11 06:19 backtrace-supported.h
-rw-r--r-- 1 root root 8729 May 11 03:54 float.h
-rw-r--r-- 1 root root 4397 May 11 03:54 htmintrin.h
-rw-r--r-- 1 root root 5999 May 11 03:54 htmxlintrin.h
-rw-r--r-- 1 root root 1272 May 11 03:54 iso646.h
-rw-r--r-- 1 root root 6087 May 11 06:18 omp.h
-rw-r--r-- 1 root root 4655 May 11 06:18 openacc.h
-rw-r--r-- 1 root root 3135 May 11 03:54 paired.h
-rw-r--r-- 1 root root 7342 May 11 03:54 ppc-asm.h
-rw-r--r-- 1 root root 20866 May 11 03:54 ppu_intrinsics.h
drwxr-xr-x 2 root root 4096 Jun 10 14:14 sanitizer
-rw-r--r-- 1 root root 51710 May 11 03:54 si2vmx.h
-rw-r--r-- 1 root root 33373 May 11 03:54 spe.h
-rw-r--r-- 1 root root 54224 May 11 03:54 spu2vmx.h
-rw-r--r-- 1 root root 1210 May 11 03:54 stdalign.h
-rw-r--r-- 1 root root 4072 May 11 03:54 stdarg.h
-rw-r--r-- 1 root root 9321 May 11 03:54 stdatomic.h
-rw-r--r-- 1 root root 1524 May 11 03:54 stdbool.h
-rw-r--r-- 1 root root 13754 May 11 03:54 stddef.h
-rw-r--r-- 1 root root 6000 May 11 03:54 stdfix.h
-rw-r--r-- 1 root root 7029 May 11 03:54 stdint-gcc.h
-rw-r--r-- 1 root root 328 May 11 03:54 stdint.h
-rw-r--r-- 1 root root 1136 May 11 03:54 stdnoreturn.h
-rw-r--r-- 1 root root 10717 May 11 06:18 unwind.h
-rw-r--r-- 1 root root 139 May 11 03:54 varargs.h
-rw-r--r-- 1 root root 1792 May 11 03:54 vec_types.h
danielgb@p84:~$ uname -a
Linux p84 4.2.0-36-generic #42-Ubuntu SMP Thu May 12 22:02:52 UTC 2016 ppc64le
ppc64le ppc64le GNU/Linux
I discovered this after compiling mariadb-10.1 (which has the crc32 from
<a href="https://github.com/antonblanchard/crc32-vpmsum">https://github.com/antonblanchard/crc32-vpmsum</a>).
$ find /usr/lib/gcc/powerpc64le-linux-gnu/ | grep ppc-asm
/usr/lib/gcc/powerpc64le-linux-gnu/5/include/ppc-asm.h
The exact build line (from comping mariadb 10.1 branch)
[ 27%] Building ASM object
storage/xtradb/CMakeFiles/xtradb.dir/ut/crc32_power8/crc32.S.o
cd /build/build/storage/xtradb && /usr/bin/clang -DHAVE_CONFIG_H
-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1 -DHAVE_IB_GCC_ATOMIC_BUILTINS=1
-DHAVE_IB_GCC_ATOMIC_BUILTINS_64=1 -DHAVE_IB_GCC_ATOMIC_BUILTINS_BYTE=1
-DHAVE_IB_GCC_ATOMIC_TEST_AND_SET=1 -DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1
-DHAVE_IB_GCC_SYNC_SYNCHRONISE=1 -DHAVE_LZ4=1 -DLINUX_NATIVE_AIO=1
-DSIZEOF_PTHREAD_T=8 -I/build/build/include -I/source/storage/xtradb/include
-I/source/storage/xtradb/handler -I/source/include -I/source/sql
-I/build/build/pcre -I/source/pcre -I/source/zlib -I/usr/include -O2 -g
-DNDEBUG -DUNIV_LINUX -D_GNU_SOURCE=1 -fvisibility=hidden -o
CMakeFiles/xtradb.dir/ut/crc32_power8/crc32.S.o -c
/source/storage/xtradb/ut/crc32_power8/crc32.S
/source/storage/xtradb/ut/crc32_power8/crc32.S:29:10: fatal error: 'ppc-asm.h'
file not found
#include <ppc-asm.h>
^
1 error generated.
Adding strace -fe trace=stat,file -s 999 -o /tmp/clang.strace before the
clang exec in the failed build.
17332 open("/build/build/include/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such
file or directory)
17332 open("/source/storage/xtradb/include/ppc-asm.h", O_RDONLY) = -1 ENOENT
(No such file or directory)
17332 open("/source/storage/xtradb/handler/ppc-asm.h", O_RDONLY) = -1 ENOENT
(No such file or directory)
17332 open("/source/include/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file or
directory)
17332 open("/source/sql/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file or
directory)
17332 open("/build/build/pcre/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file
or directory)
17332 open("/source/pcre/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file or
directory)
17332 open("/source/zlib/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file or
directory)
17332 open("/usr/local/include/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file
or directory)
17332 open("/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/ppc-asm.h",
O_RDONLY) = -1 ENOENT (No such file or directory)
17332 open("/usr/include/powerpc64le-linux-gnu/ppc-asm.h", O_RDONLY) = -1
ENOENT (No such file or directory)
17332 open("/usr/include/ppc-asm.h", O_RDONLY) = -1 ENOENT (No such file or
directory)
17332 open("/source/storage/xtradb/ut/crc32_power8/ppc-asm.h", O_RDONLY) = -1
ENOENT (No such file or directory)
17332 open("/source/storage/xtradb/ut/crc32_power8/ppc-opcode.h", O_RDONLY) = 4
17332 open("/source/storage/xtradb/ut/crc32_power8/crc32_constants.h",
O_RDONLY) = 4
17332 lstat("/tmp/crc32-85823a.s-46503c6c", {st_mode=S_IFREG|0644,
st_size=31638, ...}) = 0</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>