[FFmpeg-devel] [PATCH] fix(configure): fix detection on windows arm64
On Windows Arm64 `uname -m` returned `x86_64` instead of `aarch64` Link: https://github.com/msys2/msys2-runtime/issues/171 But `uname -s` contains `ARM64` suffix So check suffix on windows arm64 (for clangarm64) This problem also in VideoLAN/x264 Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 Signed-off-by: Coia Prant --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 2e69b3c..d8c1e09 100755 --- a/configure +++ b/configure @@ -4157,6 +4157,8 @@ if test "$target_os_default" = aix; then arch_default=$(uname -p) strip_default="strip -X32_64" nm_default="nm -g -X32_64" +elif [[ "$target_os_default" == "mingw"*"arm64" ]] || [[ "$target_os_default" == "msys"*"arm64" ]]; then +arch_default="aarch64" else arch_default=$(uname -m) fi -- 2.47.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-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] fix(configure): fix detection on windows arm64
Or do we detect the MSYSTEM environment variable? Martin Storsjö 于 2025年5月14日周三 03:31写道: > On Mon, 12 May 2025, Coia Prant wrote: > > > On Windows Arm64 > > `uname -m` returned `x86_64` instead of `aarch64` > > Link: https://github.com/msys2/msys2-runtime/issues/171 > > > > But `uname -s` contains `ARM64` suffix > > So check suffix on windows arm64 (for clangarm64) > > > > This problem also in VideoLAN/x264 > > Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 > > > > Signed-off-by: Coia Prant > > --- > > configure | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/configure b/configure > > index 2e69b3c..d8c1e09 100755 > > --- a/configure > > +++ b/configure > > @@ -4157,6 +4157,8 @@ if test "$target_os_default" = aix; then > > arch_default=$(uname -p) > > strip_default="strip -X32_64" > > nm_default="nm -g -X32_64" > > +elif [[ "$target_os_default" == "mingw"*"arm64" ]] || [[ > "$target_os_default" == "msys"*"arm64" ]]; then > > +arch_default="aarch64" > > else > > I don't think we should be detecting this for the msys*arm64 cases here. > If we're in the msys environment, as opposed to the mingw ones, then the > x86_64 that "uname -m" returns really is correct (even if running emulated > on aarch64, the msys environment itself is x86_64, so that's the target > architecture of the compilation). > > For the mingw*arm64 case, I haven't thought about all the potential > consequences of the patch; it may be acceptable. But the script is a > strict POSIX sh script, it can't use bash constructs (which is what > Michael observed in testing the patch). > > // 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-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] fix(configure): fix detection on windows
Thank you! Can you merge it in x264? I also send a merge request. Martin Storsjö 于 2025年5月25日周日 22:50写道: > On Fri, 23 May 2025, Coia Prant wrote: > > > On Windows Arm64 > > `uname -m` returned `x86_64` instead of `aarch64` > > Link: https://github.com/msys2/msys2-runtime/issues/171 > > > > On x86 32-bit toolchain msys2 environment > > `uname -m` returned `x86_64` instead of `i686` or `x86` > > > > So check MSYSTEM_CARCH on windows (for arm64 and i686) > > > > This problem also in VideoLAN/x264 > > Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 > > > > Signed-off-by: Coia Prant > > --- > > configure | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/configure b/configure > > index 2e69b3c..ed30b6b 100755 > > --- a/configure > > +++ b/configure > > @@ -4157,6 +4157,8 @@ if test "$target_os_default" = aix; then > > arch_default=$(uname -p) > > strip_default="strip -X32_64" > > nm_default="nm -g -X32_64" > > +elif test "$MSYSTEM_CARCH" != ""; then > > +arch_default="$MSYSTEM_CARCH" > > else > > arch_default=$(uname -m) > > fi > > -- > > 2.49.0.windows.1 > > This approach seems reasonable to me. > > (On i686 vs x86_64, it hasn't been an issue, since they all map into "x86" > within ffmpeg, and configure then checks the bitness, but for arm64 it's > indeed an issue.) > > I can push the patch soon if nobody minds it. > > // 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-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] fix(configure): fix detection on windows
Can u backport it to released branch? Martin Storsjö 于 2025年5月26日周一 19:48写道: > On Sun, 25 May 2025, Martin Storsjö wrote: > > > On Fri, 23 May 2025, Coia Prant wrote: > > > >> On Windows Arm64 > >> `uname -m` returned `x86_64` instead of `aarch64` > >> Link: https://github.com/msys2/msys2-runtime/issues/171 > >> > >> On x86 32-bit toolchain msys2 environment > >> `uname -m` returned `x86_64` instead of `i686` or `x86` > >> > >> So check MSYSTEM_CARCH on windows (for arm64 and i686) > >> > >> This problem also in VideoLAN/x264 > >> Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 > >> > >> Signed-off-by: Coia Prant > >> --- > >> configure | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff --git a/configure b/configure > >> index 2e69b3c..ed30b6b 100755 > >> --- a/configure > >> +++ b/configure > >> @@ -4157,6 +4157,8 @@ if test "$target_os_default" = aix; then > >> arch_default=$(uname -p) > >> strip_default="strip -X32_64" > >> nm_default="nm -g -X32_64" > >> +elif test "$MSYSTEM_CARCH" != ""; then > >> +arch_default="$MSYSTEM_CARCH" > >> else > >> arch_default=$(uname -m) > >> fi > >> -- > >> 2.49.0.windows.1 > > > > This approach seems reasonable to me. > > > > (On i686 vs x86_64, it hasn't been an issue, since they all map into > "x86" > > within ffmpeg, and configure then checks the bitness, but for arm64 it's > > indeed an issue.) > > > > I can push the patch soon if nobody minds it. > > Pushed now, with a rewritten commit message explaining the situation a bit > more. > > But it seems like I lost the reference to > https://github.com/msys2/msys2-runtime/issues/171 while rewriting the > text, sorry about that. > > // 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-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] fix(configure): fix detection on windows arm64
Also we can check $MSYSTEM_CARCH if it exists How about your idea? Coia Prant 于 2025年5月23日周五 17:11写道: > On Windows Arm64 > `uname -m` returned `x86_64` instead of `aarch64` > Link: https://github.com/msys2/msys2-runtime/issues/171 > > But `uname -s` contains `ARM64` suffix > So check MSYSTEM on windows arm64 (for clangarm64) > > This problem also in VideoLAN/x264 > Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 > > Signed-off-by: Coia Prant > --- > configure | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/configure b/configure > index 2e69b3c..1901da3 100755 > --- a/configure > +++ b/configure > @@ -4151,12 +4151,15 @@ response_files_default="auto" > # OS > target_os_default=$(tolower $(uname -s)) > host_os=$target_os_default > +msystem=$(tolower $MSYSTEM) > > # machine > if test "$target_os_default" = aix; then > arch_default=$(uname -p) > strip_default="strip -X32_64" > nm_default="nm -g -X32_64" > +elif test "$msystem" = clangarm64; then > +arch_default="aarch64" > else > arch_default=$(uname -m) > fi > -- > 2.49.0.windows.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-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] fix(configure): fix detection on windows
On Windows Arm64 `uname -m` returned `x86_64` instead of `aarch64` Link: https://github.com/msys2/msys2-runtime/issues/171 On x86 32-bit toolchain msys2 environment `uname -m` returned `x86_64` instead of `i686` or `x86` So check MSYSTEM_CARCH on windows (for arm64 and i686) This problem also in VideoLAN/x264 Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 Signed-off-by: Coia Prant --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 2e69b3c..ed30b6b 100755 --- a/configure +++ b/configure @@ -4157,6 +4157,8 @@ if test "$target_os_default" = aix; then arch_default=$(uname -p) strip_default="strip -X32_64" nm_default="nm -g -X32_64" +elif test "$MSYSTEM_CARCH" != ""; then +arch_default="$MSYSTEM_CARCH" else arch_default=$(uname -m) fi -- 2.49.0.windows.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-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2] fix(configure): fix detection on windows arm64
On Windows Arm64 `uname -m` returned `x86_64` instead of `aarch64` Link: https://github.com/msys2/msys2-runtime/issues/171 But `uname -s` contains `ARM64` suffix So check MSYSTEM on windows arm64 (for clangarm64) This problem also in VideoLAN/x264 Link: https://code.videolan.org/videolan/x264/-/merge_requests/177 Signed-off-by: Coia Prant --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index 2e69b3c..1901da3 100755 --- a/configure +++ b/configure @@ -4151,12 +4151,15 @@ response_files_default="auto" # OS target_os_default=$(tolower $(uname -s)) host_os=$target_os_default +msystem=$(tolower $MSYSTEM) # machine if test "$target_os_default" = aix; then arch_default=$(uname -p) strip_default="strip -X32_64" nm_default="nm -g -X32_64" +elif test "$msystem" = clangarm64; then +arch_default="aarch64" else arch_default=$(uname -m) fi -- 2.49.0.windows.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-requ...@ffmpeg.org with subject "unsubscribe".