-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ffmpeg: add ARM64EC build support #48803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Harishmcw
wants to merge
1
commit into
microsoft:master
Choose a base branch
from
Harishmcw:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−6
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| diff --git a/compat/windows/makedef b/compat/windows/makedef | ||
| 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)' | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
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)