<p dir="auto">With the following commands,</p>
<div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./bootstrap
$ _pkg_arch=aarch64
$ export PATH="/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
$ CC=$_pkg_arch-linux-android21-clang \
  ./configure --prefix=/opt/android-libs/${_pkg_arch/_/-} \
    --host=$_pkg_arch-linux-android \
    --without-libunwind \
    --enable-mpers=no \
    --disable-gcc-Werror
$ make"><pre><code>$ ./bootstrap
$ _pkg_arch=aarch64
$ export PATH="/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
$ CC=$_pkg_arch-linux-android21-clang \
  ./configure --prefix=/opt/android-libs/${_pkg_arch/_/-} \
    --host=$_pkg_arch-linux-android \
    --without-libunwind \
    --enable-mpers=no \
    --disable-gcc-Werror
$ make
</code></pre></div>
<p dir="auto">Building fails with:</p>
<div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="In file included from sync_file_range.c:12:
./xlat/sync_file_range_flags.h:7:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
static_assert((SYNC_FILE_RANGE_WAIT_BEFORE) == (1), "SYNC_FILE_RANGE_WAIT_BEFORE != 1");
               ^
./xlat/sync_file_range_flags.h:10:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WRITE'
static_assert((SYNC_FILE_RANGE_WRITE) == (2), "SYNC_FILE_RANGE_WRITE != 2");
               ^
./xlat/sync_file_range_flags.h:13:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_AFTER'
static_assert((SYNC_FILE_RANGE_WAIT_AFTER) == (4), "SYNC_FILE_RANGE_WAIT_AFTER != 4");
               ^
./xlat/sync_file_range_flags.h:27:7: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
 XLAT(SYNC_FILE_RANGE_WAIT_BEFORE),
      ^
./xlat/sync_file_range_flags.h:30:7: error: use of undeclared identifier 'SYNC_FILE_RANGE_WRITE'
 XLAT(SYNC_FILE_RANGE_WRITE),
      ^
./xlat/sync_file_range_flags.h:33:7: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_AFTER'
 XLAT(SYNC_FILE_RANGE_WAIT_AFTER),
      ^
./xlat/sync_file_range_flags.h:40:10: error: invalid application of 'sizeof' to an incomplete type 'const struct xlat_data []'
 .size = ARRAY_SIZE(sync_file_range_flags_xdata),
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./macros.h:18:32: note: expanded from macro 'ARRAY_SIZE'
# define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
                               ^~~~
In file included from sync_file_range.c:12:
./xlat/sync_file_range_flags.h:44:5: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
  | XLAT_VAL_0
    ^
./xlat/sync_file_range_flags.h:28:34: note: expanded from macro 'XLAT_VAL_0'
 #define XLAT_VAL_0 ((unsigned) (SYNC_FILE_RANGE_WAIT_BEFORE))
                                 ^
./xlat/sync_file_range_flags.h:47:5: error: use of undeclared identifier 'SYNC_FILE_RANGE_WRITE'
  | XLAT_VAL_1
    ^
./xlat/sync_file_range_flags.h:31:34: note: expanded from macro 'XLAT_VAL_1'
 #define XLAT_VAL_1 ((unsigned) (SYNC_FILE_RANGE_WRITE))
                                 ^
./xlat/sync_file_range_flags.h:50:5: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_AFTER'
  | XLAT_VAL_2
    ^
./xlat/sync_file_range_flags.h:34:34: note: expanded from macro 'XLAT_VAL_2'
 #define XLAT_VAL_2 ((unsigned) (SYNC_FILE_RANGE_WAIT_AFTER))
                                 ^
10 errors generated."><pre><code>In file included from sync_file_range.c:12:
./xlat/sync_file_range_flags.h:7:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
static_assert((SYNC_FILE_RANGE_WAIT_BEFORE) == (1), "SYNC_FILE_RANGE_WAIT_BEFORE != 1");
               ^
./xlat/sync_file_range_flags.h:10:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WRITE'
static_assert((SYNC_FILE_RANGE_WRITE) == (2), "SYNC_FILE_RANGE_WRITE != 2");
               ^
./xlat/sync_file_range_flags.h:13:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_AFTER'
static_assert((SYNC_FILE_RANGE_WAIT_AFTER) == (4), "SYNC_FILE_RANGE_WAIT_AFTER != 4");
               ^
./xlat/sync_file_range_flags.h:27:7: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
 XLAT(SYNC_FILE_RANGE_WAIT_BEFORE),
      ^
./xlat/sync_file_range_flags.h:30:7: error: use of undeclared identifier 'SYNC_FILE_RANGE_WRITE'
 XLAT(SYNC_FILE_RANGE_WRITE),
      ^
./xlat/sync_file_range_flags.h:33:7: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_AFTER'
 XLAT(SYNC_FILE_RANGE_WAIT_AFTER),
      ^
./xlat/sync_file_range_flags.h:40:10: error: invalid application of 'sizeof' to an incomplete type 'const struct xlat_data []'
 .size = ARRAY_SIZE(sync_file_range_flags_xdata),
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./macros.h:18:32: note: expanded from macro 'ARRAY_SIZE'
# define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
                               ^~~~
In file included from sync_file_range.c:12:
./xlat/sync_file_range_flags.h:44:5: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
  | XLAT_VAL_0
    ^
./xlat/sync_file_range_flags.h:28:34: note: expanded from macro 'XLAT_VAL_0'
 #define XLAT_VAL_0 ((unsigned) (SYNC_FILE_RANGE_WAIT_BEFORE))
                                 ^
./xlat/sync_file_range_flags.h:47:5: error: use of undeclared identifier 'SYNC_FILE_RANGE_WRITE'
  | XLAT_VAL_1
    ^
./xlat/sync_file_range_flags.h:31:34: note: expanded from macro 'XLAT_VAL_1'
 #define XLAT_VAL_1 ((unsigned) (SYNC_FILE_RANGE_WRITE))
                                 ^
./xlat/sync_file_range_flags.h:50:5: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_AFTER'
  | XLAT_VAL_2
    ^
./xlat/sync_file_range_flags.h:34:34: note: expanded from macro 'XLAT_VAL_2'
 #define XLAT_VAL_2 ((unsigned) (SYNC_FILE_RANGE_WAIT_AFTER))
                                 ^
10 errors generated.
</code></pre></div>
<p dir="auto">This is a regression from <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/strace/strace/commit/bd87cc95120b3707a6fe55129451bb0453730a6d/hovercard" href="https://github.com/strace/strace/commit/bd87cc95120b3707a6fe55129451bb0453730a6d"><tt>bd87cc9</tt></a>,<br>
where "#unconditional" is added given that <linux/fs.h> is bundled,<br>
but the latter is not actually included.</p>
<p dir="auto">As a side note, SYNC_FILE_RANGE* symbols are not available with<br>
ANDROID_API__ < 26 [1].</p>
<p dir="auto">[1] <a href="https://android.googlesource.com/platform/bionic/+/refs/tags/android-12.0.0_r15/libc/include/fcntl.h#98" rel="nofollow">https://android.googlesource.com/platform/bionic/+/refs/tags/android-12.0.0_r15/libc/include/fcntl.h#98</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/strace/strace/pull/204'>https://github.com/strace/strace/pull/204</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/strace/strace/pull/204/commits/bdcc30dadb23f3cb4b13caa8669673fc8db81279" class="commit-link">bdcc30d</a>  Fix building for older Android</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/strace/strace/pull/204/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/strace/strace/pull/204/files#diff-b111394a0de63e65f60ae4b93970115a3029373d08ea580c28253fecd481913b">src/sync_file_range.c</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/strace/strace/pull/204/files#diff-24004e4db3aaf9de746239eeec2102088bc36b5c7dd50234a77465ca6909e75a">src/sync_file_range2.c</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/strace/strace/pull/204.patch'>https://github.com/strace/strace/pull/204.patch</a></li>
  <li><a href='https://github.com/strace/strace/pull/204.diff'>https://github.com/strace/strace/pull/204.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/strace/strace/pull/204">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AOVBTR7ZXMUQORXFL5ZCROTURMX5XANCNFSM5KIZKK5Q">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AOVBTRZ6NKJVYXXQ75XUSE3URMX5XA5CNFSM5KIZKK52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QEQ4DAQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><strace/strace/pull/204</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/strace/strace/pull/204",
"url": "https://github.com/strace/strace/pull/204",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>