Skip to contentSkip to conversation

PPC build failure with undefined symbols __ashldi3, _restgpr_14_x, ...

PATCH In review Andrey Borzenkov 2 participants 11 messages Nov 15, 2013 – Nov 16, 2013

lore
Share & tools
lore
#0 lore raw

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.

x86 builds OK.

#1 lore raw
Quoted 14 lines · Andrey Borzenkov

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

...

Quoted 9 lines

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.

Quoted 7 lines

x86 builds OK.

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw

В Fri, 15 Nov 2013 12:00:49 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 17 lines · Andrey Borzenkov
Quoted 16 lines

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.

Quoted 8 lines
Quoted 7 lines

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.

Quoted 9 lines
Quoted 7 lines

x86 builds OK.

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#3 lore raw
Quoted 48 lines · Andrey Borzenkov

В Fri, 15 Nov 2013 12:00:49 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 17 lines · Andrey Borzenkov
Quoted 16 lines

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.

Quoted 8 lines
Quoted 7 lines

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
Quoted 3 lines

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 ?

Quoted 17 lines
Quoted 9 lines
Quoted 7 lines

x86 builds OK.

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#4 lore raw

В Fri, 15 Nov 2013 13:33:07 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 49 lines · Andrey Borzenkov
Quoted 48 lines

В Fri, 15 Nov 2013 12:00:49 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 17 lines · Andrey Borzenkov
Quoted 16 lines

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.

Quoted 8 lines
Quoted 7 lines

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
Quoted 6 lines
Quoted 3 lines

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

-static is added by grub2.spec. I'm not sure, why - is it really needed?

#5 lore raw
Quoted 59 lines · Andrey Borzenkov

В Fri, 15 Nov 2013 13:33:07 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 49 lines · Andrey Borzenkov
Quoted 48 lines

В Fri, 15 Nov 2013 12:00:49 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 17 lines · Andrey Borzenkov
Quoted 16 lines

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.

Quoted 8 lines
Quoted 7 lines

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
Quoted 6 lines
Quoted 3 lines

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 ?

Quoted 5 lines

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

Quoted 9 lines
[  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:

configure.ac +2 -0
index 2c4f019..cd96588 100644
@@ -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)

Quoted 10 lines

-static is added by grub2.spec. I'm not sure, why - is it really needed?

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#6 lore raw

В Fri, 15 Nov 2013 15:02:11 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 92 lines · Andrey Borzenkov
Quoted 59 lines

В Fri, 15 Nov 2013 13:33:07 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 49 lines · Andrey Borzenkov
Quoted 48 lines

В Fri, 15 Nov 2013 12:00:49 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 17 lines · Andrey Borzenkov
Quoted 16 lines

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.

Quoted 8 lines
Quoted 7 lines

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
Quoted 6 lines
Quoted 3 lines

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 ?

Quoted 5 lines

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

Quoted 9 lines
[  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:

configure.ac +2 -0
index 2c4f019..cd96588 100644
@@ -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)
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

-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.

#7 lore raw
Quoted 68 lines · Andrey Borzenkov

В Fri, 15 Nov 2013 15:02:11 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 65 lines · Andrey Borzenkov
Quoted 64 lines

В Fri, 15 Nov 2013 13:33:07 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 49 lines · Andrey Borzenkov
Quoted 48 lines

В Fri, 15 Nov 2013 12:00:49 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 17 lines · Andrey Borzenkov
Quoted 16 lines

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.

Quoted 8 lines
Quoted 7 lines

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
Quoted 6 lines
Quoted 3 lines

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-struc

t-

Quoted 27 lines
Quoted 27 lines

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

Quoted 9 lines
[  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:

configure.ac +2 -0
index 2c4f019..cd96588 100644
@@ -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)
Quoted 3 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

-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.

-static shouldn't create problems. Adding -nostdlib like I proposed should solve the problem.

Quoted 7 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#8 lore raw

В Fri, 15 Nov 2013 15:41:51 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 6 lines
Quoted 4 lines

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

-static shouldn't create problems. Adding -nostdlib like I proposed should solve the problem.

-static does cause problem at least with current packaging here. I prefer to remove flags that apparently are not needed than add yet another build requires which at the end will have the same result (more BR - longer build time, increased load).

Thank you for helping to find root cause for the issue!

#9 lore raw

PATCH 1/1 restore -nostdlib for libgcc symbols tests

In reply to Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 2 lines

-static shouldn't create problems. Adding -nostdlib like I proposed should solve the problem.

Right, it was fallout of "plug the leakage" patch. I think below patch is more aligned with the rest of code.

Commit 24f4e57c4684471da088c504dec0380886eece0c plugged leakage of CFLAGS between individual tests, which broke test for libgcc symbols. It needs -nostdlib which was set in previous test and inherited before. Set it explicitly.

---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure.ac +2 -2
index 2c4f019..1842910 100644
@@ -815,9 +815,9 @@ LIBS="$TARGET_LIBGCC"
 grub_ASM_USCORE
 if test "x$TARGET_APPLE_LINKER" = x0 ; then
 if test x$grub_cv_asm_uscore = xyes; then
-CFLAGS="$TARGET_CFLAGS -Wl,--defsym,_abort=_main"
+CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,_abort=_main"
 else
-CFLAGS="$TARGET_CFLAGS -Wl,--defsym,abort=main"
+CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,abort=main"
 fi
 fi
 
Signature · 1 line
tg: (59ba9d1..) u/configure_nostdlib (depends on: master)
#10 lore raw

Re: [PATCH] restore -nostdlib for libgcc symbols tests

Quoted 11 lines · Andrey Borzenkov
Quoted 2 lines

-static shouldn't create problems. Adding -nostdlib like I proposed should solve the problem.

Right, it was fallout of "plug the leakage" patch. I think below patch is more aligned with the rest of code.

Commit 24f4e57c4684471da088c504dec0380886eece0c plugged leakage of CFLAGS between individual tests, which broke test for libgcc symbols. It needs -nostdlib which was set in previous test and inherited before. Set it explicitly.

Go ahead

Quoted 21 lines
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure.ac +2 -2
index 2c4f019..1842910 100644
@@ -815,9 +815,9 @@ LIBS="$TARGET_LIBGCC"
 grub_ASM_USCORE
 if test "x$TARGET_APPLE_LINKER" = x0 ; then
 if test x$grub_cv_asm_uscore = xyes; then
-CFLAGS="$TARGET_CFLAGS -Wl,--defsym,_abort=_main"
+CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,_abort=_main"
 else
-CFLAGS="$TARGET_CFLAGS -Wl,--defsym,abort=main"
+CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,abort=main"
 fi
 fi