* klibc: armv4 bx strikes again
@ 2014-08-25 8:08 Andrea Adami
2014-08-26 9:36 ` Andrea Adami
0 siblings, 1 reply; 5+ messages in thread
From: Andrea Adami @ 2014-08-25 8:08 UTC (permalink / raw)
To: openembeded-devel
I've recently discovered that the static klibc binaries produced for
armv4 contain Illegal instructions.
Eglibc armv4 binaries are ok.
I verified it happens to kexec-tools-klibc and kexecboot-klibc:
andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
./arm-oe-linux-gnueabi-objdump -S ./kexecboot-armv4 | grep bx
110dc: 012fff1e bxeq lr
11154: e12fff1e bx lr
11160: e12fff1e bx lr
11170: e12fff1e bx lr
1119c: e12fff1e bx lr
11234: e12fff1e bx lr
11240: e12fff1e bx lr
11250: e12fff1e bx lr
11268: e12fff1e bx lr
11298: e12fff1e bx lr
112b4: e12fff1e bx lr
112f0: e12fff1e bx lr
115f4: e12fff1e bx lr
andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
The binaries end-up compiled with following flags:
arm-oe-linux-gnueabi-klcc -march=armv4 -mthumb-interwork -Wall -o
kexecboot util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o menu.o
xpm.o rgb.o tui.o kexecboot.o fstype/fstype.o machine/zaurus.o
This is rather unexpected because klibc carries one specific patch to fix that:
http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch
and in fact looking at the produced klibc.config I see indeed LDFLAGS=
--fix-v4bx and that goes in *arm-oe-linux-gnueabi-klcc.
There have been big toolchain changes recently so I suspect something
got broken in oe-core.
Then there is a patch touching armv4/thumb but it doesn't look
suspicious at first:
http://cgit.openembedded.org/openembedded-core/commit/meta/conf/machine/include?id=1250d3e009363d20f15bbfaced622c5912a7fb93
As for klibc sources, I see only minor changes in the last versions so
I would say version is irrelevant.
Any hint?
Thanks in advance
Andrea
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: klibc: armv4 bx strikes again
2014-08-25 8:08 klibc: armv4 bx strikes again Andrea Adami
@ 2014-08-26 9:36 ` Andrea Adami
2014-08-26 16:41 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Andrea Adami @ 2014-08-26 9:36 UTC (permalink / raw)
To: openembeded-devel
On Mon, Aug 25, 2014 at 10:08 AM, Andrea Adami <andrea.adami@gmail.com> wrote:
> I've recently discovered that the static klibc binaries produced for
> armv4 contain Illegal instructions.
>
> Eglibc armv4 binaries are ok.
>
> I verified it happens to kexec-tools-klibc and kexecboot-klibc:
>
> andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
> ./arm-oe-linux-gnueabi-objdump -S ./kexecboot-armv4 | grep bx
> 110dc: 012fff1e bxeq lr
> 11154: e12fff1e bx lr
> 11160: e12fff1e bx lr
> 11170: e12fff1e bx lr
> 1119c: e12fff1e bx lr
> 11234: e12fff1e bx lr
> 11240: e12fff1e bx lr
> 11250: e12fff1e bx lr
> 11268: e12fff1e bx lr
> 11298: e12fff1e bx lr
> 112b4: e12fff1e bx lr
> 112f0: e12fff1e bx lr
> 115f4: e12fff1e bx lr
> andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
>
> The binaries end-up compiled with following flags:
>
> arm-oe-linux-gnueabi-klcc -march=armv4 -mthumb-interwork -Wall -o
> kexecboot util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o menu.o
> xpm.o rgb.o tui.o kexecboot.o fstype/fstype.o machine/zaurus.o
>
> This is rather unexpected because klibc carries one specific patch to fix that:
>
> http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch
>
> and in fact looking at the produced klibc.config I see indeed LDFLAGS=
> --fix-v4bx and that goes in *arm-oe-linux-gnueabi-klcc.
>
> There have been big toolchain changes recently so I suspect something
> got broken in oe-core.
> Then there is a patch touching armv4/thumb but it doesn't look
> suspicious at first:
>
> http://cgit.openembedded.org/openembedded-core/commit/meta/conf/machine/include?id=1250d3e009363d20f15bbfaced622c5912a7fb93
>
I guess that the problem is in the above commit...in klibc.bbclass we set:
export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc -march=armv4
-mthumb-interwork"
because we need interworking but no thumb code.
I'll try to further debug that.
Cheers
Andrea
> As for klibc sources, I see only minor changes in the last versions so
> I would say version is irrelevant.
>
> Any hint?
>
> Thanks in advance
>
> Andrea
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: klibc: armv4 bx strikes again
2014-08-26 9:36 ` Andrea Adami
@ 2014-08-26 16:41 ` Khem Raj
2014-08-27 8:39 ` Andrea Adami
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2014-08-26 16:41 UTC (permalink / raw)
To: openembedded-devel
On 14-08-26 11:36:34, Andrea Adami wrote:
> On Mon, Aug 25, 2014 at 10:08 AM, Andrea Adami <andrea.adami@gmail.com> wrote:
> > I've recently discovered that the static klibc binaries produced for
> > armv4 contain Illegal instructions.
> >
> > Eglibc armv4 binaries are ok.
> >
> > I verified it happens to kexec-tools-klibc and kexecboot-klibc:
> >
> > andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
> > ./arm-oe-linux-gnueabi-objdump -S ./kexecboot-armv4 | grep bx
> > 110dc: 012fff1e bxeq lr
> > 11154: e12fff1e bx lr
> > 11160: e12fff1e bx lr
> > 11170: e12fff1e bx lr
> > 1119c: e12fff1e bx lr
> > 11234: e12fff1e bx lr
> > 11240: e12fff1e bx lr
> > 11250: e12fff1e bx lr
> > 11268: e12fff1e bx lr
> > 11298: e12fff1e bx lr
> > 112b4: e12fff1e bx lr
> > 112f0: e12fff1e bx lr
> > 115f4: e12fff1e bx lr
> > andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
> >
> > The binaries end-up compiled with following flags:
> >
> > arm-oe-linux-gnueabi-klcc -march=armv4 -mthumb-interwork -Wall -o
> > kexecboot util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o menu.o
> > xpm.o rgb.o tui.o kexecboot.o fstype/fstype.o machine/zaurus.o
what is content of arm-oe-linux-gnueabi-klcc ? is it also used at link
step ? the option
> >
> > This is rather unexpected because klibc carries one specific patch to fix that:
> >
> > http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch
> >
> > and in fact looking at the produced klibc.config I see indeed LDFLAGS=
> > --fix-v4bx and that goes in *arm-oe-linux-gnueabi-klcc.
> >
> > There have been big toolchain changes recently so I suspect something
> > got broken in oe-core.
> > Then there is a patch touching armv4/thumb but it doesn't look
> > suspicious at first:
> >
> > http://cgit.openembedded.org/openembedded-core/commit/meta/conf/machine/include?id=1250d3e009363d20f15bbfaced622c5912a7fb93
> >
for tests
can you use FIX_V4BX_ARMV4 in
meta-initramfs/recipes-devtools/klibc/klibc.inc
and see if it helps
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: klibc: armv4 bx strikes again
2014-08-26 16:41 ` Khem Raj
@ 2014-08-27 8:39 ` Andrea Adami
2014-08-27 20:53 ` Andrea Adami
0 siblings, 1 reply; 5+ messages in thread
From: Andrea Adami @ 2014-08-27 8:39 UTC (permalink / raw)
To: openembeded-devel
On Tue, Aug 26, 2014 at 6:41 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On 14-08-26 11:36:34, Andrea Adami wrote:
>> On Mon, Aug 25, 2014 at 10:08 AM, Andrea Adami <andrea.adami@gmail.com> wrote:
>> > I've recently discovered that the static klibc binaries produced for
>> > armv4 contain Illegal instructions.
>> >
>> > Eglibc armv4 binaries are ok.
>> >
>> > I verified it happens to kexec-tools-klibc and kexecboot-klibc:
>> >
>> > andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
>> > ./arm-oe-linux-gnueabi-objdump -S ./kexecboot-armv4 | grep bx
>> > 110dc: 012fff1e bxeq lr
>> > 11154: e12fff1e bx lr
>> > 11160: e12fff1e bx lr
>> > 11170: e12fff1e bx lr
>> > 1119c: e12fff1e bx lr
>> > 11234: e12fff1e bx lr
>> > 11240: e12fff1e bx lr
>> > 11250: e12fff1e bx lr
>> > 11268: e12fff1e bx lr
>> > 11298: e12fff1e bx lr
>> > 112b4: e12fff1e bx lr
>> > 112f0: e12fff1e bx lr
>> > 115f4: e12fff1e bx lr
>> > andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
>> >
>> > The binaries end-up compiled with following flags:
>> >
>> > arm-oe-linux-gnueabi-klcc -march=armv4 -mthumb-interwork -Wall -o
>> > kexecboot util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o menu.o
>> > xpm.o rgb.o tui.o kexecboot.o fstype/fstype.o machine/zaurus.o
>
> what is content of arm-oe-linux-gnueabi-klcc ? is it also used at link
> step ? the option
>
>> >
>> > This is rather unexpected because klibc carries one specific patch to fix that:
>> >
>> > http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch
>> >
>> > and in fact looking at the produced klibc.config I see indeed LDFLAGS=
>> > --fix-v4bx and that goes in *arm-oe-linux-gnueabi-klcc.
>> >
>> > There have been big toolchain changes recently so I suspect something
>> > got broken in oe-core.
>> > Then there is a patch touching armv4/thumb but it doesn't look
>> > suspicious at first:
>> >
>> > http://cgit.openembedded.org/openembedded-core/commit/meta/conf/machine/include?id=1250d3e009363d20f15bbfaced622c5912a7fb93
>> >
>
> for tests
> can you use FIX_V4BX_ARMV4 in
> meta-initramfs/recipes-devtools/klibc/klibc.inc
> and see if it helps
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Hi,
I've added more output for klcc in klibc.bbclass
-export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc -march=armv4
-mthumb-interwork"
+export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc -v -march=armv4
-mthumb-interwork"
The resulting log is http://pastebin.com/rXQ0Vy1P
I'm very surprised to see that --with-gxx-include-dir, --with-sysroot
and --with-build-sysroot are absolutely wrong, peeking at another
machine sysroot.
It mixes armv4 and armv5...how can that happen?
I'll retry a build from scratch for the single armv4 arch asap.
Cheers
Andrea
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: klibc: armv4 bx strikes again
2014-08-27 8:39 ` Andrea Adami
@ 2014-08-27 20:53 ` Andrea Adami
0 siblings, 0 replies; 5+ messages in thread
From: Andrea Adami @ 2014-08-27 20:53 UTC (permalink / raw)
To: openembeded-devel
On Wed, Aug 27, 2014 at 10:39 AM, Andrea Adami <andrea.adami@gmail.com> wrote:
> On Tue, Aug 26, 2014 at 6:41 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On 14-08-26 11:36:34, Andrea Adami wrote:
>>> On Mon, Aug 25, 2014 at 10:08 AM, Andrea Adami <andrea.adami@gmail.com> wrote:
>>> > I've recently discovered that the static klibc binaries produced for
>>> > armv4 contain Illegal instructions.
>>> >
>>> > Eglibc armv4 binaries are ok.
>>> >
>>> > I verified it happens to kexec-tools-klibc and kexecboot-klibc:
>>> >
>>> > andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
>>> > ./arm-oe-linux-gnueabi-objdump -S ./kexecboot-armv4 | grep bx
>>> > 110dc: 012fff1e bxeq lr
>>> > 11154: e12fff1e bx lr
>>> > 11160: e12fff1e bx lr
>>> > 11170: e12fff1e bx lr
>>> > 1119c: e12fff1e bx lr
>>> > 11234: e12fff1e bx lr
>>> > 11240: e12fff1e bx lr
>>> > 11250: e12fff1e bx lr
>>> > 11268: e12fff1e bx lr
>>> > 11298: e12fff1e bx lr
>>> > 112b4: e12fff1e bx lr
>>> > 112f0: e12fff1e bx lr
>>> > 115f4: e12fff1e bx lr
>>> > andrea@mizar:/oe/oe-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi$
>>> >
>>> > The binaries end-up compiled with following flags:
>>> >
>>> > arm-oe-linux-gnueabi-klcc -march=armv4 -mthumb-interwork -Wall -o
>>> > kexecboot util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o menu.o
>>> > xpm.o rgb.o tui.o kexecboot.o fstype/fstype.o machine/zaurus.o
>>
>> what is content of arm-oe-linux-gnueabi-klcc ? is it also used at link
>> step ? the option
>>
>>> >
>>> > This is rather unexpected because klibc carries one specific patch to fix that:
>>> >
>>> > http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch
>>> >
>>> > and in fact looking at the produced klibc.config I see indeed LDFLAGS=
>>> > --fix-v4bx and that goes in *arm-oe-linux-gnueabi-klcc.
>>> >
>>> > There have been big toolchain changes recently so I suspect something
>>> > got broken in oe-core.
>>> > Then there is a patch touching armv4/thumb but it doesn't look
>>> > suspicious at first:
>>> >
>>> > http://cgit.openembedded.org/openembedded-core/commit/meta/conf/machine/include?id=1250d3e009363d20f15bbfaced622c5912a7fb93
>>> >
>>
>> for tests
>> can you use FIX_V4BX_ARMV4 in
>> meta-initramfs/recipes-devtools/klibc/klibc.inc
>> and see if it helps
>> --
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
>
> Hi,
>
> I've added more output for klcc in klibc.bbclass
>
> -export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc -march=armv4
> -mthumb-interwork"
> +export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc -v -march=armv4
> -mthumb-interwork"
>
> The resulting log is http://pastebin.com/rXQ0Vy1P
>
> I'm very surprised to see that --with-gxx-include-dir, --with-sysroot
> and --with-build-sysroot are absolutely wrong, peeking at another
> machine sysroot.
> It mixes armv4 and armv5...how can that happen?
>
> I'll retry a build from scratch for the single armv4 arch asap.
>
Heh, unsurprisingly building from scratch for the armv4 target is flawless.
http://pastebin.com/MxWVPhd8
How klcc gets confused on multimachine builds is still unclear to me...
> Cheers
>
> Andrea
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-27 20:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-25 8:08 klibc: armv4 bx strikes again Andrea Adami
2014-08-26 9:36 ` Andrea Adami
2014-08-26 16:41 ` Khem Raj
2014-08-27 8:39 ` Andrea Adami
2014-08-27 20:53 ` Andrea Adami
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.