* [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection
@ 2025-06-14 1:03 Kacper Michajłow
2025-06-14 1:05 ` Kacper Michajlow
0 siblings, 1 reply; 17+ messages in thread
From: Kacper Michajłow @ 2025-06-14 1:03 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
LLVM tools print installation path upon execution. If one uses LLVM
tools bundled with Microsoft Visual Studio installation, they would be
incorrectly detected as Microsoft's ones.
Microsoft tools can have localized names, so a more specific string
check is not feasible, but luckily we can test if "Microsoft" is at the
beginning of the line, as it is always the case.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
configure | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 534b443f7d..5b2a04ae6a 100755
--- a/configure
+++ b/configure
@@ -5124,9 +5124,9 @@ probe_cc(){
_flags_filter=msvc_flags
_ld_lib='lib%.a'
_ld_path='-libpath:'
- elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
+ elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
_type=msvc
- if $_cc -nologo- 2>&1 | grep -q Microsoft; then
+ if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
_ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
else
_ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
@@ -5236,7 +5236,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
DEPCCFLAGS=$_flags
fi
-if $ar 2>&1 | grep -q Microsoft; then
+if $ar 2>&1 | grep -q ^Microsoft; then
arflags="-nologo"
ar_o='-out:$@'
elif $ar 2>&1 | grep -q "\[D\] "; then
--
2.45.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection
2025-06-14 1:03 [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection Kacper Michajłow
@ 2025-06-14 1:05 ` Kacper Michajlow
2025-06-16 7:40 ` Martin Storsjö
0 siblings, 1 reply; 17+ messages in thread
From: Kacper Michajlow @ 2025-06-14 1:05 UTC (permalink / raw)
To: ffmpeg-devel
On Sat, 14 Jun 2025 at 03:03, Kacper Michajłow <kasper93@gmail.com> wrote:
>
> LLVM tools print installation path upon execution. If one uses LLVM
> tools bundled with Microsoft Visual Studio installation, they would be
> incorrectly detected as Microsoft's ones.
>
> Microsoft tools can have localized names, so a more specific string
> check is not feasible, but luckily we can test if "Microsoft" is at the
> beginning of the line, as it is always the case.
>
> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
> ---
> configure | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 534b443f7d..5b2a04ae6a 100755
> --- a/configure
> +++ b/configure
> @@ -5124,9 +5124,9 @@ probe_cc(){
> _flags_filter=msvc_flags
> _ld_lib='lib%.a'
> _ld_path='-libpath:'
> - elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
> + elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
> _type=msvc
> - if $_cc -nologo- 2>&1 | grep -q Microsoft; then
> + if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
> _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
> else
> _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
> @@ -5236,7 +5236,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
> DEPCCFLAGS=$_flags
> fi
>
> -if $ar 2>&1 | grep -q Microsoft; then
> +if $ar 2>&1 | grep -q ^Microsoft; then
> arflags="-nologo"
> ar_o='-out:$@'
> elif $ar 2>&1 | grep -q "\[D\] "; then
> --
> 2.45.1
>
Should be v2 to the previous patch, but forgot to tag it as such.
- Kacper
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection
2025-06-14 1:05 ` Kacper Michajlow
@ 2025-06-16 7:40 ` Martin Storsjö
2025-06-16 13:24 ` Kacper Michajlow
0 siblings, 1 reply; 17+ messages in thread
From: Martin Storsjö @ 2025-06-16 7:40 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sat, 14 Jun 2025, Kacper Michajlow wrote:
> On Sat, 14 Jun 2025 at 03:03, Kacper Michajłow <kasper93@gmail.com> wrote:
>>
>> LLVM tools print installation path upon execution. If one uses LLVM
>> tools bundled with Microsoft Visual Studio installation, they would be
>> incorrectly detected as Microsoft's ones.
>>
>> Microsoft tools can have localized names, so a more specific string
>> check is not feasible, but luckily we can test if "Microsoft" is at the
>> beginning of the line, as it is always the case.
>>
>> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
>> ---
>> configure | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 534b443f7d..5b2a04ae6a 100755
>> --- a/configure
>> +++ b/configure
>> @@ -5124,9 +5124,9 @@ probe_cc(){
>> _flags_filter=msvc_flags
>> _ld_lib='lib%.a'
>> _ld_path='-libpath:'
>> - elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
>> + elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
>> _type=msvc
>> - if $_cc -nologo- 2>&1 | grep -q Microsoft; then
>> + if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
>> _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
>> else
>> _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
>> @@ -5236,7 +5236,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
>> DEPCCFLAGS=$_flags
>> fi
>>
>> -if $ar 2>&1 | grep -q Microsoft; then
>> +if $ar 2>&1 | grep -q ^Microsoft; then
>> arflags="-nologo"
>> ar_o='-out:$@'
>> elif $ar 2>&1 | grep -q "\[D\] "; then
>> --
>> 2.45.1
>>
>
> Should be v2 to the previous patch, but forgot to tag it as such.
Hmm, not sure where that previous patch was - I don't see it recently at
least.
Anyway, this patch looks ok to me, thanks!
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection
2025-06-16 7:40 ` Martin Storsjö
@ 2025-06-16 13:24 ` Kacper Michajlow
2025-06-17 9:16 ` Martin Storsjö
0 siblings, 1 reply; 17+ messages in thread
From: Kacper Michajlow @ 2025-06-16 13:24 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Mon, 16 Jun 2025 at 09:40, Martin Storsjö <martin@martin.st> wrote:
>
> On Sat, 14 Jun 2025, Kacper Michajlow wrote:
>
> > On Sat, 14 Jun 2025 at 03:03, Kacper Michajłow <kasper93@gmail.com> wrote:
> >>
> >> LLVM tools print installation path upon execution. If one uses LLVM
> >> tools bundled with Microsoft Visual Studio installation, they would be
> >> incorrectly detected as Microsoft's ones.
> >>
> >> Microsoft tools can have localized names, so a more specific string
> >> check is not feasible, but luckily we can test if "Microsoft" is at the
> >> beginning of the line, as it is always the case.
> >>
> >> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
> >> ---
> >> configure | 6 +++---
> >> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/configure b/configure
> >> index 534b443f7d..5b2a04ae6a 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -5124,9 +5124,9 @@ probe_cc(){
> >> _flags_filter=msvc_flags
> >> _ld_lib='lib%.a'
> >> _ld_path='-libpath:'
> >> - elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
> >> + elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
> >> _type=msvc
> >> - if $_cc -nologo- 2>&1 | grep -q Microsoft; then
> >> + if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
> >> _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
> >> else
> >> _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
> >> @@ -5236,7 +5236,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
> >> DEPCCFLAGS=$_flags
> >> fi
> >>
> >> -if $ar 2>&1 | grep -q Microsoft; then
> >> +if $ar 2>&1 | grep -q ^Microsoft; then
> >> arflags="-nologo"
> >> ar_o='-out:$@'
> >> elif $ar 2>&1 | grep -q "\[D\] "; then
> >> --
> >> 2.45.1
> >>
> >
> > Should be v2 to the previous patch, but forgot to tag it as such.
>
> Hmm, not sure where that previous patch was - I don't see it recently at
> least.
Yep, it was a very old one. See
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220122201321.8368-1-kasper93@gmail.com/
The conclusion was that we cannot do it like that, because names are
localized. Hence now the new patch, which should work nicely for all
cases, even if a little bit of basic change.
- Kacper
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection
2025-06-16 13:24 ` Kacper Michajlow
@ 2025-06-17 9:16 ` Martin Storsjö
0 siblings, 0 replies; 17+ messages in thread
From: Martin Storsjö @ 2025-06-17 9:16 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Mon, 16 Jun 2025, Kacper Michajlow wrote:
> On Mon, 16 Jun 2025 at 09:40, Martin Storsjö <martin@martin.st> wrote:
>>
>> On Sat, 14 Jun 2025, Kacper Michajlow wrote:
>>
>> > On Sat, 14 Jun 2025 at 03:03, Kacper Michajłow <kasper93@gmail.com> wrote:
>> >>
>> >> LLVM tools print installation path upon execution. If one uses LLVM
>> >> tools bundled with Microsoft Visual Studio installation, they would be
>> >> incorrectly detected as Microsoft's ones.
>> >>
>> >> Microsoft tools can have localized names, so a more specific string
>> >> check is not feasible, but luckily we can test if "Microsoft" is at the
>> >> beginning of the line, as it is always the case.
>> >>
>> >> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
>> >> ---
>> >> configure | 6 +++---
>> >> 1 file changed, 3 insertions(+), 3 deletions(-)
>> >>
>> >> diff --git a/configure b/configure
>> >> index 534b443f7d..5b2a04ae6a 100755
>> >> --- a/configure
>> >> +++ b/configure
>> >> @@ -5124,9 +5124,9 @@ probe_cc(){
>> >> _flags_filter=msvc_flags
>> >> _ld_lib='lib%.a'
>> >> _ld_path='-libpath:'
>> >> - elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
>> >> + elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
>> >> _type=msvc
>> >> - if $_cc -nologo- 2>&1 | grep -q Microsoft; then
>> >> + if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
>> >> _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
>> >> else
>> >> _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
>> >> @@ -5236,7 +5236,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
>> >> DEPCCFLAGS=$_flags
>> >> fi
>> >>
>> >> -if $ar 2>&1 | grep -q Microsoft; then
>> >> +if $ar 2>&1 | grep -q ^Microsoft; then
>> >> arflags="-nologo"
>> >> ar_o='-out:$@'
>> >> elif $ar 2>&1 | grep -q "\[D\] "; then
>> >> --
>> >> 2.45.1
>> >>
>> >
>> > Should be v2 to the previous patch, but forgot to tag it as such.
>>
>> Hmm, not sure where that previous patch was - I don't see it recently at
>> least.
>
> Yep, it was a very old one. See
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220122201321.8368-1-kasper93@gmail.com/
> The conclusion was that we cannot do it like that, because names are
> localized. Hence now the new patch, which should work nicely for all
> cases, even if a little bit of basic change.
Oh, I see! Thanks for the context.
Yeah, this one looks good in that aspect; tested it a little, and pushed
now.
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 12:26 ` Marvin Scholz
2022-02-03 12:33 ` Martin Storsjö
@ 2022-02-07 21:00 ` Martin Storsjö
1 sibling, 0 replies; 17+ messages in thread
From: Martin Storsjö @ 2022-02-07 21:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, 3 Feb 2022, Marvin Scholz wrote:
>
>
> On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
>
>> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
>> wrote:
>>>
>>> On Thu, 3 Feb 2022, Kacper Michajlow wrote:
>>>
>>>> On Wed, 26 Jan 2022 at 15:00, Martin Storsjö <martin@martin.st>
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> On Sat, 22 Jan 2022, Kacper Michajłow wrote:
>>>>>
>>>>>> LLVM tools print installation path upon execution. If one uses
>>>>>> LLVM
>>>>>> tools bundled with Microsoft Visual Studio installation, they
>>>>>> would be
>>>>>> incorrectly detected as Microsoft's ones.
>>>>>>
>>>>>> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
>>>>>> ---
>>>>>> configure | 6 +++---
>>>>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>>>
>>>>> While the patch description seems to make sense, I wanted to try it
>>>>> out to
>>>>> see the practical effect for myself, and I fail to observe any
>>>>> difference.
>>>>>
>>>>> Can you provide your exact configure command line you use, where it
>>>>> makes
>>>>> a difference? I tried with "--cc=clang-cl --ld=lld-link
>>>>> --toolchain=msvc"
>>>>> and that works just as fine before this patch.
>>>>>
>>>>> In particular, the commands that you adjust run "$_cc -nologo-" and
>>>>> grep
>>>>> for "Microsoft" in the output of that. When I run that with
>>>>> clang-cl, it
>>>>> doesn't print a string containing "Microsoft".
>>>>>
>>>>> // Martin
>>>>
>>>> Hi,
>>>>
>>>> Yes you are right. In case of CC it doesn't change anything.
>>>> clang-cl
>>>> prints installation dir only with `-v`. The main thing this patch
>>>> fixes is `--ar=llvm-ar` where it is mistaken for lib.exe and used
>>>> with
>>>> wrong parameters. While fixing this I figured to make CC check also
>>>> more strict, because at some point it could be a problem. Sync all
>>>> of
>>>> them to have same style as one that was already there
>>>
>>> Oh, ok, with the reference to llvm-ar, I see what it fixes. Thanks!
>>> The
>>> reference to llvm-ar absolutely needs to be in the patch description
>>> then.
>>>
>>> I remember that there has been some variance throughout the versions
>>> for
>>> exactly what MSVC prints as the identification thoughout the
>>> versions, but
>>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>>
>>
>> I was wondering if non-english locale would translate that string, but
>> I can't easily test that, I don't think.
>>
>
> Sorry, need to correct myself. It is indeed localized I was just lacking
> the language pack…
>
> For example in german it is:
>
> Microsoft (R) C/C++-Optimierungscompiler Version 19.30.30709 für x64
> Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
So, should we scale back on this patch to only extend the regex for
lib.exe (to 'Microsoft.*Library.*Manager') but leave the one for cl.exe as
it is? Marvin verified that lib.exe doesn't seem to print a localized
message, only cl.exe seems to do that. Otherwise there's a risk we'd break
the currently working detection of cl.exe for users of localized MSVC.
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 12:47 ` Martin Storsjö
@ 2022-02-03 16:02 ` Marvin Scholz
0 siblings, 0 replies; 17+ messages in thread
From: Marvin Scholz @ 2022-02-03 16:02 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 3 Feb 2022, at 13:47, Martin Storsjö wrote:
> On Thu, 3 Feb 2022, Marvin Scholz wrote:
>
>> On 3 Feb 2022, at 13:33, Martin Storsjö wrote:
>>
>>> On Thu, 3 Feb 2022, Marvin Scholz wrote:
>>>
>>>>
>>>>
>>>> On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
>>>>
>>>>> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
>>>>> wrote:
>>>>>>
>>>>>> I remember that there has been some variance throughout the
>>>>>> versions for
>>>>>> exactly what MSVC prints as the identification thoughout the
>>>>>> versions, but
>>>>>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>>>>>
>>>>>
>>>>> I was wondering if non-english locale would translate that string,
>>>>> but
>>>>> I can't easily test that, I don't think.
>>>>>
>>>>
>>>> Sorry, need to correct myself. It is indeed localized I was just
>>>> lacking
>>>> the language pack…
>>>>
>>>> For example in german it is:
>>>>
>>>> Microsoft (R) C/C++-Optimierungscompiler Version 19.30.30709 für
>>>> x64
>>>> Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
>>>
>>> Oh, thanks for that!
>>>
>>> I presume that this also could break the other existing check for
>>> armasm too? If you run e.g. "vsdevcmd -host_arch=x64 -arch=arm64"
>>> and then "armasm64", what does that print?
>>>
>>
>> Interestingly that one does not seem localized:
>>
>> C:\Program Files\Microsoft Visual Studio\2022\Community>armasm64
>> Microsoft (R) ARM Macro Assembler Version 14.30.30709.0 for 64 bits
>> Copyright (C) Microsoft Corporation. All rights reserved.
>
> That's interesting!
>
> I tried to have a look at what e.g. meson does for detection. It
> doesn't look that much at the output, but first detects clang-cl
> specifically, then plain clang, then moves on to MSVC itself (matching
> only 'Microsoft'). Meson does, however, check a longer regex for
> identifying and disambiguating the 'rc' tool from windres. Is 'rc'
> localized?
>
That one is not localized either for me. At least for the /? option.
> // Martin
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 12:43 ` Marvin Scholz
@ 2022-02-03 12:47 ` Martin Storsjö
2022-02-03 16:02 ` Marvin Scholz
0 siblings, 1 reply; 17+ messages in thread
From: Martin Storsjö @ 2022-02-03 12:47 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, 3 Feb 2022, Marvin Scholz wrote:
> On 3 Feb 2022, at 13:33, Martin Storsjö wrote:
>
>> On Thu, 3 Feb 2022, Marvin Scholz wrote:
>>
>>>
>>>
>>> On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
>>>
>>>> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
>>>> wrote:
>>>>>
>>>>> I remember that there has been some variance throughout the
>>>>> versions for
>>>>> exactly what MSVC prints as the identification thoughout the
>>>>> versions, but
>>>>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>>>>
>>>>
>>>> I was wondering if non-english locale would translate that string,
>>>> but
>>>> I can't easily test that, I don't think.
>>>>
>>>
>>> Sorry, need to correct myself. It is indeed localized I was just
>>> lacking
>>> the language pack…
>>>
>>> For example in german it is:
>>>
>>> Microsoft (R) C/C++-Optimierungscompiler Version 19.30.30709 für x64
>>> Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
>>
>> Oh, thanks for that!
>>
>> I presume that this also could break the other existing check for
>> armasm too? If you run e.g. "vsdevcmd -host_arch=x64 -arch=arm64" and
>> then "armasm64", what does that print?
>>
>
> Interestingly that one does not seem localized:
>
> C:\Program Files\Microsoft Visual Studio\2022\Community>armasm64
> Microsoft (R) ARM Macro Assembler Version 14.30.30709.0 for 64 bits
> Copyright (C) Microsoft Corporation. All rights reserved.
That's interesting!
I tried to have a look at what e.g. meson does for detection. It doesn't
look that much at the output, but first detects clang-cl specifically,
then plain clang, then moves on to MSVC itself (matching only
'Microsoft'). Meson does, however, check a longer regex for identifying
and disambiguating the 'rc' tool from windres. Is 'rc' localized?
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 12:33 ` Martin Storsjö
@ 2022-02-03 12:43 ` Marvin Scholz
2022-02-03 12:47 ` Martin Storsjö
0 siblings, 1 reply; 17+ messages in thread
From: Marvin Scholz @ 2022-02-03 12:43 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 3 Feb 2022, at 13:33, Martin Storsjö wrote:
> On Thu, 3 Feb 2022, Marvin Scholz wrote:
>
>>
>>
>> On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
>>
>>> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
>>> wrote:
>>>>
>>>> I remember that there has been some variance throughout the
>>>> versions for
>>>> exactly what MSVC prints as the identification thoughout the
>>>> versions, but
>>>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>>>
>>>
>>> I was wondering if non-english locale would translate that string,
>>> but
>>> I can't easily test that, I don't think.
>>>
>>
>> Sorry, need to correct myself. It is indeed localized I was just
>> lacking
>> the language pack…
>>
>> For example in german it is:
>>
>> Microsoft (R) C/C++-Optimierungscompiler Version 19.30.30709 für x64
>> Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
>
> Oh, thanks for that!
>
> I presume that this also could break the other existing check for
> armasm too? If you run e.g. "vsdevcmd -host_arch=x64 -arch=arm64" and
> then "armasm64", what does that print?
>
Interestingly that one does not seem localized:
C:\Program Files\Microsoft Visual Studio\2022\Community>vsdevcmd
-host_arch=x64 -arch=arm64
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.0.5
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
C:\Program Files\Microsoft Visual Studio\2022\Community>armasm64
Microsoft (R) ARM Macro Assembler Version 14.30.30709.0 for 64 bits
Copyright (C) Microsoft Corporation. All rights reserved.
error A2033: missing input source file
Usage: armasm [<options>] sourcefile objectfile
armasm [<options>] -o objectfile sourcefile
armasm -h for help
> // Martin
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 12:26 ` Marvin Scholz
@ 2022-02-03 12:33 ` Martin Storsjö
2022-02-03 12:43 ` Marvin Scholz
2022-02-07 21:00 ` Martin Storsjö
1 sibling, 1 reply; 17+ messages in thread
From: Martin Storsjö @ 2022-02-03 12:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, 3 Feb 2022, Marvin Scholz wrote:
>
>
> On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
>
>> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
>> wrote:
>>>
>>> I remember that there has been some variance throughout the versions
>>> for
>>> exactly what MSVC prints as the identification thoughout the
>>> versions, but
>>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>>
>>
>> I was wondering if non-english locale would translate that string, but
>> I can't easily test that, I don't think.
>>
>
> Sorry, need to correct myself. It is indeed localized I was just lacking
> the language pack…
>
> For example in german it is:
>
> Microsoft (R) C/C++-Optimierungscompiler Version 19.30.30709 für x64
> Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
Oh, thanks for that!
I presume that this also could break the other existing check for armasm
too? If you run e.g. "vsdevcmd -host_arch=x64 -arch=arm64" and then
"armasm64", what does that print?
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 11:55 ` Hendrik Leppkes
2022-02-03 12:08 ` Marvin Scholz
@ 2022-02-03 12:26 ` Marvin Scholz
2022-02-03 12:33 ` Martin Storsjö
2022-02-07 21:00 ` Martin Storsjö
1 sibling, 2 replies; 17+ messages in thread
From: Marvin Scholz @ 2022-02-03 12:26 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
> wrote:
>>
>> On Thu, 3 Feb 2022, Kacper Michajlow wrote:
>>
>>> On Wed, 26 Jan 2022 at 15:00, Martin Storsjö <martin@martin.st>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> On Sat, 22 Jan 2022, Kacper Michajłow wrote:
>>>>
>>>>> LLVM tools print installation path upon execution. If one uses
>>>>> LLVM
>>>>> tools bundled with Microsoft Visual Studio installation, they
>>>>> would be
>>>>> incorrectly detected as Microsoft's ones.
>>>>>
>>>>> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
>>>>> ---
>>>>> configure | 6 +++---
>>>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> While the patch description seems to make sense, I wanted to try it
>>>> out to
>>>> see the practical effect for myself, and I fail to observe any
>>>> difference.
>>>>
>>>> Can you provide your exact configure command line you use, where it
>>>> makes
>>>> a difference? I tried with "--cc=clang-cl --ld=lld-link
>>>> --toolchain=msvc"
>>>> and that works just as fine before this patch.
>>>>
>>>> In particular, the commands that you adjust run "$_cc -nologo-" and
>>>> grep
>>>> for "Microsoft" in the output of that. When I run that with
>>>> clang-cl, it
>>>> doesn't print a string containing "Microsoft".
>>>>
>>>> // Martin
>>>
>>> Hi,
>>>
>>> Yes you are right. In case of CC it doesn't change anything.
>>> clang-cl
>>> prints installation dir only with `-v`. The main thing this patch
>>> fixes is `--ar=llvm-ar` where it is mistaken for lib.exe and used
>>> with
>>> wrong parameters. While fixing this I figured to make CC check also
>>> more strict, because at some point it could be a problem. Sync all
>>> of
>>> them to have same style as one that was already there
>>
>> Oh, ok, with the reference to llvm-ar, I see what it fixes. Thanks!
>> The
>> reference to llvm-ar absolutely needs to be in the patch description
>> then.
>>
>> I remember that there has been some variance throughout the versions
>> for
>> exactly what MSVC prints as the identification thoughout the
>> versions, but
>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>
>
> I was wondering if non-english locale would translate that string, but
> I can't easily test that, I don't think.
>
Sorry, need to correct myself. It is indeed localized I was just lacking
the language pack…
For example in german it is:
Microsoft (R) C/C++-Optimierungscompiler Version 19.30.30709 für x64
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
> - Hendrik
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 11:55 ` Hendrik Leppkes
@ 2022-02-03 12:08 ` Marvin Scholz
2022-02-03 12:26 ` Marvin Scholz
1 sibling, 0 replies; 17+ messages in thread
From: Marvin Scholz @ 2022-02-03 12:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 3 Feb 2022, at 12:55, Hendrik Leppkes wrote:
> On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st>
> wrote:
>>
>> On Thu, 3 Feb 2022, Kacper Michajlow wrote:
>>
>>> On Wed, 26 Jan 2022 at 15:00, Martin Storsjö <martin@martin.st>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> On Sat, 22 Jan 2022, Kacper Michajłow wrote:
>>>>
>>>>> LLVM tools print installation path upon execution. If one uses
>>>>> LLVM
>>>>> tools bundled with Microsoft Visual Studio installation, they
>>>>> would be
>>>>> incorrectly detected as Microsoft's ones.
>>>>>
>>>>> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
>>>>> ---
>>>>> configure | 6 +++---
>>>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> While the patch description seems to make sense, I wanted to try it
>>>> out to
>>>> see the practical effect for myself, and I fail to observe any
>>>> difference.
>>>>
>>>> Can you provide your exact configure command line you use, where it
>>>> makes
>>>> a difference? I tried with "--cc=clang-cl --ld=lld-link
>>>> --toolchain=msvc"
>>>> and that works just as fine before this patch.
>>>>
>>>> In particular, the commands that you adjust run "$_cc -nologo-" and
>>>> grep
>>>> for "Microsoft" in the output of that. When I run that with
>>>> clang-cl, it
>>>> doesn't print a string containing "Microsoft".
>>>>
>>>> // Martin
>>>
>>> Hi,
>>>
>>> Yes you are right. In case of CC it doesn't change anything.
>>> clang-cl
>>> prints installation dir only with `-v`. The main thing this patch
>>> fixes is `--ar=llvm-ar` where it is mistaken for lib.exe and used
>>> with
>>> wrong parameters. While fixing this I figured to make CC check also
>>> more strict, because at some point it could be a problem. Sync all
>>> of
>>> them to have same style as one that was already there
>>
>> Oh, ok, with the reference to llvm-ar, I see what it fixes. Thanks!
>> The
>> reference to llvm-ar absolutely needs to be in the patch description
>> then.
>>
>> I remember that there has been some variance throughout the versions
>> for
>> exactly what MSVC prints as the identification thoughout the
>> versions, but
>> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>>
>
> I was wondering if non-english locale would translate that string, but
> I can't easily test that, I don't think.
>
Just tested this and it does not seem to be translated for me, at least
in the
x86 Native Tools Command Prompt.
> - Hendrik
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 11:34 ` Martin Storsjö
@ 2022-02-03 11:55 ` Hendrik Leppkes
2022-02-03 12:08 ` Marvin Scholz
2022-02-03 12:26 ` Marvin Scholz
0 siblings, 2 replies; 17+ messages in thread
From: Hendrik Leppkes @ 2022-02-03 11:55 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, Feb 3, 2022 at 12:34 PM Martin Storsjö <martin@martin.st> wrote:
>
> On Thu, 3 Feb 2022, Kacper Michajlow wrote:
>
> > On Wed, 26 Jan 2022 at 15:00, Martin Storsjö <martin@martin.st> wrote:
> >>
> >> Hi,
> >>
> >> On Sat, 22 Jan 2022, Kacper Michajłow wrote:
> >>
> >>> LLVM tools print installation path upon execution. If one uses LLVM
> >>> tools bundled with Microsoft Visual Studio installation, they would be
> >>> incorrectly detected as Microsoft's ones.
> >>>
> >>> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
> >>> ---
> >>> configure | 6 +++---
> >>> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> While the patch description seems to make sense, I wanted to try it out to
> >> see the practical effect for myself, and I fail to observe any difference.
> >>
> >> Can you provide your exact configure command line you use, where it makes
> >> a difference? I tried with "--cc=clang-cl --ld=lld-link --toolchain=msvc"
> >> and that works just as fine before this patch.
> >>
> >> In particular, the commands that you adjust run "$_cc -nologo-" and grep
> >> for "Microsoft" in the output of that. When I run that with clang-cl, it
> >> doesn't print a string containing "Microsoft".
> >>
> >> // Martin
> >
> > Hi,
> >
> > Yes you are right. In case of CC it doesn't change anything. clang-cl
> > prints installation dir only with `-v`. The main thing this patch
> > fixes is `--ar=llvm-ar` where it is mistaken for lib.exe and used with
> > wrong parameters. While fixing this I figured to make CC check also
> > more strict, because at some point it could be a problem. Sync all of
> > them to have same style as one that was already there
>
> Oh, ok, with the reference to llvm-ar, I see what it fixes. Thanks! The
> reference to llvm-ar absolutely needs to be in the patch description then.
>
> I remember that there has been some variance throughout the versions for
> exactly what MSVC prints as the identification thoughout the versions, but
> I think 'Microsoft.*Optimizing.*Compiler' should be safe.
>
I was wondering if non-english locale would translate that string, but
I can't easily test that, I don't think.
- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-02-03 6:44 ` Kacper Michajlow
@ 2022-02-03 11:34 ` Martin Storsjö
2022-02-03 11:55 ` Hendrik Leppkes
0 siblings, 1 reply; 17+ messages in thread
From: Martin Storsjö @ 2022-02-03 11:34 UTC (permalink / raw)
To: Kacper Michajlow; +Cc: FFmpeg development discussions and patches
On Thu, 3 Feb 2022, Kacper Michajlow wrote:
> On Wed, 26 Jan 2022 at 15:00, Martin Storsjö <martin@martin.st> wrote:
>>
>> Hi,
>>
>> On Sat, 22 Jan 2022, Kacper Michajłow wrote:
>>
>>> LLVM tools print installation path upon execution. If one uses LLVM
>>> tools bundled with Microsoft Visual Studio installation, they would be
>>> incorrectly detected as Microsoft's ones.
>>>
>>> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
>>> ---
>>> configure | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> While the patch description seems to make sense, I wanted to try it out to
>> see the practical effect for myself, and I fail to observe any difference.
>>
>> Can you provide your exact configure command line you use, where it makes
>> a difference? I tried with "--cc=clang-cl --ld=lld-link --toolchain=msvc"
>> and that works just as fine before this patch.
>>
>> In particular, the commands that you adjust run "$_cc -nologo-" and grep
>> for "Microsoft" in the output of that. When I run that with clang-cl, it
>> doesn't print a string containing "Microsoft".
>>
>> // Martin
>
> Hi,
>
> Yes you are right. In case of CC it doesn't change anything. clang-cl
> prints installation dir only with `-v`. The main thing this patch
> fixes is `--ar=llvm-ar` where it is mistaken for lib.exe and used with
> wrong parameters. While fixing this I figured to make CC check also
> more strict, because at some point it could be a problem. Sync all of
> them to have same style as one that was already there
Oh, ok, with the reference to llvm-ar, I see what it fixes. Thanks! The
reference to llvm-ar absolutely needs to be in the patch description then.
I remember that there has been some variance throughout the versions for
exactly what MSVC prints as the identification thoughout the versions, but
I think 'Microsoft.*Optimizing.*Compiler' should be safe.
So, the patch is ok if you equip it with a more detailed commit message.
Relatedly, I figured that it would be even more consistent to use
--ar=llvm-lib instead of --ar=llvm-ar, when working in an MSVC style
configuration, but we don't identify llvm-lib as the right kind of tool.
Would you be interested in fixing that too? :-)
>> elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
>
> just for consistency...
>
> Also I noticed that latest MSVC (19.30.30709) complains about
>> cl : Command line warning D9035 : option 'nologo-' has been deprecated and will be removed in a future release
>
> But it doesn't affect anything, even if it were to be removed. Since
> banner is shown always by default, unless `-nologo`. Just a side note
> :)
Yep - I think this has been an attempt to make sure it does get printed,
even if someone passes e.g. "--cc='cl -nologo'". As long as it doesn't
break, I guess it's no rush to change this.
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-01-26 14:00 ` Martin Storsjö
@ 2022-02-03 6:44 ` Kacper Michajlow
2022-02-03 11:34 ` Martin Storsjö
0 siblings, 1 reply; 17+ messages in thread
From: Kacper Michajlow @ 2022-02-03 6:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Martin Storsjö
On Wed, 26 Jan 2022 at 15:00, Martin Storsjö <martin@martin.st> wrote:
>
> Hi,
>
> On Sat, 22 Jan 2022, Kacper Michajłow wrote:
>
> > LLVM tools print installation path upon execution. If one uses LLVM
> > tools bundled with Microsoft Visual Studio installation, they would be
> > incorrectly detected as Microsoft's ones.
> >
> > Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
> > ---
> > configure | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
>
> While the patch description seems to make sense, I wanted to try it out to
> see the practical effect for myself, and I fail to observe any difference.
>
> Can you provide your exact configure command line you use, where it makes
> a difference? I tried with "--cc=clang-cl --ld=lld-link --toolchain=msvc"
> and that works just as fine before this patch.
>
> In particular, the commands that you adjust run "$_cc -nologo-" and grep
> for "Microsoft" in the output of that. When I run that with clang-cl, it
> doesn't print a string containing "Microsoft".
>
> // Martin
Hi,
Yes you are right. In case of CC it doesn't change anything. clang-cl
prints installation dir only with `-v`. The main thing this patch
fixes is `--ar=llvm-ar` where it is mistaken for lib.exe and used with
wrong parameters. While fixing this I figured to make CC check also
more strict, because at some point it could be a problem. Sync all of
them to have same style as one that was already there
> elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
just for consistency...
Also I noticed that latest MSVC (19.30.30709) complains about
> cl : Command line warning D9035 : option 'nologo-' has been deprecated and will be removed in a future release
But it doesn't affect anything, even if it were to be removed. Since
banner is shown always by default, unless `-nologo`. Just a side note
:)
-Kacper
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
2022-01-22 20:13 [FFmpeg-devel] [PATCH] configure: Fix " Kacper Michajłow
@ 2022-01-26 14:00 ` Martin Storsjö
2022-02-03 6:44 ` Kacper Michajlow
0 siblings, 1 reply; 17+ messages in thread
From: Martin Storsjö @ 2022-01-26 14:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Kacper Michajłow
Hi,
On Sat, 22 Jan 2022, Kacper Michajłow wrote:
> LLVM tools print installation path upon execution. If one uses LLVM
> tools bundled with Microsoft Visual Studio installation, they would be
> incorrectly detected as Microsoft's ones.
>
> Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
> ---
> configure | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
While the patch description seems to make sense, I wanted to try it out to
see the practical effect for myself, and I fail to observe any difference.
Can you provide your exact configure command line you use, where it makes
a difference? I tried with "--cc=clang-cl --ld=lld-link --toolchain=msvc"
and that works just as fine before this patch.
In particular, the commands that you adjust run "$_cc -nologo-" and grep
for "Microsoft" in the output of that. When I run that with clang-cl, it
doesn't print a string containing "Microsoft".
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
* [FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection
@ 2022-01-22 20:13 Kacper Michajłow
2022-01-26 14:00 ` Martin Storsjö
0 siblings, 1 reply; 17+ messages in thread
From: Kacper Michajłow @ 2022-01-22 20:13 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
LLVM tools print installation path upon execution. If one uses LLVM
tools bundled with Microsoft Visual Studio installation, they would be
incorrectly detected as Microsoft's ones.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
configure | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 94f513288a..f27fd067eb 100755
--- a/configure
+++ b/configure
@@ -4820,9 +4820,9 @@ probe_cc(){
_flags_filter=msvc_flags
_ld_lib='lib%.a'
_ld_path='-libpath:'
- elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
+ elif $_cc -nologo- 2>&1 | grep -q 'Microsoft.*Optimizing.*Compiler' || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
_type=msvc
- if $_cc -nologo- 2>&1 | grep -q Microsoft; then
+ if $_cc -nologo- 2>&1 | grep -q 'Microsoft.*Optimizing.*Compiler'; then
_ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
else
_ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
@@ -4927,7 +4927,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
DEPCCFLAGS=$_flags
fi
-if $ar 2>&1 | grep -q Microsoft; then
+if $ar 2>&1 | grep -q 'Microsoft.*Library.*Manager'; then
arflags="-nologo"
ar_o='-out:$@'
elif $ar 2>&1 | grep -q "\[D\] "; then
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2025-06-17 9:16 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-14 1:03 [FFmpeg-devel] [PATCH] configure: fix Microsoft tools detection Kacper Michajłow
2025-06-14 1:05 ` Kacper Michajlow
2025-06-16 7:40 ` Martin Storsjö
2025-06-16 13:24 ` Kacper Michajlow
2025-06-17 9:16 ` Martin Storsjö
-- strict thread matches above, loose matches on Subject: below --
2022-01-22 20:13 [FFmpeg-devel] [PATCH] configure: Fix " Kacper Michajłow
2022-01-26 14:00 ` Martin Storsjö
2022-02-03 6:44 ` Kacper Michajlow
2022-02-03 11:34 ` Martin Storsjö
2022-02-03 11:55 ` Hendrik Leppkes
2022-02-03 12:08 ` Marvin Scholz
2022-02-03 12:26 ` Marvin Scholz
2022-02-03 12:33 ` Martin Storsjö
2022-02-03 12:43 ` Marvin Scholz
2022-02-03 12:47 ` Martin Storsjö
2022-02-03 16:02 ` Marvin Scholz
2022-02-07 21:00 ` Martin Storsjö
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git