From 335308e07537661303639a04eaed2f5d19dcbec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sat, 5 Sep 2020 01:01:34 +0200 Subject: [PATCH] gdb: fix cross build for ppc* w/ gcc10 The generators sim/ppc built for the host architecture also have multiple defined symbols which is why CFLAGS_FOR_HOST needs the -fcommon flag as well. There are also warnings like returning the address of a stack variable which require -Wno-error to make gdb cross compile for ppc*. With these minimal changes in the template the sim/ppc issues are just ignored and should probably be fixed instead. --- srcpkgs/gdb/template | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template index d335bb4a16f..2356cadc808 100644 --- a/srcpkgs/gdb/template +++ b/srcpkgs/gdb/template @@ -25,8 +25,8 @@ if [ "${CROSS_BUILD}" ]; then CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" fi -CFLAGS+=" -fcommon" -CXXFLAGS+=" -fcommon" +CFLAGS+=" -fcommon -Wno-error" +CXXFLAGS+=" -fcommon -Wno-error" # Package build options build_options="gdbserver static python" desc_option_gdbserver="Enable support for building GDB server" @@ -41,7 +41,8 @@ post_extract() { } do_configure() { cd ${wrksrc}/build - ../configure ${configure_args/with-sysroot/with-build-sysroot} + ../configure ${configure_args/with-sysroot/with-build-sysroot} \ + CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon" export gl_cv_func_gettimeofday_clobber=no export gl_cv_func_working_strerror=yes export gl_cv_func_strerror_0_works=yes