[Buildroot] [PATCH] package/openssh: fix compile issue for m68k

Waldemar Brodkorb wbx at openadk.org
Mon Aug 7 11:45:18 UTC 2023


Hi Giulio,
Giulio Benetti wrote,

> Hi Waldemar,
> 
> On 07/08/23 08:15, Waldemar Brodkorb wrote:
> > Hi Giulio,
> > Giulio Benetti wrote,
> > 
> > > On 06/08/23 20:39, Giulio Benetti wrote:
> > > > Hi Waldemar,
> > > > 
> > > > On 06/08/23 19:37, Waldemar Brodkorb wrote:
> > > > > Following ICE occurs:
> > > > > (cd openbsd-compat && /home/autobuild/make/make)
> > > > > make[2]: Entering directory '/home/autobuild/autobuild/instance-10/output-1/build/openssh-9.3p1/openbsd-compat'
> > > > > /home/autobuild/autobuild/instance-10/output-1/host/bin/m68k-buildroot-linux-uclibc-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O3 -g0  -pipe -Wno-error=format-truncation -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wimplicit-fallthrough -Wmisleading-indentation -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fzero-call-used-regs=all -fno-builtin-memset   -fPIC -I. -I.. -I. -I./.. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE -DHAVE_CONFIG_H -c bsd-asprintf.c
> > > > > /home/autobuild/autobuild/instance-10/output-1/host/bin/m68k-buildroot-linux-uclibc-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O3 -g0  -pipe -Wno-error=format-truncation -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wimplicit-fallthrough -Wmisleading-indentation -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fzero-call-used-regs=all -fno-builtin-memset   -fPIC -I. -I.. -I. -I./.. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE -DHAVE_CONFIG_H -c bsd-closefrom.c
> > > > > during RTL pass: zero_call_used_regs
> > > > > bsd-closefrom.c: In function 'closefrom':
> > > > > bsd-closefrom.c:151:1: internal compiler error: in change_address_1,
> > > > > at emit-rtl.c:2275
> > > > >     151 | }
> > > > >         | ^
> > > > > 0x7fa76f4bad09 __libc_start_main
> > > > >      ../csu/libc-start.c:308
> > > > > Please submit a full bug report,
> > > > > with preprocessed source if appropriate.
> > > > > Please include the complete backtrace with any bug report.
> > > > > See <http://bugs.buildroot.net/> for instructions.
> > > > > make[2]: *** [Makefile:106: bsd-closefrom.o] Error 1
> > > > > 
> > > > > Fixes following autobuild failure:
> > > > > http://autobuild.buildroot.net/results/d29/d29c662e41d8969e6a8aa24870e728bcc7050563/
> > > > > 
> > > > > Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
> > > > > ---
> > > > >    package/openssh/openssh.mk | 5 +++++
> > > > >    1 file changed, 5 insertions(+)
> > > > > 
> > > > > diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
> > > > > index e14d752290..65f02088a0 100644
> > > > > --- a/package/openssh/openssh.mk
> > > > > +++ b/package/openssh/openssh.mk
> > > > > @@ -35,6 +35,11 @@ define OPENSSH_PERMISSIONS
> > > > >        /var/empty d 755 root root - - - - -
> > > > >    endef
> > > > > +# workaround gcc ICE with 11.x/12.x and 13.x
> > > > > +ifeq ($(BR2_m68k),y)
> > > > > +OPENSSH_CONF_OPTS += --without-hardening
> > > > > +endif
> > > > > +
> > > > 
> > > > This deserves a gcc bug that I've added with this patch:
> > > > https://patchwork.ozlabs.org/project/buildroot/patch/20230806183738.257006-1-giulio.benetti@benettiengineering.com/
> > > > 
> > > > this is the bug:
> > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80786
> > > > 
> > > > and for consistency in Buildroot we tend to work-around gcc/binutils
> > > > bugs, whenever possible, by lowering the optimization to -O0, so I ask
> > > > you to send a patch doing this.
> > > > You can take as a model this commit for the commit log too:
> > > > https://gitlab.com/buildroot.org/buildroot/-/commit/803247337d35643afdca9718c4616500b9930f2d
> > > 
> > > By the way I've given a try with -O0 workaround but it still shows gcc
> > > ICE with gcc 13.2.0. So at this point I would disable hardening like
> > > you've proposed but by checking for BR2_TOOLCHAIN_HAS_GCC_BUG_80786
> > > instead of BR2_m68k. Can you provide such patch pointing that it
> > > depends on mine on a cover letter or after the 3 dashes?
> > 
> > Are you sure it is the same gcc bug we seeing here. I would say it
> > has something to do with -fzero-call-used-regs=all instead.
> 
> Oh, I think you are right, so can you please submit a new gcc bug for this?

I opened a bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110934

How to proceed now? Is it possible to append the CFLAGS
-fzero-call-used-regs=used somehow?

best regards
 Waldemar



More information about the buildroot mailing list