grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: Re: PPC build failure with undefined symbols __ashldi3, _restgpr_14_x, ...
Date: Fri, 15 Nov 2013 18:35:39 +0400	[thread overview]
Message-ID: <20131115183539.1f4ddc75@opensuse.site> (raw)
In-Reply-To: <52862963.2060409@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5652 bytes --]

В Fri, 15 Nov 2013 15:02:11 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> On 15.11.2013 14:43, Andrey Borzenkov wrote:
> > В Fri, 15 Nov 2013 13:33:07 +0100
> > Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> > 
> >> On 15.11.2013 13:22, Andrey Borzenkov wrote:
> >>> В Fri, 15 Nov 2013 12:00:49 +0100
> >>> Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> >>>
> >>>> On 15.11.2013 06:19, Andrey Borzenkov wrote:
> >>>>> Sources at 6fcec439545c817fbc8e2f51c667a70037a34a76
> >>>>>
> >>>>> Building RPM for PPC (32 or 64 bits) I get
> >>>>>
> >>>>> [  187s] cat syminfo.lst | sort | gawk -f ../../grub-core/genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1)
> >>>>> [  187s] __ashldi3 in affs is not defined
> >>>>> [  187s] _restgpr_14_x in affs is not defined
> >>>>> [  187s] _restgpr_20_x in affs is not defined
> >>>>> [  187s] _restgpr_25_x in affs is not defined
> >>>>> [  187s] _restgpr_27_x in affs is not defined
> >>>>> [  187s] _restgpr_28_x in affs is not defined
> >>>>> [  187s] _restgpr_30_x in affs is not defined
> >>>>> ...
> >>>>>
> >>>>> for a long list of them.
> >>>>>
> >>>>> Full build logs are available as
> >>>>> https://build.opensuse.org/build/home:arvidjaar:grub2-next/openSUSE_Factory_PowerPC/ppc/grub2/_log
> >>>>> https://build.opensuse.org/build/home:arvidjaar:grub2-next/openSUSE_Factory_PowerPC/ppc64/grub2/_log
> >>>>>
> >>>>> I do not myself have access to any PPC system nor any experience with
> >>>>> them.
> >>>>>
> >>>> You don't have multilib installed.
> >>>
> >>> Could you elaborate? This is native build on PPC system. It has both 64
> >>> and 32 bit of gcc and libgcc installed:
> >>>
> >>> [   12s] libgcc_s1-32bit-4.8.1_20130909-5.1    ########################################
> >>> [   10s] libgcc_s1-4.8.1_20130909-5.1          ########################################
> >>> [   17s] gcc48-4.8.1_20130909-5.1              ########################################
> >>> [   17s] gcc48-32bit-4.8.1_20130909-5.1        ########################################
> >>>
> >>> This did build successfully until some recent changes (grub2 *is* part
> >>> of openSUSE for PPC). I compared logs for x86 and ppc and both say
> >>>
> >>> [  119s] checking for __bswapsi2... no
> >>> [  119s] checking for __bswapdi2... no
> >>> [  119s] checking for __ashldi3... no
> >>> [  120s] checking for __ashrdi3... no
> >>> [  120s] checking for __lshrdi3... no
> >>> [  120s] checking for __ucmpdi2... no
> >>> [  120s] checking for _restgpr_14_x... no
> >>>
> >>> unfortunately I'm stuck here. For all I can tell it should either fail
> >>> or succeed in both cases.
> >>>
> >> It should say all "no" on x86 and almost all "yes" on ppc. This output
> >> indicates that link with libgcc failed. You can look how exactly the
> >> test failed in config.log. Can you send me config.log ?
> > 
> > Initially it failed due to missing -lc. After adding glibc-devel-static
> > to buildrequires it now fails due to redefined abort:
> > 
> > [  121s] configure:25260: checking for __bswapsi2
> > [  121s] configure:25260: gcc -o conftest  -Os -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align -m32 -freg-struct-
> return -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -fno-stack-protector -Wl,--defsym,abort=main  -Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include  -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -static -m32 conftest.c -lgcc >&5
> > [  121s] conftest.c:385:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> > [  121s]  char __bswapsi2 ();
> > [  121s] conftest.c:385:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> > [  121s]  char __bswapsi2 ();
> > [  121s]  ^
> > [  121s] /usr/lib/gcc/powerpc64-suse-linux/4.8/../../../../lib/libc.a(abort.o): In function `abort':
> > [  121s] /home/abuild/rpmbuild/BUILD/glibc-2.18/stdlib/abort.c:51: multiple definition of `abort'
> > [  121s] collect2: error: ld returned 1 exit status
> > 
> Try this:
> diff --git a/configure.ac b/configure.ac
> index 2c4f019..cd96588 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -821,6 +821,8 @@ CFLAGS="$TARGET_CFLAGS -Wl,--defsym,abort=main"
>  fi
>  fi
> 
> +CFLAGS="$CFLAGS -nostdlib"
> +
>  # Check for libgcc symbols
>  AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3
> __ucmpdi2 _restgpr_14_x)
> 
> 
> > 
> > -static is added by grub2.spec. I'm not sure, why - is it really needed?
> > 

Actually removing explicit TARGET_LDFLAGS=-static in grub2.spec fixed
it. I now wonder why it was added in the first place.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-11-15 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15  5:19 PPC build failure with undefined symbols __ashldi3, _restgpr_14_x, Andrey Borzenkov
2013-11-15 11:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-15 12:22   ` Andrey Borzenkov
2013-11-15 12:33     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-15 13:43       ` Andrey Borzenkov
2013-11-15 14:02         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-15 14:35           ` Andrey Borzenkov [this message]
2013-11-15 14:41             ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-15 14:53               ` Andrey Borzenkov
2013-11-16  4:49               ` [PATCH] restore -nostdlib for libgcc symbols tests Andrey Borzenkov
2013-11-16 12:51                 ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131115183539.1f4ddc75@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).