* [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
@ 2015-09-11 12:49 Carlos Alberto Lopez Perez
2015-09-11 14:51 ` Phil Blundell
0 siblings, 1 reply; 8+ messages in thread
From: Carlos Alberto Lopez Perez @ 2015-09-11 12:49 UTC (permalink / raw)
To: openembedded-core
* When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
will fail to build with this error:
ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
---
meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb b/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
index 0d321d3..cde1c49 100644
--- a/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
+++ b/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
@@ -25,6 +25,8 @@ inherit autotools pkgconfig gettext gtk-immodules-cache distro_features_check
# The libxft, libfakekey and matchbox-panel-2 requires x11 in DISTRO_FEATURES
REQUIRED_DISTRO_FEATURES = "x11"
+CFLAGS_append = "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', ' -fPIC ', '', d)}"
+
EXTRA_OECONF = "--disable-cairo --enable-gtk-im --enable-applet"
PACKAGES += "${PN}-im ${PN}-applet"
--
2.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2015-09-11 12:49 [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold Carlos Alberto Lopez Perez
@ 2015-09-11 14:51 ` Phil Blundell
2015-09-11 16:46 ` Carlos Alberto Lopez Perez
2015-09-14 7:24 ` Khem Raj
0 siblings, 2 replies; 8+ messages in thread
From: Phil Blundell @ 2015-09-11 14:51 UTC (permalink / raw)
To: Carlos Alberto Lopez Perez; +Cc: openembedded-core
On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
> will fail to build with this error:
>
> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
This is only an issue for ARM (and only for Thumb2 at that). I don't
think it's necessarily appropriate to force -fPIC on all targets.
Also, before adding this sort of hack it would be worth verifying
whether this is in fact a toolchain bug and, if it is, fixing it there.
p.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2015-09-11 14:51 ` Phil Blundell
@ 2015-09-11 16:46 ` Carlos Alberto Lopez Perez
2015-09-14 7:24 ` Khem Raj
1 sibling, 0 replies; 8+ messages in thread
From: Carlos Alberto Lopez Perez @ 2015-09-11 16:46 UTC (permalink / raw)
To: Phil Blundell; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]
On 11/09/15 16:51, Phil Blundell wrote:
> On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
>> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
>> will fail to build with this error:
>>
>> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
>> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
>
> This is only an issue for ARM (and only for Thumb2 at that). I don't
> think it's necessarily appropriate to force -fPIC on all targets.
>
> Also, before adding this sort of hack it would be worth verifying
> whether this is in fact a toolchain bug and, if it is, fixing it there.
>
> p.
>
>
>
If you (or somebody else) want to investigate whether this is a bug on
the toolchain or not, I can give you more data:
* I forced GCC 4.9 (GCC 5.X was failing to build the kernel, and I don't
bothered with it).
$ grep GCCVERSION conf/local.conf
GCCVERSION = "4.9%"
* The target machine is a Freescale imx6qsabresd board, so I also used
the meta-freescale layer (master)
If you need more details, let me know.
I'm not bothering more with this, as the above patch is good enough for
me. Feel free to take it or not, or to contribute a better one if you wish.
Regards.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2015-09-11 14:51 ` Phil Blundell
2015-09-11 16:46 ` Carlos Alberto Lopez Perez
@ 2015-09-14 7:24 ` Khem Raj
2015-09-14 23:01 ` Carlos Alberto Lopez Perez
1 sibling, 1 reply; 8+ messages in thread
From: Khem Raj @ 2015-09-14 7:24 UTC (permalink / raw)
To: Phil Blundell; +Cc: openembedded-core
> On Sep 11, 2015, at 7:51 AM, Phil Blundell <pb@pbcl.net> wrote:
>
> On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
>> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
>> will fail to build with this error:
>>
>> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
>> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
>
> This is only an issue for ARM (and only for Thumb2 at that). I don't
> think it's necessarily appropriate to force -fPIC on all targets.
>
> Also, before adding this sort of hack it would be worth verifying
> whether this is in fact a toolchain bug and, if it is, fixing it there.
>
This may not be a toolchain bug if there is a MOVW_ABS relocation being emitted
into an object that is eventually linked into shared library. Using -fPIC seems to be right fix
I know bfd linker silently ignored these relocations and generated bad .so files but that was fixed
several years ago. So I think what needs to be looked at is why does same .o links ok with bfd linker
is it some linker trampoline code thats in question here which may be different between gold and ld
Carlos
Can you check the linker cmdline of failing link step and see if its generating a shared object there ?
if thats the case and I assume gcc is generating this relocation into both
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2015-09-14 7:24 ` Khem Raj
@ 2015-09-14 23:01 ` Carlos Alberto Lopez Perez
2016-01-14 18:27 ` Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Carlos Alberto Lopez Perez @ 2015-09-14 23:01 UTC (permalink / raw)
To: Khem Raj, Phil Blundell; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]
On 14/09/15 09:24, Khem Raj wrote:
>
>> On Sep 11, 2015, at 7:51 AM, Phil Blundell <pb@pbcl.net> wrote:
>>
>> On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
>>> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
>>> will fail to build with this error:
>>>
>>> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
>>> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
>>
>> This is only an issue for ARM (and only for Thumb2 at that). I don't
>> think it's necessarily appropriate to force -fPIC on all targets.
>>
>> Also, before adding this sort of hack it would be worth verifying
>> whether this is in fact a toolchain bug and, if it is, fixing it there.
>>
>
> This may not be a toolchain bug if there is a MOVW_ABS relocation being emitted
> into an object that is eventually linked into shared library. Using -fPIC seems to be right fix
> I know bfd linker silently ignored these relocations and generated bad .so files but that was fixed
> several years ago. So I think what needs to be looked at is why does same .o links ok with bfd linker
> is it some linker trampoline code thats in question here which may be different between gold and ld
>
> Carlos
>
> Can you check the linker cmdline of failing link step and see if its generating a shared object there ?
> if thats the case and I assume gcc is generating this relocation into both
>
It looks is generating an executable (matchbox-keyboard).
Full log: http://sprunge.us/VPIN
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2015-09-14 23:01 ` Carlos Alberto Lopez Perez
@ 2016-01-14 18:27 ` Khem Raj
2016-01-14 21:22 ` Phil Blundell
0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2016-01-14 18:27 UTC (permalink / raw)
To: Carlos Alberto Lopez Perez; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1853 bytes --]
Carlos
Can you try this fix
https://github.com/kraj/openembedded-core/commit/0e35ad5a35262cfb7a6249ce158f76d1399d6cb4
This should help with this issue.
> On Sep 14, 2015, at 4:01 PM, Carlos Alberto Lopez Perez <clopez@igalia.com> wrote:
>
> On 14/09/15 09:24, Khem Raj wrote:
>>
>>> On Sep 11, 2015, at 7:51 AM, Phil Blundell <pb@pbcl.net> wrote:
>>>
>>> On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
>>>> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
>>>> will fail to build with this error:
>>>>
>>>> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
>>>> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
>>>
>>> This is only an issue for ARM (and only for Thumb2 at that). I don't
>>> think it's necessarily appropriate to force -fPIC on all targets.
>>>
>>> Also, before adding this sort of hack it would be worth verifying
>>> whether this is in fact a toolchain bug and, if it is, fixing it there.
>>>
>>
>> This may not be a toolchain bug if there is a MOVW_ABS relocation being emitted
>> into an object that is eventually linked into shared library. Using -fPIC seems to be right fix
>> I know bfd linker silently ignored these relocations and generated bad .so files but that was fixed
>> several years ago. So I think what needs to be looked at is why does same .o links ok with bfd linker
>> is it some linker trampoline code thats in question here which may be different between gold and ld
>>
>> Carlos
>>
>> Can you check the linker cmdline of failing link step and see if its generating a shared object there ?
>> if thats the case and I assume gcc is generating this relocation into both
>>
>
> It looks is generating an executable (matchbox-keyboard).
>
> Full log: http://sprunge.us/VPIN
>
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2016-01-14 18:27 ` Khem Raj
@ 2016-01-14 21:22 ` Phil Blundell
2016-01-17 11:15 ` Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Phil Blundell @ 2016-01-14 21:22 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
How does that patch help with this issue? It seems to be adding ifunc
support which isn't obviously related to the problem at hand.
p.
On Thu, 2016-01-14 at 10:27 -0800, Khem Raj wrote:
> Carlos
>
> Can you try this fix
>
> https://github.com/kraj/openembedded-core/commit/0e35ad5a35262cfb7a6249ce158f76d1399d6cb4
>
>
> This should help with this issue.
>
>
> > On Sep 14, 2015, at 4:01 PM, Carlos Alberto Lopez Perez <clopez@igalia.com> wrote:
> >
> > On 14/09/15 09:24, Khem Raj wrote:
> >>
> >>> On Sep 11, 2015, at 7:51 AM, Phil Blundell <pb@pbcl.net> wrote:
> >>>
> >>> On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
> >>>> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
> >>>> will fail to build with this error:
> >>>>
> >>>> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
> >>>> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
> >>>
> >>> This is only an issue for ARM (and only for Thumb2 at that). I don't
> >>> think it's necessarily appropriate to force -fPIC on all targets.
> >>>
> >>> Also, before adding this sort of hack it would be worth verifying
> >>> whether this is in fact a toolchain bug and, if it is, fixing it there.
> >>>
> >>
> >> This may not be a toolchain bug if there is a MOVW_ABS relocation being emitted
> >> into an object that is eventually linked into shared library. Using -fPIC seems to be right fix
> >> I know bfd linker silently ignored these relocations and generated bad .so files but that was fixed
> >> several years ago. So I think what needs to be looked at is why does same .o links ok with bfd linker
> >> is it some linker trampoline code thats in question here which may be different between gold and ld
> >>
> >> Carlos
> >>
> >> Can you check the linker cmdline of failing link step and see if its generating a shared object there ?
> >> if thats the case and I assume gcc is generating this relocation into both
> >>
> >
> > It looks is generating an executable (matchbox-keyboard).
> >
> > Full log: http://sprunge.us/VPIN
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold
2016-01-14 21:22 ` Phil Blundell
@ 2016-01-17 11:15 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2016-01-17 11:15 UTC (permalink / raw)
To: Phil Blundell; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2445 bytes --]
> On Jan 14, 2016, at 1:22 PM, Phil Blundell <pb@pbcl.net> wrote:
>
> How does that patch help with this issue? It seems to be adding ifunc
> support which isn't obviously related to the problem at hand.
Its not obvious but its related because now that ifunc support is available
to gold, it marks ‘longjmp’ as STT_GNU_IFUNC and is able to add a runtime
RELATIVE relocation for this symbol.
>
> p.
>
> On Thu, 2016-01-14 at 10:27 -0800, Khem Raj wrote:
>> Carlos
>>
>> Can you try this fix
>>
>> https://github.com/kraj/openembedded-core/commit/0e35ad5a35262cfb7a6249ce158f76d1399d6cb4
>>
>>
>> This should help with this issue.
>>
>>
>>> On Sep 14, 2015, at 4:01 PM, Carlos Alberto Lopez Perez <clopez@igalia.com> wrote:
>>>
>>> On 14/09/15 09:24, Khem Raj wrote:
>>>>
>>>>> On Sep 11, 2015, at 7:51 AM, Phil Blundell <pb@pbcl.net> wrote:
>>>>>
>>>>> On Fri, 2015-09-11 at 14:49 +0200, Carlos Alberto Lopez Perez wrote:
>>>>>> * When ld-is-gold is enabled in DISTRO_FEATURES, matchbox-keyboard
>>>>>> will fail to build with this error:
>>>>>>
>>>>>> ld: error: matchbox-keyboard-image.o: requires unsupported dynamic
>>>>>> reloc R_ARM_MOVW_ABS_NC; recompile with -fPIC
>>>>>
>>>>> This is only an issue for ARM (and only for Thumb2 at that). I don't
>>>>> think it's necessarily appropriate to force -fPIC on all targets.
>>>>>
>>>>> Also, before adding this sort of hack it would be worth verifying
>>>>> whether this is in fact a toolchain bug and, if it is, fixing it there.
>>>>>
>>>>
>>>> This may not be a toolchain bug if there is a MOVW_ABS relocation being emitted
>>>> into an object that is eventually linked into shared library. Using -fPIC seems to be right fix
>>>> I know bfd linker silently ignored these relocations and generated bad .so files but that was fixed
>>>> several years ago. So I think what needs to be looked at is why does same .o links ok with bfd linker
>>>> is it some linker trampoline code thats in question here which may be different between gold and ld
>>>>
>>>> Carlos
>>>>
>>>> Can you check the linker cmdline of failing link step and see if its generating a shared object there ?
>>>> if thats the case and I assume gcc is generating this relocation into both
>>>>
>>>
>>> It looks is generating an executable (matchbox-keyboard).
>>>
>>> Full log: http://sprunge.us/VPIN
>>>
>>
>
>
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-01-17 11:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 12:49 [PATCH] matchbox-keyboard: Fix build failure with ld-is-gold Carlos Alberto Lopez Perez
2015-09-11 14:51 ` Phil Blundell
2015-09-11 16:46 ` Carlos Alberto Lopez Perez
2015-09-14 7:24 ` Khem Raj
2015-09-14 23:01 ` Carlos Alberto Lopez Perez
2016-01-14 18:27 ` Khem Raj
2016-01-14 21:22 ` Phil Blundell
2016-01-17 11:15 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox