From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] Illegal instruction by python's xmlrpclib on powerpc64, gcc-4.9
Date: Thu, 5 Nov 2015 12:13:49 +0100 [thread overview]
Message-ID: <563B39ED.9080104@mind.be> (raw)
In-Reply-To: <CAM+bi4v7jN-HxYSExBuL7VhxLoxU7wry8nQQ1Y2zyLbMRGwDMA@mail.gmail.com>
On 05-11-15 11:27, Alvaro Gamez wrote:
> Hi, Arnout
>
> 2015-11-04 23:48 GMT+01:00 Arnout Vandecappelle <arnout@mind.be
> <mailto:arnout@mind.be>>:
>
> The problem is that the compiler doesn't seem to build 64-bit binaries unless
> -m64 is specified, but glibc is configured for 64-bit.
>
> Just adding -m64 to BR2_TARGET_OPTIMIZATION works around the issue.
>
>
> Well... that's seems to be not enough, as after adding this, compilation still
> fails:
>
> /tmp/test/output/host/usr/bin/powerpc64-buildroot-linux-gnu-gcc -nostdlib
> -nostartfiles -r -o /tmp/test/output/build/glibc-2.21/build/elf/librtld.map.o
> '-Wl,-('/tmp/test/output/build/glibc-2.21/build/elf/dl-allobjs.os
> /tmp/test/output/build/glibc-2.21/build/libc_pic.a -lgcc '-Wl,-)'
> -Wl,-Map,/tmp/test/output/build/glibc-2.21/build/elf/librtld.mapT
>
/tmp/test/output/host/usr/lib/gcc/powerpc64-buildroot-linux-gnu/4.9.3/../../../../powerpc64-buildroot-linux-gnu/bin/ld:
> skipping incompatible
> /tmp/test/output/host/usr/lib/gcc/powerpc64-buildroot-linux-gnu/4.9.3/libgcc.a
> when searching for -lgcc
>
/tmp/test/output/host/usr/lib/gcc/powerpc64-buildroot-linux-gnu/4.9.3/../../../../powerpc64-buildroot-linux-gnu/bin/ld:
> cannot find -lgcc
> collect2: error: ld returned 1 exit status
Oops, you're right, I wrote my mail before compilation was completely finished...
So we have to convince gcc to really build a ppc64 compiler. I can't readily
find a configure option to do that - except for the powerpc64-* tuple which we
already set.
Any ppc64 expert out there that can give a hint? Gustavo?
>
> If I also set BR2_TARGET_LDFLAGS="-melf64ppc", then the following happens:
>
> checking whether __attribute__((visibility())) is supported... yes
> checking for broken __attribute__((visibility()))... no
> checking for broken __attribute__((alias()))... no
> checking whether to put _rtld_local into .sdata section... no
> checking for .preinit_array/.init_array/.fini_array support... no
> configure: error: Need linker with .init_array/.fini_array support.
> package/pkg-generic.mk:178 <http://pkg-generic.mk:178>: recipe for target
> '/tmp/test/output/build/glibc-2.21/.stamp_configured' failed
> make[1]: *** [/tmp/test/output/build/glibc-2.21/.stamp_configured] Error 1
> common.mk:41 <http://common.mk:41>: recipe for target 'default' failed
> make: *** [default] Error 2
>
> Patching toolchain-wrapper.mk <http://toolchain-wrapper.mk> as you suggested:
> diff --git a/toolchain/toolchain-wrapper.mk <http://toolchain-wrapper.mk>
> b/toolchain/toolchain-wrapper.mk <http://toolchain-wrapper.mk>
> index af39071..de9124c 100644
> --- a/toolchain/toolchain-wrapper.mk <http://toolchain-wrapper.mk>
> +++ b/toolchain/toolchain-wrapper.mk <http://toolchain-wrapper.mk>
> @@ -30,6 +30,10 @@ ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
> TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
> endif
>
> +ifeq ($(BR2_ARCH_IS_64),y)
> +TOOLCHAIN_WRAPPER_ARGS += -DBR_64
> +endif
> +
> # For simplicity, build directly into the install location
> define TOOLCHAIN_BUILD_WRAPPER
> $(Q)mkdir -p $(HOST_DIR)/usr/bin
>
> The end result is the same as the first case, with ld complaining about -lgcc
Obviously, since it has exactly the same effect as setting it in
BR2_TARGET_OPTIMIZATION.
Regards,
Arnout
>
> Best regards
>
> --
> ?lvaro G?mez Machado
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
prev parent reply other threads:[~2015-11-05 11:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 9:40 [Buildroot] Illegal instruction by python's xmlrpclib on powerpc64, gcc-4.9 Alvaro Gamez
2015-11-03 14:17 ` Thomas Petazzoni
2015-11-03 19:20 ` Gustavo Zacarias
2015-11-03 19:25 ` Thomas Petazzoni
2015-11-04 10:18 ` Alvaro Gamez
2015-11-04 10:49 ` Thomas Petazzoni
2015-11-04 11:31 ` Alvaro Gamez
2015-11-04 15:24 ` Alvaro Gamez
2015-11-04 22:48 ` Arnout Vandecappelle
2015-11-05 10:27 ` Alvaro Gamez
2015-11-05 11:13 ` Arnout Vandecappelle [this message]
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=563B39ED.9080104@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/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