* [PATCH] ARM: Fix clone build for ARMv4
@ 2014-01-23 11:49 Will Newton
2014-01-23 16:32 ` Joseph S. Myers
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Will Newton @ 2014-01-23 11:49 UTC (permalink / raw)
To: libc-ports; +Cc: patches, Will Newton
ARMv4 does not have the blx instruction, so use the BLX macro which
handles abstracting this for us.
ports/ChangeLog.arm:
2014-01-23 Will Newton <will.newton@linaro.org>
[BZ #16499]
* sysdeps/unix/sysv/linux/arm/clone.S: Use BLX macro instead
of blx instruction directly.
---
ports/sysdeps/unix/sysv/linux/arm/clone.S | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
index 44286a5..03fe9ab 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -88,14 +88,8 @@ PSEUDO_END (__clone)
#endif
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
-#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
ldr ip, [sp], #8
- mov lr, pc
- bx ip
-#else
- ldr lr, [sp], #8
- blx lr
-#endif
+ BLX (ip)
@ and we are done, passing the return value through r0
b PLTJMP(HIDDEN_JUMPTARGET(_exit))
--
1.8.1.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: Fix clone build for ARMv4
2014-01-23 11:49 [PATCH] ARM: Fix clone build for ARMv4 Will Newton
@ 2014-01-23 16:32 ` Joseph S. Myers
2014-01-23 17:31 ` Carlos O'Donell
2014-01-25 10:10 ` Mike Frysinger
2 siblings, 0 replies; 6+ messages in thread
From: Joseph S. Myers @ 2014-01-23 16:32 UTC (permalink / raw)
To: Will Newton; +Cc: libc-ports, patches
On Thu, 23 Jan 2014, Will Newton wrote:
> ARMv4 does not have the blx instruction, so use the BLX macro which
> handles abstracting this for us.
>
> ports/ChangeLog.arm:
>
> 2014-01-23 Will Newton <will.newton@linaro.org>
>
> [BZ #16499]
> * sysdeps/unix/sysv/linux/arm/clone.S: Use BLX macro instead
> of blx instruction directly.
OK, presuming you've run the testsuite for at least one ARM configuration.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: Fix clone build for ARMv4
2014-01-23 11:49 [PATCH] ARM: Fix clone build for ARMv4 Will Newton
2014-01-23 16:32 ` Joseph S. Myers
@ 2014-01-23 17:31 ` Carlos O'Donell
2014-01-23 18:22 ` Will Newton
2014-01-25 10:10 ` Mike Frysinger
2 siblings, 1 reply; 6+ messages in thread
From: Carlos O'Donell @ 2014-01-23 17:31 UTC (permalink / raw)
To: Will Newton, libc-ports; +Cc: patches
On 01/23/2014 06:49 AM, Will Newton wrote:
> ARMv4 does not have the blx instruction, so use the BLX macro which
> handles abstracting this for us.
>
> ports/ChangeLog.arm:
>
> 2014-01-23 Will Newton <will.newton@linaro.org>
>
> [BZ #16499]
> * sysdeps/unix/sysv/linux/arm/clone.S: Use BLX macro instead
> of blx instruction directly.
> ---
> ports/sysdeps/unix/sysv/linux/arm/clone.S | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
> index 44286a5..03fe9ab 100644
> --- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
> +++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
> @@ -88,14 +88,8 @@ PSEUDO_END (__clone)
> #endif
> @ pick the function arg and call address off the stack and execute
> ldr r0, [sp, #4]
> -#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
> ldr ip, [sp], #8
> - mov lr, pc
> - bx ip
> -#else
> - ldr lr, [sp], #8
> - blx lr
> -#endif
> + BLX (ip)
Looks good.
>
> @ and we are done, passing the return value through r0
> b PLTJMP(HIDDEN_JUMPTARGET(_exit))
>
Did you test this or ask the submitter to test it?
If he says it works then OK to commit.
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: Fix clone build for ARMv4
2014-01-23 17:31 ` Carlos O'Donell
@ 2014-01-23 18:22 ` Will Newton
2014-01-24 13:17 ` Will Newton
0 siblings, 1 reply; 6+ messages in thread
From: Will Newton @ 2014-01-23 18:22 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: libc-ports, Patch Tracking, Mike Frysinger
On 23 January 2014 17:30, Carlos O'Donell <carlos@redhat.com> wrote:
> On 01/23/2014 06:49 AM, Will Newton wrote:
>> ARMv4 does not have the blx instruction, so use the BLX macro which
>> handles abstracting this for us.
>>
>> ports/ChangeLog.arm:
>>
>> 2014-01-23 Will Newton <will.newton@linaro.org>
>>
>> [BZ #16499]
>> * sysdeps/unix/sysv/linux/arm/clone.S: Use BLX macro instead
>> of blx instruction directly.
>> ---
>> ports/sysdeps/unix/sysv/linux/arm/clone.S | 8 +-------
>> 1 file changed, 1 insertion(+), 7 deletions(-)
>>
>> diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
>> index 44286a5..03fe9ab 100644
>> --- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
>> +++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
>> @@ -88,14 +88,8 @@ PSEUDO_END (__clone)
>> #endif
>> @ pick the function arg and call address off the stack and execute
>> ldr r0, [sp, #4]
>> -#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
>> ldr ip, [sp], #8
>> - mov lr, pc
>> - bx ip
>> -#else
>> - ldr lr, [sp], #8
>> - blx lr
>> -#endif
>> + BLX (ip)
>
> Looks good.
>
>>
>> @ and we are done, passing the return value through r0
>> b PLTJMP(HIDDEN_JUMPTARGET(_exit))
>>
>
> Did you test this or ask the submitter to test it?
>
> If he says it works then OK to commit.
I have tested this on armv7, I don't have an armv4 capable toolchain
at the moment to test it for that arch.
I've added Mike to CC so he can take a look.
Thanks,
--
Will Newton
Toolchain Working Group, Linaro
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: Fix clone build for ARMv4
2014-01-23 18:22 ` Will Newton
@ 2014-01-24 13:17 ` Will Newton
0 siblings, 0 replies; 6+ messages in thread
From: Will Newton @ 2014-01-24 13:17 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: libc-ports, Patch Tracking, Mike Frysinger
On 23 January 2014 18:22, Will Newton <will.newton@linaro.org> wrote:
> On 23 January 2014 17:30, Carlos O'Donell <carlos@redhat.com> wrote:
>> On 01/23/2014 06:49 AM, Will Newton wrote:
>>> ARMv4 does not have the blx instruction, so use the BLX macro which
>>> handles abstracting this for us.
>>>
>>> ports/ChangeLog.arm:
>>>
>>> 2014-01-23 Will Newton <will.newton@linaro.org>
>>>
>>> [BZ #16499]
>>> * sysdeps/unix/sysv/linux/arm/clone.S: Use BLX macro instead
>>> of blx instruction directly.
>>> ---
>>> ports/sysdeps/unix/sysv/linux/arm/clone.S | 8 +-------
>>> 1 file changed, 1 insertion(+), 7 deletions(-)
>>>
>>> diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
>>> index 44286a5..03fe9ab 100644
>>> --- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
>>> +++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
>>> @@ -88,14 +88,8 @@ PSEUDO_END (__clone)
>>> #endif
>>> @ pick the function arg and call address off the stack and execute
>>> ldr r0, [sp, #4]
>>> -#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
>>> ldr ip, [sp], #8
>>> - mov lr, pc
>>> - bx ip
>>> -#else
>>> - ldr lr, [sp], #8
>>> - blx lr
>>> -#endif
>>> + BLX (ip)
>>
>> Looks good.
>>
>>>
>>> @ and we are done, passing the return value through r0
>>> b PLTJMP(HIDDEN_JUMPTARGET(_exit))
>>>
>>
>> Did you test this or ask the submitter to test it?
>>
>> If he says it works then OK to commit.
>
> I have tested this on armv7, I don't have an armv4 capable toolchain
> at the moment to test it for that arch.
I figured out the correct value of CFLAGS to get a build for armv4
(and armv4t) and the patch fixes the issue, so I have committed it.
--
Will Newton
Toolchain Working Group, Linaro
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: Fix clone build for ARMv4
2014-01-23 11:49 [PATCH] ARM: Fix clone build for ARMv4 Will Newton
2014-01-23 16:32 ` Joseph S. Myers
2014-01-23 17:31 ` Carlos O'Donell
@ 2014-01-25 10:10 ` Mike Frysinger
2 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2014-01-25 10:10 UTC (permalink / raw)
To: libc-ports; +Cc: Will Newton, patches
[-- Attachment #1: Type: text/plain, Size: 240 bytes --]
On Thursday, January 23, 2014 11:49:31 Will Newton wrote:
> ARMv4 does not have the blx instruction, so use the BLX macro which
> handles abstracting this for us.
this fixed building for me. at some point i'll try to run it ;).
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-01-25 10:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 11:49 [PATCH] ARM: Fix clone build for ARMv4 Will Newton
2014-01-23 16:32 ` Joseph S. Myers
2014-01-23 17:31 ` Carlos O'Donell
2014-01-23 18:22 ` Will Newton
2014-01-24 13:17 ` Will Newton
2014-01-25 10:10 ` Mike Frysinger
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 read-only IMAP folder(s) and NNTP newsgroup(s).