<p></p>
<p>Version 5.11 includes bundled linux/socket.h (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/strace/strace/commit/4aeaf0c86d3a7cbc8b7608edeea8e4b1a676a391/hovercard" href="https://github.com/strace/strace/commit/4aeaf0c86d3a7cbc8b7608edeea8e4b1a676a391"><tt>4aeaf0c</tt></a>), and then building strace for Android is broken.</p>
<pre><code>x86_64-linux-android21-clang -DHAVE_CONFIG_H   -I./linux/x86_64 -I./linux/x86_64 -I./linux/generic -I./linux/generic -I. -I. -I../bundled/linux/arch/x86/include/uapi -I../bundled/linux/include/uapi -DIN_STRACE=1     -I./bundled/linux/arch/x86/include/uapi -I./bundled/linux/include/uapi -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Winitializer-overrides -Wnested-externs -Wold-style-definition -Woverride-init -Wsign-compare -Wtype-limits -Wwrite-strings   -g -O2 -MT libstrace_a-msghdr.o -MD -MP -MF .deps/libstrace_a-msghdr.Tpo -c -o libstrace_a-msghdr.o `test -f 'msghdr.c' || echo './'`msghdr.c
In file included from msghdr.c:16:
In file included from /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/arpa/inet.h:32:
In file included from /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/netinet/in.h:36:
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:27: error: field has incomplete type 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
                          ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:161:27: error: field has incomplete type 'struct sockaddr_storage'
  struct sockaddr_storage gsr_group;
                          ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:162:27: error: field has incomplete type 'struct sockaddr_storage'
  struct sockaddr_storage gsr_source;
                          ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:166:27: error: field has incomplete type 'struct sockaddr_storage'
  struct sockaddr_storage gf_group;
                          ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:169:35: error: array has incomplete element type 'struct sockaddr_storage'
  struct sockaddr_storage gf_slist[1];
                                  ^
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
msghdr.c:240:14: error: invalid application of 'sizeof' to an incomplete type 'struct sockaddr_storage'
                data_len > sizeof(struct sockaddr_storage)
                           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
msghdr.c:241:5: error: invalid application of 'sizeof' to an incomplete type 'struct sockaddr_storage'
                ? sizeof(struct sockaddr_storage) : data_len;
                  ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/linux/in.h:157:10: note: forward declaration of 'struct sockaddr_storage'
  struct sockaddr_storage gr_group;
         ^
7 errors generated.
</code></pre>
<p>Steps to reproduce:</p>
<ol>
<li>Instald Android NDK r22</li>
<li><code>export PATH="/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"</code></li>
<li><code>./bootstrap</code></li>
<li><code>CC=x86_64-linux-android21-clang ./configure --host=x86_64-linux-android --without-libunwind --enable-mpers=no --disable-gcc-Werror</code></li>
<li><code>make</code></li>
</ol>
<p>Similar errors occur with aarch64-linux-android21 as well. If I remove bundled <code>linux/socket.h</code>, building is fine for both x86_64 and aarch64.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/strace/strace/issues/174">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AOVBTR53K3MV2XMCKBU6ORTS7SSZFANCNFSM4XZVGTKQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AOVBTR6MTTCCUQABH7TIR4TS7SSZFA5CNFSM4XZVGTK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4MCTRSKA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/strace/strace/issues/174",
"url": "https://github.com/strace/strace/issues/174",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>