diff options
author | Timo Teräs <timo.teras@iki.fi> | 2018-11-09 13:12:14 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-11-09 13:21:55 +0000 |
commit | 157372b0708efca4eace0b554228ce22d7dce4ff (patch) | |
tree | 1bee49152d19d4f759cba5a3604f29460e19e690 | |
parent | 0da19cce01c8b0cd59063889fd2fb5c7fa107012 (diff) | |
download | aports-157372b0708efca4eace0b554228ce22d7dce4ff.tar.bz2 aports-157372b0708efca4eace0b554228ce22d7dce4ff.tar.xz |
community/qt5-qtwebengine: fix build
- fix the musl dispatch patch not to use dlopen() which can call malloc
- add ffmpeg4 build fix
-rw-r--r-- | community/qt5-qtwebengine/APKBUILD | 4 | ||||
-rw-r--r-- | community/qt5-qtwebengine/qt-musl-dispatch_to_musl.patch | 26 | ||||
-rw-r--r-- | community/qt5-qtwebengine/qtwebengine-ffmpeg4.patch | 89 |
3 files changed, 102 insertions, 17 deletions
diff --git a/community/qt5-qtwebengine/APKBUILD b/community/qt5-qtwebengine/APKBUILD index 5f11d4179d..2ca0415380 100644 --- a/community/qt5-qtwebengine/APKBUILD +++ b/community/qt5-qtwebengine/APKBUILD @@ -74,6 +74,7 @@ source="http://download.qt-project.org/$_rel/qt/${pkgver%.*}/$_ver/submodules/qt qt-musl-siginfo_t.patch qt-musl-stackstart.patch qtwebkit-chartype.patch + qtwebengine-ffmpeg4.patch musl-sandbox.patch yasm-nls.patch " @@ -96,7 +97,7 @@ package() { sha512sums="dc1b15eb857cb9ff3ef98a2f90cfec8c40429eea292bbed6a323cf1c4b044f3b73efaf51833fe8d9ca2ecc4f99d7092590a1a34248a9ab14fa5a38d4335f4925 qtwebengine-everywhere-src-5.10.1.tar.xz 5e017e6500af56d0e608839c466782193ab3f6e5d01938b84b7f9c86fbb826e140f9fca789a23e7a7431ba42377be328a8bfcacbf7c302746de79f7857f2832d arm-void-is-not-android.patch -e8ca442eebc47a01ef51304a38062dcf3a334c8985b67c1fcefbbc530a5c773d26086b3ba7909e051fe5fea8b7784336b08f9899a3c6ab2508f7251db122e5de qt-musl-dispatch_to_musl.patch +5ecbf435062b8565322dd1cbd0cbdb44f3daef264ab677fe22fe8cb400d4bb22281cc607ea419c7362c483312482632ed41bd67130413188425ef6e0ae184f07 qt-musl-dispatch_to_musl.patch 3af77688071c5d42bb8e902e059f2c1c956ed531c5072f16dfc02cff091df4828fda2cce887deba49b2e8c4c4195754c2ccb2a2238b9b827eb4d58398e1f0e07 qt-musl-execinfo.patch 819786f225c2312cf1afeceed24968204095db0ff4e5739f6b46bfec639e26a9d1702e0d7ce8493562f9d4c08d5a31ba48bdc47553ac78ef5763cb4ec1e57e5c qt-musl-mallinfo.patch 7eba28eb015f1a7e5cf70e9354fcd647b69f4e7c061b889a8c0d55f4a94a033f95d0252f9baebf13c3d501438074a05d547eef2c8cf898dc2c87cec3b60e76e0 qt-musl-off_t.patch @@ -106,5 +107,6 @@ c39b4c39ad3e297dc4f2508af9fb6b1618e8f6fac4399e41b5bde00a1e79cc0cd24af8b8c01bfe61 2fead16e7d7379b622da0e3172905444d9d72d1a53ff080327a3d59f60541c5c076d9b58f110b039da8c9ebc3b5efec53af118e1172efd01886ff9ac2b730d5f qt-musl-siginfo_t.patch 1acac5b3c94096f3ff05105008a971d44512074b09a2c1313b48e10cb1bcefb94d8a6d29c305c00d461c532afbeed2f2953ffc8c722d9000e178d977c8566f33 qt-musl-stackstart.patch 20e8262292aa55c2a30f66570e702cbf3539e03ca563be987de734c50b6e0ccceccab64d1b11e55dde01868abd965470eb1c1fbf0d56917fa370e500c90a9660 qtwebkit-chartype.patch +e06fd01cab57e50e137faea5a73839e584afb3678f9e690c8869c215ce3809ee5a713f9213da4b10612edbe9f936e87d542a8d9f5229f47271d1dc019ca44310 qtwebengine-ffmpeg4.patch 635d77109b5ce9bc9697d621f1bf98193903e2ac69fc4079fb92f175daa80147fed8ae15544d239ef680e120474d8f811002935ef1a078836ba01695f9ddfcb9 musl-sandbox.patch f6b1941e40f44b675ab554166e3cd8d3272b23f48571b4949b3af7b8e1c642ee84fe0ee26dd2457fc3bf20e9924cddb411e293b7a8a103029ee196587371a1e2 yasm-nls.patch" diff --git a/community/qt5-qtwebengine/qt-musl-dispatch_to_musl.patch b/community/qt5-qtwebengine/qt-musl-dispatch_to_musl.patch index 86e09d5cfd..1258d4f3c4 100644 --- a/community/qt5-qtwebengine/qt-musl-dispatch_to_musl.patch +++ b/community/qt5-qtwebengine/qt-musl-dispatch_to_musl.patch @@ -1,5 +1,5 @@ ---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc 2017-09-19 18:15:15.000000000 +0200 -+++ qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc 2017-10-09 19:35:11.762384809 +0200 +--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc ++++ qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc @@ -6,6 +6,7 @@ #include <malloc.h> @@ -8,8 +8,8 @@ // This translation unit defines a default dispatch for the allocator shim which // routes allocations to libc functions. // The code here is strongly inspired from tcmalloc's libc_override_glibc.h. -@@ -59,3 +60,98 @@ - &GlibcGetSizeEstimate, /* get_size_estimate_function */ +@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = { + nullptr, /* free_definite_size_function */ nullptr, /* next */ }; + @@ -37,18 +37,12 @@ +// resolve the symbols in libc.so +void musl_libc_memory_init(void) +{ -+ void* libc = dlopen("libc", RTLD_LAZY); -+ if (!libc) -+ libc = dlopen("libc.so", RTLD_LAZY); -+ if (!libc) -+ libc = dlopen("libc.so.6", RTLD_LAZY); -+ libc_malloc = (t_libc_malloc) dlsym(libc, "malloc"); -+ libc_calloc = (t_libc_calloc) dlsym(libc, "calloc"); -+ libc_realloc = (t_libc_realloc) dlsym(libc, "realloc"); -+ libc_memalign = (t_libc_memalign) dlsym(libc, "memalign"); -+ libc_free = (t_libc_free) dlsym(libc, "free"); -+ libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(libc, "malloc_usable_size"); -+ dlclose(libc); ++ libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc"); ++ libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc"); ++ libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc"); ++ libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign"); ++ libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free"); ++ libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size"); +} +} // extern "C" + diff --git a/community/qt5-qtwebengine/qtwebengine-ffmpeg4.patch b/community/qt5-qtwebengine/qtwebengine-ffmpeg4.patch new file mode 100644 index 0000000000..ffe1584d2b --- /dev/null +++ b/community/qt5-qtwebengine/qtwebengine-ffmpeg4.patch @@ -0,0 +1,89 @@ +diff --git a/src/3rdparty/chromium/media/base/decoder_buffer.h b/src/3rdparty/chromium/media/base/decoder_buffer.h +index 0341e5784f..60ffba708b 100644 +--- a/src/3rdparty/chromium/media/base/decoder_buffer.h ++++ b/src/3rdparty/chromium/media/base/decoder_buffer.h +@@ -37,7 +37,7 @@ class MEDIA_EXPORT DecoderBuffer + : public base::RefCountedThreadSafe<DecoderBuffer> { + public: + enum { +- kPaddingSize = 32, ++ kPaddingSize = 64, + #if defined(ARCH_CPU_ARM_FAMILY) + kAlignmentSize = 16 + #else +diff --git a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc +index 61d0bc341c..d79c694555 100644 +--- a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc ++++ b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc +@@ -30,10 +30,10 @@ EncryptionScheme GetEncryptionScheme(const AVStream* stream) { + + } // namespace + +-// Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are ++// Why AV_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are + // padded. Check here to ensure FFmpeg only receives data padded to its + // specifications. +-static_assert(DecoderBuffer::kPaddingSize >= FF_INPUT_BUFFER_PADDING_SIZE, ++static_assert(DecoderBuffer::kPaddingSize >= AV_INPUT_BUFFER_PADDING_SIZE, + "DecoderBuffer padding size does not fit ffmpeg requirement"); + + // Alignment requirement by FFmpeg for input and output buffers. This need to +@@ -444,11 +444,11 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, + } else { + codec_context->extradata_size = config.extra_data().size(); + codec_context->extradata = reinterpret_cast<uint8_t*>( +- av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE)); ++ av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE)); + memcpy(codec_context->extradata, &config.extra_data()[0], + config.extra_data().size()); + memset(codec_context->extradata + config.extra_data().size(), '\0', +- FF_INPUT_BUFFER_PADDING_SIZE); ++ AV_INPUT_BUFFER_PADDING_SIZE); + } + } + +@@ -585,11 +585,11 @@ void VideoDecoderConfigToAVCodecContext( + } else { + codec_context->extradata_size = config.extra_data().size(); + codec_context->extradata = reinterpret_cast<uint8_t*>( +- av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE)); ++ av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE)); + memcpy(codec_context->extradata, &config.extra_data()[0], + config.extra_data().size()); + memset(codec_context->extradata + config.extra_data().size(), '\0', +- FF_INPUT_BUFFER_PADDING_SIZE); ++ AV_INPUT_BUFFER_PADDING_SIZE); + } + } + +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc b/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc +index b4020b001d..41da2d3939 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc +@@ -368,7 +368,7 @@ void FFmpegAudioDecoder::ResetTimestampState(const AudioDecoderConfig& config) { + int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, + AVFrame* frame, + int flags) { +- DCHECK(s->codec->capabilities & CODEC_CAP_DR1); ++ DCHECK(s->codec->capabilities & AV_CODEC_CAP_DR1); + DCHECK_EQ(s->codec_type, AVMEDIA_TYPE_AUDIO); + + // Since this routine is called by FFmpeg when a buffer is required for audio +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc b/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc +index 42d044dd69..32f5c7b79d 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc +@@ -427,12 +427,11 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, + codec_context_->thread_type = + FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME); + codec_context_->opaque = this; +- codec_context_->flags |= CODEC_FLAG_EMU_EDGE; + codec_context_->get_buffer2 = GetVideoBufferImpl; + codec_context_->refcounted_frames = 1; + + if (decode_nalus_) +- codec_context_->flags2 |= CODEC_FLAG2_CHUNKS; ++ codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS; + + AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); + if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |