[05/10] configure: Enable thumb automatically when building with msvc for armv7

Message ID 1437904678-19444-5-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö July 26, 2015, 9:57 a.m.
---
 configure | 1 +
 1 file changed, 1 insertion(+)

Comments

Luca Barbato July 26, 2015, 10:17 a.m. | #1
On 26/07/15 11:57, Martin Storsjö wrote:
> ---
>   configure | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index 446a786..77eb8f5 100755
> --- a/configure
> +++ b/configure
> @@ -4007,6 +4007,7 @@ elif enabled alpha; then
>
>   elif enabled arm; then
>
> +    enabled msvc && check_cpp_condition stddef.h "_M_ARM >= 7" && enable thumb
>       check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
>       enabled thumb && check_cflags -mthumb || check_cflags -marm
>
>

Ok.
Jean-Baptiste Kempf July 26, 2015, 10:59 a.m. | #2
On 26 Jul, Martin Storsjö wrote :
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 446a786..77eb8f5 100755
> --- a/configure
> +++ b/configure
> @@ -4007,6 +4007,7 @@ elif enabled alpha; then
>  
>  elif enabled arm; then
>  
> +    enabled msvc && check_cpp_condition stddef.h "_M_ARM >= 7" && enable thumb
>      check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
>      enabled thumb && check_cflags -mthumb || check_cflags -marm

Doesn't that break Windows CE?

If you ever cared about that...

With my kindest regards,
Martin Storsjö July 26, 2015, 11:11 a.m. | #3
On Sun, 26 Jul 2015, Jean-Baptiste Kempf wrote:

> On 26 Jul, Martin Storsjö wrote :
>> ---
>>  configure | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/configure b/configure
>> index 446a786..77eb8f5 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4007,6 +4007,7 @@ elif enabled alpha; then
>>
>>  elif enabled arm; then
>>
>> +    enabled msvc && check_cpp_condition stddef.h "_M_ARM >= 7" && enable thumb
>>      check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
>>      enabled thumb && check_cflags -mthumb || check_cflags -marm
>
> Doesn't that break Windows CE?

Ooh, we have a reviewer that actually pays attention!

_M_ARM indicates the arm instruction set version targeted, so we only do 
this for armv7 or newer. The old VC compilers for Windows CE target armv4, 
so they have _M_ARM == 4.

We could also check _M_ARMT which indicates whether we're building for 
thumb. That'd probably be even more correct here I guess.

> If you ever cared about that...

In theory at least - we still have a mingw32ce fate instance, but I 
haven't tried running such code on an actual device for many years.

The latest MSVC version (at least the normal, public ones I've seen) that 
had ARM compilers for CE was 2008, and that one defaulted to armv4, until 
they went absent and returned with windows phone 8, for armv7.

// Martin
Jean-Baptiste Kempf July 26, 2015, 1:05 p.m. | #4
On 26 Jul, Martin Storsjö wrote :
> >Doesn't that break Windows CE?
> 
> Ooh, we have a reviewer that actually pays attention!

<3 :)

> _M_ARM indicates the arm instruction set version targeted, so we only do
> this for armv7 or newer. The old VC compilers for Windows CE target armv4,
> so they have _M_ARM == 4.
> 
> We could also check _M_ARMT which indicates whether we're building for
> thumb. That'd probably be even more correct here I guess.

I just remembered that CorePlayer was using NEON in WM6 and someone
using Thumb+Neon in WP7.

> The latest MSVC version (at least the normal, public ones I've seen) that
> had ARM compilers for CE was 2008, and that one defaulted to armv4, until
> they went absent and returned with windows phone 8, for armv7.

OK. I guess you can drop it :)
We can also get Martell to add it on clang/arm/mingw.

With my kindest regards,
Steve Lhomme July 26, 2015, 3:03 p.m. | #5
On Sun, Jul 26, 2015 at 3:05 PM, Jean-Baptiste Kempf <jb@videolan.org> wrote:
> On 26 Jul, Martin Storsjö wrote :
>> >Doesn't that break Windows CE?
>>
>> Ooh, we have a reviewer that actually pays attention!
>
> <3 :)
>
>> _M_ARM indicates the arm instruction set version targeted, so we only do
>> this for armv7 or newer. The old VC compilers for Windows CE target armv4,
>> so they have _M_ARM == 4.
>>
>> We could also check _M_ARMT which indicates whether we're building for
>> thumb. That'd probably be even more correct here I guess.
>
> I just remembered that CorePlayer was using NEON in WM6

Yes, it worked at long as you were talking care of the context changes
yourself or no other app was using NEON on the system while you use
it.
#YOLO

> and someone
> using Thumb+Neon in WP7.
>
>> The latest MSVC version (at least the normal, public ones I've seen) that
>> had ARM compilers for CE was 2008, and that one defaulted to armv4, until
>> they went absent and returned with windows phone 8, for armv7.
>
> OK. I guess you can drop it :)
> We can also get Martell to add it on clang/arm/mingw.
>
> With my kindest regards,
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
Martin Storsjö July 26, 2015, 5:01 p.m. | #6
On Sun, 26 Jul 2015, Martin Storsjö wrote:

> On Sun, 26 Jul 2015, Jean-Baptiste Kempf wrote:
>
>> On 26 Jul, Martin Storsjö wrote :
>>> ---
>>>  configure | 1 +
>>>  1 file changed, 1 insertion(+)
>>> 
>>> diff --git a/configure b/configure
>>> index 446a786..77eb8f5 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -4007,6 +4007,7 @@ elif enabled alpha; then
>>>
>>>  elif enabled arm; then
>>> 
>>> +    enabled msvc && check_cpp_condition stddef.h "_M_ARM >= 7" && enable 
>>> thumb
>>>      check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
>>>      enabled thumb && check_cflags -mthumb || check_cflags -marm
>> 
>> Doesn't that break Windows CE?
>
> Ooh, we have a reviewer that actually pays attention!
>
> _M_ARM indicates the arm instruction set version targeted, so we only do this 
> for armv7 or newer. The old VC compilers for Windows CE target armv4, so they 
> have _M_ARM == 4.
>
> We could also check _M_ARMT which indicates whether we're building for thumb. 
> That'd probably be even more correct here I guess.
>
>> If you ever cared about that...
>
> In theory at least - we still have a mingw32ce fate instance, but I haven't 
> tried running such code on an actual device for many years.
>
> The latest MSVC version (at least the normal, public ones I've seen) that had 
> ARM compilers for CE was 2008, and that one defaulted to armv4, until they 
> went absent and returned with windows phone 8, for armv7.

Also, just for reference, libav doesn't build with the official CE (or 
windows mobile) SDKs - it's missing way too much stuff, that mingw32ce 
fills in. (And even then, the mingw32ce headers need to be patched for 
libav to be buildable.)

// Martin

Patch

diff --git a/configure b/configure
index 446a786..77eb8f5 100755
--- a/configure
+++ b/configure
@@ -4007,6 +4007,7 @@  elif enabled alpha; then
 
 elif enabled arm; then
 
+    enabled msvc && check_cpp_condition stddef.h "_M_ARM >= 7" && enable thumb
     check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
     enabled thumb && check_cflags -mthumb || check_cflags -marm