Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions ports/ffmpeg/0008-add-arm64ec-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
diff --git a/compat/windows/makedef b/compat/windows/makedef
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are fairly large patches, have you submitted them upstream?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BillyONeal,

Yes, these patches were submitted upstream to FFmpeg. However, the maintainers indicated that ARM64EC support would require ongoing maintenance and therefore could not be merged at this time, so we are providing ARM64EC support through vcpkg.

Copy link
Member

@BillyONeal BillyONeal Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the maintainers indicated that ARM64EC support would require ongoing maintenance and therefore could not be merged at this time

Unfortunately that sounds like upstream explicitly declining to take the patch which would be a reason we would not take this. See https://learn.microsoft.com/vcpkg/contributing/maintainer-guide#patching

... our most important thing is we don't put words in upstream's mouth and if they have explicitly declined to do something we are not a means to go around their wishes.

(I understand that arm64ec is a thing Microsoft cares about in some capacity and vcpkg is a Microsoft product but that doesn't mean we are sponsoring development of everything in vcpkg's registry)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(You could consider doing vanilla arm64 and calling ffmpeg out-of-proc from arm64ec apps)

index add8222d13..af42f08fd5 100755
--- a/compat/windows/makedef
+++ b/compat/windows/makedef
@@ -48,7 +48,13 @@ trap 'rm -f -- $libname' EXIT
if [ -n "$AR" ]; then
$AR rcs ${libname} $@ >/dev/null
else
- lib.exe -out:${libname} $@ >/dev/null
+ machine_flag=""
+ case "$LDFLAGS" in
+ *"machine:arm64ec"*)
+ machine_flag="-machine:arm64ec"
+ ;;
+ esac
+ lib.exe ${machine_flag} -out:${libname} $@ >/dev/null
fi
if [ $? != 0 ]; then
echo "Could not create temporary library." >&2
@@ -106,12 +112,21 @@ if [ -n "$NM" ]; then
grep -v : |
grep -v ^$ |
cut -d' ' -f3 |
- sed -e "s/^${prefix}//")
+ sed -e "s/^${prefix}//" -e "s/^#//" |
+ grep -v '\$entry_thunk' |
+ grep -v '\$exit_thunk')
else
- dump=$(dumpbin.exe -linkermember:1 ${libname} |
- sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e "s/ \{1,\}${prefix}/ /" -e 's/ \{1,\}/ /g' |
+ member=1
+ case "$LDFLAGS" in
+ *"machine:arm64ec"*)
+ member=32
+ ;;
+ esac
+ dump=$(dumpbin.exe -linkermember:${member} ${libname} |
+ sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e 's/^[[:space:]]*[0-9A-Fa-f]\{1,\}[[:space:]]\{1,\}//' -e "s/^${prefix}//" -e 's/^#//' |
tail -n +2 |
- cut -d' ' -f3)
+ grep -v '\$entry_thunk' |
+ grep -v '\$exit_thunk')
fi

rm ${libname}
diff --git a/configure b/configure
index 98b582a5d5..589be1b1cf 100755
--- a/configure
+++ b/configure
@@ -4623,7 +4623,7 @@ case "$toolchain" in
nm_default="dumpbin.exe -symbols"
ar_default="lib.exe"
case "${arch:-$arch_default}" in
- aarch64|arm64)
+ aarch64|arm64|arm64ec)
as_default="armasm64.exe"
;;
arm*)
@@ -5250,7 +5250,7 @@ fi

# Deal with common $arch aliases
case "$arch" in
- aarch64|arm64)
+ aarch64|arm64|arm64ec)
arch="aarch64"
;;
arm*|iPad*|iPhone*)
@@ -5895,7 +5895,7 @@ case $target_os in
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
- SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+ SLIB_CREATE_DEF_CMD='LDFLAGS="$(LDFLAGS)" EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'

18 changes: 15 additions & 3 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vcpkg_from_github(
0004-dependencies.patch
0005-fix-nasm.patch
0007-fix-lib-naming.patch
0008-add-arm64ec-support.patch
0013-define-WINVER.patch
0020-fix-aarch64-libswscale.patch
0024-fix-osx-host-c11.patch
Expand Down Expand Up @@ -122,8 +123,12 @@ if(VCPKG_DETECTED_CMAKE_AR)
get_filename_component(AR_path "${VCPKG_DETECTED_CMAKE_AR}" DIRECTORY)
get_filename_component(AR_filename "${VCPKG_DETECTED_CMAKE_AR}" NAME)
if(AR_filename MATCHES [[^(llvm-)?lib\.exe$]])
set(ENV{AR} "ar-lib ${AR_filename}")
string(APPEND OPTIONS " --ar='ar-lib ${AR_filename}'")
set(AR_MACHINE "")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
set(AR_MACHINE " -machine:arm64ec")
endif()
set(ENV{AR} "ar-lib ${AR_filename}${AR_MACHINE}")
string(APPEND OPTIONS " --ar='ar-lib ${AR_filename}${AR_MACHINE}'")
else()
set(ENV{AR} "${AR_filename}")
string(APPEND OPTIONS " --ar='${AR_filename}'")
Expand Down Expand Up @@ -608,7 +613,7 @@ else()
set(BUILD_ARCH ${VCPKG_TARGET_ARCHITECTURE})
endif()

if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_find_acquire_program(GASPREPROCESSOR)
foreach(GAS_PATH ${GASPREPROCESSOR})
Expand All @@ -618,6 +623,11 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQU
endif()
endif()

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
string(APPEND OPTIONS " --as=\"armasm64.exe -machine ARM64EC\"")
string(APPEND OPTIONS " --extra-ldflags=/machine:arm64ec")
endif()

if(VCPKG_TARGET_IS_UWP)
set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
string(APPEND OPTIONS " --disable-programs")
Expand Down Expand Up @@ -813,6 +823,8 @@ if(VCPKG_TARGET_IS_WINDOWS)
set(LIB_MACHINE_ARG /machine:ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
set(LIB_MACHINE_ARG /machine:ARM64EC)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
Expand Down
1 change: 1 addition & 0 deletions ports/ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "ffmpeg",
"version": "8.0.1",
"port-version": 1,
"description": [
"A library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set(interpreter PERL)
set(search_names "gas-preprocessor.pl")
set(paths_to_search "${DOWNLOADS}/tools/gas-preprocessor/${tool_subdirectory}")
set(rename_binary_to "gas-preprocessor.pl")
set(commit_id 9309c67acb535ca6248f092e96131d8eb07eefc1)
set(commit_id b2745758d9eee37a5bc6ee3c4901edc995d9343c)
set(download_urls "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/${commit_id}/gas-preprocessor.pl")
string(SUBSTRING ${commit_id} 0 8 tool_subdirectory)
set(download_filename "gas-preprocessor-${tool_subdirectory}.pl")
set(download_sha512 b4749cf8aa758e3f28d4b21803422a5c2588f5fc48cfd317564606b374f8d739c636067cf7a4956d7365d63b055bc6e7626c304857e6c9013d6b4a0db9d8ad4f)
set(download_sha512 1ccb21d0feb75452f95d280173be30be1a034ac9c4e2f4c4ee3fe3918b82c60694b2bd015d3f6059e24a71ca68d4748738347b1c69d25d01bb335f24951b7d96)
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2930,7 +2930,7 @@
},
"ffmpeg": {
"baseline": "8.0.1",
"port-version": 0
"port-version": 1
},
"ffmpeg-bin2c": {
"baseline": "8.0.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/ffmpeg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0130b1a190072eb0a8d4445bc250c71f07379014",
"version": "8.0.1",
"port-version": 1
},
{
"git-tree": "109d41404a6701389e5fedf92ff1c903798aff54",
"version": "8.0.1",
Expand Down