-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
remove native nasm #6263
base: master
Are you sure you want to change the base?
remove native nasm #6263
Conversation
- remove native nasm, it is a prerequisite in the dev. environment since update to debian 12 - remove native yasm - update related Makefiles
This reverts commit 2c4a9cb.
- change affected packages to trigger build
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.
Beside possible issue found with openh264
that your change brought to light, LGTM.
- update cross/dav1d - remove definitions for nasm, meson build completely auto detects nasm
- remove definitions for nasm, meson build completely auto detects nasm - create optimized code
- cmake builds completely auto detect nasm
Special NASM definitions for meson and cmake build systems are obsolete and removed now. further analysis for gcc builds (spksrc.cross-cc.mk) is WIP. |
- disable support for OLD_PPC_ARCHS - build with assembler, except for PPC_ARCHS - remove obsolete configure args --enable-pic is forced with --enable-shared --cross-prefix is not required - remove definition of GNU_CONFIGURE and define --host - simplify definition of gcc as assembler if not using x86asm
- define --as=auto to use yasmm (prefered over nasm) - document why we don't define GNU_CONFIGRE - remove concurring patch - avoid duplicate definition of --disable-neon
ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) | ||
CONFIGURE_ARGS += --target=x86-linux-gcc | ||
# --as=auto: prefers yasm over nasm | ||
CONFIGURE_ARGS += --as=auto | ||
CONFIGURE_ARGS += --disable-sse4_1 |
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.
@th0ma7 can you remember why you disabled sse4_1 for intel archs?
it builds just fine without disabling it
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.
This change comes from this PR: #6148
Specifically from this commit: c4c0d44
But I haven't left any descriptions as to why I disabled it? Maybe it failed on DSM6, again using gcc <= 4.9.x for that specific libvpx version (i.e 1.14.1)?
Looking a bit further this may have been a mistake from my part as SSE4.1 (Streaming SIMD Extensions 4.1) has nothing to do with newer AVX extensions and may have mixed them somehow. A bit more reading on it makes it that pretty much all "recent" intel based nas from synology (i.e. less than 10-12 years old) should support this extension...
I believe it is safe to remove that.
@th0ma7 the libraries and *.mk files are ready for review. On the ffmpeg* packages there is some pending work...
|
and the third issue is with even we configure with |
CONFIGURE_ARGS += -Denable_asm=true | ||
|
||
# Allow ASM on aarch64, disable on all others | ||
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) | ||
CONFIGURE_ARGS += -Denable_asm=true | ||
else | ||
CONFIGURE_ARGS += -Denable_asm=false |
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.
nasm is only used for x86/x86_64, while for aarch64 it uses the gcc assembler (as
). Considering the code above, you should have kept something such as:
ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH))
CONFIGURE_ARGS += -Denable_asm=true
else
CONFIGURE_ARGS += -Denable_asm=false
endif
While it probably builds ok, I recall code to fail on armv7 in multiple cases which led to enable assembly optimizations only on aarch64 and x86 archs. I would suggest keeping this ifeq else usecase (and maybe elsewhere, haven't looked at all the code changes).
EDIT: On another comment I realized that issues with as
on armv7 related to gcc <= 4.9, rather suggesting:
include ../../mk/spksrc.common.mk
ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS) $(i686_ARCHS) $(x64_ARCHS)),$(ARCH))
CONFIGURE_ARGS += -Denable_asm=true
# only enable `asm` on armv7 when using gcc > 4.9.* (i.e. DSM7+)
else if ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH))
ifeq ($(call version_lt, ${TC_GCC}, 5),1)
CONFIGURE_ARGS += -Denable_asm=true
endif
else
CONFIGURE_ARGS += -Denable_asm=false
endif
NASM_BINARY = $(shell which nasm) | ||
ifeq ($(NASM_BINARY),) | ||
$(error nasm not found. Please intall NASM assembler) | ||
endif | ||
ENV += AS=$(NASM_BINARY) |
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.
Is that test even needed? I did not bother with that for ffmpeg5-6-7, maybe worth either using it everywhere or I would suggest not at all.
ADDITIONAL_CXXFLAGS = -std=c++0x | ||
endif | ||
|
||
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) | ||
CONFIGURE_ARGS += --target=armv7-linux-gcc | ||
CONFIGURE_ARGS += --disable-neon |
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.
Disabling of neon was done in this PR #5620
This was the comit: 6ad7f5f
So from the commit log it states disabling neon (i.e. which includes as
optimizations) on armv7 when using a compiler <= 4.9, basically on dsm6. I suggest the following change:
include ../../mk/spksrc.common.mk
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH))
CONFIGURE_ARGS += --target=armv7-linux-gcc
ifeq ($(call version_lt, ${TC_GCC}, 5),1)
CONFIGURE_ARGS += --disable-neon
endif
endif
ifeq ($(findstring $(ARCH),$(i686_ARCHS)),$(ARCH)) | ||
CONFIGURE_ARGS += --target=x86-linux-gcc | ||
# --as=auto: prefers yasm over nasm | ||
CONFIGURE_ARGS += --as=auto | ||
CONFIGURE_ARGS += --disable-sse4_1 |
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.
This change comes from this PR: #6148
Specifically from this commit: c4c0d44
But I haven't left any descriptions as to why I disabled it? Maybe it failed on DSM6, again using gcc <= 4.9.x for that specific libvpx version (i.e 1.14.1)?
Looking a bit further this may have been a mistake from my part as SSE4.1 (Streaming SIMD Extensions 4.1) has nothing to do with newer AVX extensions and may have mixed them somehow. A bit more reading on it makes it that pretty much all "recent" intel based nas from synology (i.e. less than 10-12 years old) should support this extension...
I believe it is safe to remove that.
@@ -15,14 +15,10 @@ LICENSE = BSD | |||
UNSUPPORTED_ARCHS = $(PPC_ARCHS) | |||
|
|||
CONFIGURE_ARGS += -Dtests=disabled | |||
ADDITIONAL_CPPFLAGS = -O |
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.
Why? is it to diable optimizations (i.e. -O0
)
# Define x86asm or use gcc as assembler | ||
ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) | ||
NASM_BINARY = $(shell which nasm) | ||
ifeq ($(NASM_BINARY),) | ||
$(error nasm not found. Please install NASM assembler) | ||
endif | ||
ENV += AS=$(NASM_BINARY) | ||
else |
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.
Similarly to ffmpeg, isn't this too much as nasm is always installed?
If anything, I'd rather have that test being done outside from individual cross but within the framework to avoid code duplication if feasible.
ifeq ($(strip $(CMAKE_USE_NASM)),1) | ||
ifeq ($(findstring $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),$(ARCH)) | ||
@echo "# set assembly compiler" ; \ | ||
echo "set(ENABLE_ASSEMBLY $(ENABLE_ASSEMBLY))" ; \ | ||
echo "set(CMAKE_ASM_COMPILER $(CMAKE_ASM_COMPILER))" ; \ | ||
echo | ||
endif | ||
endif |
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.
This is rather interesting... indeed cmake should auto-detect nasm
as being in default PATH.
I did a first pass, overall looking good. However I believe it does require minor adjustments for armv7 with gcc <= 4.9.x pertaining to assembly optimizations (i.e. neon).
I would suggest removing
Wow, that brings me a while back... when I took over the ffmpeg maintenance (which I didn't new what I was up against), I thought we absolutely needed arch specific packages for acceleration purposes... Not totally wrong but unsustainable as we a) don't have the manpower to support that (and not sure of the benefits) and b) don't have the storage space to do so. Honestly this can be cleaned-up, it's just crap left-over. Good catch thoughg 🤷 |
I tried enabling the following options to check if nasm would be used somewhere, but nothing (btw, nevertless, mp3rtp could be enabled with the addition of
Looking at arch linux and gentoo they both enable nasm...? Even default debian rules files enables it. btw
Tried them all, nothing shows up from a nasm usage ... So I tried compiling on the host to see what hapens, and it does enter into
Honestly, I don't believe it ever worked or I'm missing something? |
Description
Fixes #
Affected Libraries
Direct dependencies
Further findings
Affected Packages
By direct dependencies
Checklist
all-supported
completed successfullyType of change