<p>strace-5.4 fails to build from source with the following FLAGS:</p>
<p><code>CFLAGS="-O2 -pipe -march=native -flto=4 -fuse-linker-plugin"</code><br>
<code>LDFLAGS="-O2 -flto=4"</code></p>
<p>Error is:</p>
<pre><code>x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H   -I./linux/x86_64 -I./linux/x86_64 -I./linux -I./linux -I. -I.     -DIN_MPERS -DMPERS_IS_m32 -I./mpers-m32  -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Woverride-init -Wsign-compare -Wtype-limits -Wwrite-strings   -O2 -pipe -march=native -flto=4 -fuse-linker-plugin -c -o libmpers_m32_a-ipc_shmctl.o `test -f 'ipc_shmctl.c' || echo './'`ipc_shmctl.c
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H   -I./linux/x86_64 -I./linux/x86_64 -I./linux -I./linux -I. -I.     -DIN_MPERS -DMPERS_IS_m32 -I./mpers-m32  -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Woverride-init -Wsign-compare -Wtype-limits -Wwrite-strings   -O2 -pipe -march=native -flto=4 -fuse-linker-plugin -c -o libmpers_m32_a-loop.o `test -f 'loop.c' || echo './'`loop.c
fetch_struct_stat64.c: In function ‘m32_fetch_struct_stat64’:
fetch_struct_stat64.c:58:16: error: storage size of ‘buf’ isn’t known
   58 |  struct_stat64 buf;
      |                ^~~
fetch_struct_stat64.c:58:16: warning: unused variable ‘buf’ [-Wunused-variable]
make[2]: *** [Makefile:2983: libmpers_m32_a-fetch_struct_stat64.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/var/tmp/portage/dev-util/strace-5.4/work/strace-5.4'
make[1]: *** [Makefile:7494: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-util/strace-5.4/work/strace-5.4'
make: *** [Makefile:2321: all] Error 2
rm ioctlsort0 ioctlsort1 ioctlsort0.o ioctls_all2.h ioctlsort1.o ioctls_all1.h ioctls_all0.h ioctlsort2.o ioctlsort2
</code></pre>
<p>Building previous version (5.3) with same flags works.</p>
<p>Bisect revealed the following bad commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/strace/strace/commit/7e4c052fb29c6838b483d2c0adf9da45b3f01ee1/hovercard" href="https://github.com/strace/strace/commit/7e4c052fb29c6838b483d2c0adf9da45b3f01ee1"><tt>7e4c052</tt></a>:</p>
<pre><code>commit 7e4c052fb29c6838b483d2c0adf9da45b3f01ee1
Author: Eugene Syromyatnikov
Date:   Fri Feb 23 23:24:40 2018 +0100

    Add support for per-mpers compiler settings

    As some very special architectures require a separate compiler
    in order to compile binaries for additional supported personalities,
    we have to introduce such support.

    * Makefile.am (mpers_CPPFLAGS): Move $(strace_CPPFLAGS) ...
    (mpers_sh_opts): ... here.
    (mpers-m%.stamp:): Use $(mpers_CC) instead of $(CC) for compiler,
    pass $(mpers_CC_FLAGS) in quotes as it might be empty or contain spaces.
    ($(mpers_m32_targets)): Add @CFLAGS_FOR_M32@ to mpers_CC_FLAGS, set
    mpers_CPPFLAGS and mpers_CC.
    ($(mpers_mx32_targets)): Add @CFLAGS_FOR_MX32@ to mpers_CC_FLAGS, set
    mpers_CPPFLAGS and mpers_CC.
    * bootstrap (m_upper): Derive uppercase personality name.
    Set CC for mpers Makefile.am, add @CFLAGS_FOR_{M32,MX32}@ to
    MPERS_CC_FLAGS definition.
    * configure.ac: Derive default values for
    {CC,CPP,CFLAGS,CPPFLAGS}_FOR_{M32,MX32} from the respective CC, CPP,
    CFLAGS, and CPPFLAGS values.
    * m4/mpers.m4 (AC_DEFUN([st_MPERS])): Use
    {CC,CPP,CFLAGS,CPPFLAGS}_FOR_<$1> as CC, CPP, CFLAGS, and CPPFLAGS,
    respectively.  Enclose MPERS_CFLAGS in quotes in mpers.sh call.  Provide
    information about compiler in the AC_CACHE_CHECK message.
    * tests/Makefile.am (CC): New variable.

    Co-Authored-by: Dmitry V. Levin

 Makefile.am       | 16 ++++++++++------
 bootstrap         |  4 +++-
 configure.ac      |  6 ++++++
 m4/mpers.m4       | 33 +++++++++++++++++++++++++++++----
 tests/Makefile.am |  1 +
 5 files changed, 49 insertions(+), 11 deletions(-)
</code></pre>
<p>Downstream-Bug: <a href="https://bugs.gentoo.org/701516" rel="nofollow">https://bugs.gentoo.org/701516</a></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/114?email_source=notifications&email_token=AAFX7DFRBX6FJYVLAL5DYDTQWJWNVA5CNFSM4JTGW5XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5ABNQA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAFX7DAG55CZRTV62UX22SDQWJWNVANCNFSM4JTGW5XA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAFX7DAPCAKB7W3STTUISQDQWJWNVA5CNFSM4JTGW5XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5ABNQA.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/114?email_source=notifications\u0026email_token=AAFX7DFRBX6FJYVLAL5DYDTQWJWNVA5CNFSM4JTGW5XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5ABNQA",
"url": "https://github.com/strace/strace/issues/114?email_source=notifications\u0026email_token=AAFX7DFRBX6FJYVLAL5DYDTQWJWNVA5CNFSM4JTGW5XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5ABNQA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>