-
Notifications
You must be signed in to change notification settings - Fork 189
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
Bump vendored libraries #384
Conversation
b4d2978
to
542a3d8
Compare
Haven't read any details, but
I hope libsharpyuv in new libwebp won't be a problem, i.e. libwebp and libwebpdemux libs hopefully not rely on it? EDIT: .. and the webp bump is not that necessary IMO, but that's just me. |
@@ -354,20 +367,40 @@ if(SDL3IMAGE_ZLIB) | |||
endif() | |||
endif() | |||
|
|||
if(SDL3IMAGE_DAV1D) |
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.
Should this not be cover under the if(SDL3IMAGE_AVIF_VENDORED)
block?
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're right it would be equivalent to put it under the if(SDL3IMAGE_AVIF_VENDORED)
, but I didn't do it for cosmatic reasons and consistency. The script also does this for zib.
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.
The script also does this for zib.
Then zlib handling should be changed too, IMO
Looked very briefly at the new v1.2.1-SDL branch: You added cmake support to it, but I couldn't see how you handle nasm requirement? EDIT: Is Android.mk in new branch tested? |
The |
This PR is also a good opportunity for us to audit symbol visibility from 3rd party libs. I.e.: If we statically link to them, their symbols should not be exported at all by our library. |
Great branch name btw :) |
fa9fb6e
to
03a0c4c
Compare
Looks like
I don't see a configure option to disable it in the cmake script, and neither in the
Let's treat this as a yearly update.
Fixed. Thanks!
There is no asm support.
No. With the |
96217bf
to
b163335
Compare
That's bad, actually. If we are to build vendored webp as shared lib, we should
I'm not against it. But here you have additional issues to solve and the
Well, we won't expect much from dav1d side then with asm disabled..
Its asm file lists / configs most possibly need updating, but after seeing the no-asm above, well... |
You seem to have reverted it.. EDIT: Seems fixed now. EDIT/2: Just deleted the obsolete |
Ragarding dav1d and cmake portage issues and no asm: If it's a big hassle, there is the option to use libaom ? |
There are 4 options:
|
|
I added assembly support to dav1d, but it's not going to work for arm and msvc: it needs gas-preprocess.pl. I'm not 100% sure, but I think it's this: https://github.com/libav/gas-preprocessor |
6701aec
to
c0c281a
Compare
Re: libwebp: If we are to bump to 1.3.1, please rebase 1.3.1-SDL branch to current 1.3.1, or cherry-pick libsdl-org/libwebp@2af2626 into it EDIT: If we are to keep going with 1.0.3, I cherry-picked the relevant commit into 1.0.3-SDL so SDL_image side needs updating |
1913e1d
to
75b5542
Compare
Anything else left? Maybe a few things noted at #383 but they are mostly SDL2-related and can (I just rebuilt the libavif dlls for the msvc project and uploaded, btw) |
We should link with whatever the default DLL name is for each project. That way if someone builds it independently, they can drop in a new DLL. |
I disagree: We shouldn't. At the very least, the default windows builds of libavif have no versioning in their names, only libavif.dll, and 0.9.3, 0.10, 0.11 and 1.0 are abi-incompatible. |
Fair enough. |
msys2 is not consistent in versioning their libraries. |
zlib tagged new 1.3.1 release: Do we want to upgrade? |
Sure. In general we want to follow library public releases. |
OK, I created v1.3.1-SDL branch in our zlib fork and applied two of our patches. @madebr: Will you do the upgrade in SDL_image or should I attempt it? @slouken: Should we upgrade in 2.8.x release branch too? |
Feel free to do it, you probably need to add Do |
What are the changes in 1.3.1? If it's security fixes, we should definitely add it to the release branch. If not, it's probably fine to leave it in SDL2 for now. |
Changelog doesn't look critical to me: https://github.com/madler/zlib/releases/tag/v1.3.1 |
Yep, sounds good. |
@madebr: Can we not emulate it with something like the following regardless of cmake version? cmake_push_check_state()
if(WIN32)
set (CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
endif()
add_library (avif ...
stuff...
cmake_pop_check_state() |
Older CMake versions will just ignore if(CMAKE_VERSION VERSION_LESS "3.27")
set_property(TARGET avif PROPERTY OUTPUT_NAME "avif-$<TARGET_PROPERTY:avif,SOVERSION>")
else()
set_property(TARGET avif PROPERTY DLL_NAME_WITH_SOVERSION "1")
endif() |
Are you sure? It works for me with cmake 3.1.0 (at least with mingw) ?? |
No, I'm not. |
Looked at the sources: In cmGeneratorTarget.cxx : GetFullNameInternalComponents() of 3.26.6 // Name shared libraries with their version number on some platforms.
if (cmValue soversion = this->GetProperty("SOVERSION")) {
if (this->GetType() == cmStateEnums::SHARED_LIBRARY &&
!isImportedLibraryArtifact &&
this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION")) {
outBase += "-";
outBase += *soversion;
}
} In 3.1.0, it is like this in cmTarget.cxx : GetFullNameInternal() : // Name shared libraries with their version number on some platforms.
if(const char* soversion = this->GetProperty("SOVERSION"))
{
if(this->GetType() == cmTarget::SHARED_LIBRARY && !implib &&
this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
{
outBase += "-";
outBase += soversion;
}
} |
Just tried it out in a test project, looks like it works. |
So, the libavif patch should look like the following ? diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbdcd01..4b7c791 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -533,6 +533,11 @@ if(NOT AVIF_CODEC_AOM
message(WARNING "libavif: No decoding library is enabled.")
endif()
+include(CMakePushCheckState)
+cmake_push_check_state()
+if(BUILD_SHARED_LIBS AND WIN32)
+ set(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+endif()
add_library(avif ${AVIF_SRCS})
set_target_properties(avif PROPERTIES VERSION ${LIBRARY_VERSION} SOVERSION ${LIBRARY_SOVERSION} C_VISIBILITY_PRESET hidden)
target_compile_definitions(avif PRIVATE ${AVIF_PLATFORM_DEFINITIONS} ${AVIF_CODEC_DEFINITIONS})
@@ -541,10 +546,7 @@ target_include_directories(
avif PUBLIC $<BUILD_INTERFACE:${libavif_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> PRIVATE ${AVIF_PLATFORM_INCLUDES}
${AVIF_CODEC_INCLUDES}
)
-if(BUILD_SHARED_LIBS AND WIN32 AND NOT CMAKE_PLATFORM_NO_VERSIONED_SONAME)
- set_property(TARGET avif PROPERTY OUTPUT_NAME "avif-${LIBRARY_SOVERSION}")
- set_property(TARGET avif PROPERTY DLL_NAME_WITH_SOVERSION OFF)
-endif()
+cmake_pop_check_state()
target_include_directories(avif PRIVATE "${libavif_SOURCE_DIR}/third_party/libyuv/include/")
set(AVIF_PKG_CONFIG_EXTRA_CFLAGS "")
if(BUILD_SHARED_LIBS) Am I supposed to set NOTE: Built libavif patched as above using Cmake+MSVC, it gave me an Not sure what to change in SDL_image's cmake'ry, though?? The only commit about |
You need to do Don't disable the |
OK, got it. So the final libavif patch is the following yes? (I'm keeping MSVC case as is) And there is nothing to do in SDL_image cmake'ry? diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbdcd01..28a67a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -531,22 +531,21 @@ if(NOT AVIF_CODEC_AOM
AND NOT AVIF_CODEC_AVM
)
message(WARNING "libavif: No decoding library is enabled.")
endif()
+if(BUILD_SHARED_LIBS AND WIN32)
+ set(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+endif()
add_library(avif ${AVIF_SRCS})
set_target_properties(avif PROPERTIES VERSION ${LIBRARY_VERSION} SOVERSION ${LIBRARY_SOVERSION} C_VISIBILITY_PRESET hidden)
target_compile_definitions(avif PRIVATE ${AVIF_PLATFORM_DEFINITIONS} ${AVIF_CODEC_DEFINITIONS})
target_link_libraries(avif PRIVATE ${AVIF_CODEC_LIBRARIES} ${AVIF_PLATFORM_LIBRARIES})
target_include_directories(
avif PUBLIC $<BUILD_INTERFACE:${libavif_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> PRIVATE ${AVIF_PLATFORM_INCLUDES}
${AVIF_CODEC_INCLUDES}
)
-if(BUILD_SHARED_LIBS AND WIN32 AND NOT CMAKE_PLATFORM_NO_VERSIONED_SONAME)
- set_property(TARGET avif PROPERTY OUTPUT_NAME "avif-${LIBRARY_SOVERSION}")
- set_property(TARGET avif PROPERTY DLL_NAME_WITH_SOVERSION OFF)
-endif()
target_include_directories(avif PRIVATE "${libavif_SOURCE_DIR}/third_party/libyuv/include/")
set(AVIF_PKG_CONFIG_EXTRA_CFLAGS "")
if(BUILD_SHARED_LIBS)
target_compile_definitions(avif PUBLIC AVIF_DLL PRIVATE AVIF_BUILDING_SHARED_LIBS)
set(AVIF_PKG_CONFIG_EXTRA_CFLAGS " -DAVIF_DLL") |
Looks fine to me (if CI generates the same set of files).
I don't think so: |
OK, will be testing patches in my fork soon
That MSVC is outputting
OK, got it, Not touching SDL_image. |
This can be fixed by doing (Sorry, I didn't read that part of your original post) |
(as discussed at libsdl-org/SDL_image#384 (comment))
OK, pushed libsdl-org/libavif@5bcd7d0 and updated vendored libavif in SDL_image, both main and SDL2 branches. libavif has a CI failure, seems unrelated to the patch. SDL_image, both main SDL2 branches, has test failures in macos runs (for jxl I think), seems unrelated to the patch. Downloaded the SDL3 MSVC artifact from CI runs: avif dll is named libavif-16.dll and SDL3_image.dll is looking for it with the correct name judging by the strings in the dll. |
Great!
I think you're seeing an issue with libjxl that's too recent. |
And add support for building a vendored libavif library with cmake.