skia编译笔记

步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cd %~dp0

set path=D:\depot_tools\depot_tools\python276_bin;%path%

set https_proxy = http://127.0.0.1:7078

python tools/git-sync-deps


REM tools/install_dependencies.sh

REM gn gen out/windows_x86_debug

REM ninja -C out/windows_x86_debug

REM gn gen out/windows_x86_release

REM ninja -C out/windows_x86_release

pdfium编译笔记

cmd

1
2
3
4
5
6
7
8
9
10
11
set DEPOT_TOOLS_UPDATE = 0

//
set http_proxy=127.0.0.1:1080
set https_proxy=127.0.0.1:1080
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2019

gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
gclient sync
gn args

参数设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

# 是否启用 goma 支持

use_goma = false
# 是否编译为 Chrome 插件

clang_use_chrome_plugins = false

# 是否进行编译测试
pdf_is_standalone = true


# 是否启用 skia 支持
pdf_use_skia = false
pdf_use_skia_paths = false

# true 编译为 debug 版本,false 编译为 release 版本
is_debug = false

# true 编译为动态库,false 编译为静态库
is_component_build = false

# 编译为一个独立的静态库(is_component_build 必须为 false)
# pdf_is_complete_lib 为 false 时, 编译为多个静态库,true 编译为一个独立的静态库
pdf_is_complete_lib = false

# xfa 支持
pdf_enable_xfa = false

# v8 支持;启用 v8 后,编译时间会增加
pdf_enable_v8 = true

# cpu 架构;x86、x64 可选
target_cpu = "x86"

# true 将用 clang 进行编译,false 将用 VS2017 编译
is_clang = false

chromium相关

  1. 重排函数在pe中的顺序 微软的Vulcan 谷歌的syzygy

谷歌的syzygy

  • 使用编译器提供的/profile接口,在生成的pe文件中插入指令hook住函数。
  • 通过ETW(Event Tracing for Windows)机制获得目标程序的函数性能数据。
  • 根据函数性能数据生成了重排布策略,调用编译器接口去重排布pe文件,调用的DIA(Debug Interface Access)接口去修改pdb文件

windows-classic-demos 梳理

工程

1.AmbientLightAware 光亮感应器 平板设备等根据环境调整应用程序

2.AmsiProvider AmsiStream 杀软接口

3.AppxPacking 打包相关

4.Background Intelligent Transfer Service 后台智能传输服务后台下载 xp支持 没看到什么应用使用Bits.h 但是确实能用,可以在应用程序退出后空闲时间继续下载(依赖服务Background Intelligent Transfer Service)Windows.Networking.BackgroundTransfer UWP开发使用

5.

MD打包需要dll详解

MD编译的程序需要带哪些dll呢?

个人理解总结

我们以vs2015编译的程序为例

  1. msvcp140.dll 可进一步拆分为ucrtbase.dll + vcruntime.dll

  2. msvcr140.dll 一般是指运行时库

  3. ucrtbase.dll c和cpp函数集合

  4. vcruntime.dll vc++的运行时

  5. windows api set 系列的dll 如 api—ms-,ext—.dll 一般不需要直接打包到进去,每个系统的版本号可能不一致,且该系列dll不是直接干活的而是转发调用系统核心

  6. 当缺少以上任意dll时,用户不应该手动去第三方网站下载,程序员应该提供所需的dll打包到目录,用户可以去微软下载安装对应版本的vcredist2015_x86.exe vcredist2015_x64.exe

vcredist

当安装成功vcredist 检测c盘 windows/system32目录下会多出以下文件

  • msvcp140.dll
  • concrt140.dll
  • mfc140.dll 系列
  • msvcp140.dll
  • vcamp140.dll
  • vccorlib140.dll
  • vcomp140.dll
  • vcruntime140.dll

ffmpeg认识与编译(1)

编译

源码包 F:\GitHub\ffmpeg-4.2.3编译

看了几个编译脚本都依赖了msys2
https://github.com/microsoft/FFmpegInterop //Interop 交互

msys2

模拟linux环境的工具可替代msys,MinGW,Cygwin 下载地址https://www.msys2.org/

ps: 这玩意居然91.3MB WHAT IS THIS?

https://trac.ffmpeg.org/wiki/CompilationGuide
https://www.ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows

  1. 在C:\msys64\msys2_shell.cmd 运行
1
2
3
#过程较慢 更新很多组件
pacman -Syu
pacman -S make pkgconf diffutils yasm

编译问题

  1. cl.exe 不识别 应该是没有 set MSYS2_PATH_TYPE=inherit
  2. make: 未找到命令

压缩算法总结

压缩算法总结

经常记不住性能特点,数据来源https://linuxreviews.org/Comparison_of_Compression_Algorithms

algorithm time size binary parameters info
algorithm time size binary parameters info
none 0m0.934s 939M just tar cf tar itself is an archiving tool, you do not need to compress the archives
gzip 0m23.502s 177M gzip cfz
gzip 0m3.132s 177M pigz c -Ipigz -f pigz 2.4
bzip2 1m0.798s 134M bzip2 cfj Standard bzip2 will only use one core (at 100%)
bzip2 0m9.091s 135M pbzip2 c -Ipbzip2 -f Parallel bzip2. RAM usage topped out at about 900 MiB RAM.
lz4 0m3.914s 287M lz4 c -I”lz4” -f Really fast but the resulting archive is barely compressed. Worst compression king.
lz4 0m56.506s 207M lz4 c -I”lz4 -12” -f Supports levels -[1-12].Uses 1 core, does not appear to be any multi-threaded variant(?)
lzip 4m42.017s 116M lzip c –lzip -f v1.21. Standard lzip will only use one core (at 100%). Very slow.
lzip 0m42.542s 118M plzip c -Iplzip -f plzip 1.8 (Parallel lzip), default level -6
lzip 1m39.697s 110M plzip c -I”plzip -9” -f Parallel lzip at best compression -9. plzip process used 5.1 GiB RAM at its maximum.
xz 5m2.952s 114M xz cfJ Standard xz will only use one core (at 100%). Unbearably slow.
xz 0m53.569s 115M pxz c -Ipxz -f Parallel PXZ 4.999.9beta. Process used 1.4 GiB RAM at its maximum.
xz 1m33.441s 110M pxz c -I”pxz -9” -f Parallel PXZ 4.999.9beta using its best possible compression. pxz process topped out at 3.5 GiB resident.
zstd 0m3.034s 167M zstd c –zstd -f zstd uses 1 core if it is no told otherwise with -T# where # is a thread number and 0 means all cores (not all threads)
zstd 1m18.238s 117M zstd c -I”zstd -19 -T0” -f -19 gives the best possible compression, -T0 utilizes all cores.

PK

压缩体积
压缩
解压缩

Qt源码编译(windows环境)

步骤

  1. 下载Qt源码,直接下载代码压缩包,通过git下载代码太慢
  2. 在vs cmd控制台中 进入源码根目录 configure -prefix E:\QtSource\build -release -opensource -static -force-debug-info -opengl dynamic -platform win32-msvc -c++std c++11 -skip qtmultimedia -skip qtsensors -skip qtwebengine -skip qtgamepad -nomake examples -nomake tests -mp -skip qtlocation -skip qtserialbus -confirm-license
    https://doc.qt.io/qt-5/configure-options.html configure 选项
    使用 configure.bat -h 查看

configure -prefix D:\QtSource\build -debug-and-release -opensource -static -force-debug-info -opengl dynamic -platform win32-msvc -c++std c++11 -skip qtmultimedia -skip qtsensors -skip qtwebengine -skip qtgamepad -nomake tests -mp -skip qtlocation -skip qtserialbus -confirm-license

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
Configure meta:

-help, -h ............ Display this help screen
-verbose, -v ......... Print verbose messages during configuration
-continue ............ Continue configure despite errors
-redo ................ Re-configure with previously used options.
Additional options may be passed, but will not be
saved for later use by -redo.
-recheck [test,...] .. Discard cached negative configure test results.
Use this after installing missing dependencies.
Alternatively, if tests are specified, only their
results are discarded.
-recheck-all ......... Discard all cached configure test results.

-feature-<feature> ... Enable <feature>
-no-feature-<feature> Disable <feature> [none]
-list-features ....... List available features. Note that some features
have dedicated command line options as well.

-list-libraries ...... List possible external dependencies.

Build options:

-opensource .......... Build the Open-Source Edition of Qt
-commercial .......... Build the Commercial Edition of Qt
-confirm-license ..... Automatically acknowledge the license

-release ............. Build Qt with debugging turned off [yes]
-debug ............... Build Qt with debugging turned on [no]
-debug-and-release ... Build two versions of Qt, with and without
debugging turned on [yes] (Apple and Windows only)
-optimize-debug ...... Enable debug-friendly optimizations in debug builds
[auto] (Not supported with MSVC or Clang toolchains)
-optimize-size ....... Optimize release builds for size instead of speed [no]
-optimized-tools ..... Build optimized host tools even in debug build [no]
-force-debug-info .... Create symbol files for release builds [no]
-separate-debug-info . Split off debug information to separate files [no]
-gdb-index ........... Index the debug info to speed up GDB
[no; auto if -developer-build with debug info]
-strip ............... Strip release binaries of unneeded symbols [yes]
-gc-binaries ......... Place each function or data item into its own section
and enable linker garbage collection of unused
sections. [auto for static builds, otherwise no]
-force-asserts ....... Enable Q_ASSERT even in release builds [no]
-developer-build ..... Compile and link Qt for developing Qt itself
(exports for auto-tests, extra checks, etc.) [no]

-shared .............. Build shared Qt libraries [yes] (no for UIKit)
-static .............. Build static Qt libraries [no] (yes for UIKit)
-framework ........... Build Qt framework bundles [yes] (Apple only)

-platform <target> ... Select host mkspec [detected]
-xplatform <target> .. Select target mkspec when cross-compiling [PLATFORM]
-device <name> ....... Cross-compile for device <name>
-device-option <key=value> ... Add option for the device mkspec

-appstore-compliant .. Disable code that is not allowed in platform app stores.
This is on by default for platforms which require distribution
through an app store by default, in particular Android,
iOS, tvOS, watchOS, and Universal Windows Platform. [auto]

-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
-qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
-qtlibinfix-plugins .. Rename Qt plugins according to -qtlibinfix [no]

-testcocoon .......... Instrument with the TestCocoon code coverage tool [no]
-gcov ................ Instrument with the GCov code coverage tool [no]

-trace [backend] ..... Enable instrumentation with tracepoints.
Currently supported backends are 'etw' (Windows) and
'lttng' (Linux), or 'yes' for auto-detection. [no]

-sanitize {address|thread|memory|undefined}
Instrument with the specified compiler sanitizer.
Note that some sanitizers cannot be combined;
for example, -sanitize address cannot be combined with
-sanitize thread.

-coverage {trace-pc-guard}
Add code coverage instrumentation (Clang only)

-c++std <edition> .... Select C++ standard <edition> [c++2a/c++17/c++14/c++11]
(Not supported with MSVC 2015)

-sse2 ................ Use SSE2 instructions [auto]
-sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
Enable use of particular x86 instructions [auto]
Enabled ones are still subject to runtime detection.
-mips_dsp/-mips_dspr2 Use MIPS DSP/rev2 instructions [auto]

-qreal <type> ........ typedef qreal to the specified type. [double]
Note: this affects binary compatibility.

-R <string> .......... Add an explicit runtime library path to the Qt
libraries. Supports paths relative to LIBDIR.
-rpath ............... Link Qt libraries and executables using the library
install path as a runtime library path. Similar to
-R LIBDIR. On Apple platforms, disabling this implies
using absolute install names (based in LIBDIR) for
dynamic libraries and frameworks. [auto]

-reduce-exports ...... Reduce amount of exported symbols [auto]
-reduce-relocations .. Reduce amount of relocations [auto] (Unix only)

-plugin-manifests .... Embed manifests into plugins [no] (Windows only)
-static-runtime ...... With -static, use static runtime [no] (Windows only)

-pch ................. Use precompiled headers [auto]
-ltcg ................ Use Link Time Code Generation [no]
-linker [bfd,gold,lld] Force use of the GNU ld, GNU gold or LLVM/LLD linker
instead of default one (GCC only)
-incredibuild-xge .... Use the IncrediBuild XGE [no] (Windows only)
-ccache .............. Use the ccache compiler cache [no] (Unix only)
-make-tool <tool> .... Use <tool> to build qmake [nmake] (Windows only)
-mp .................. Use multiple processors for compilation (MSVC only)

-warnings-are-errors . Treat warnings as errors [no; yes if -developer-build]
-silent .............. Reduce the build output so that warnings and errors
can be seen more easily

Build environment:

-sysroot <dir> ....... Set <dir> as the target sysroot
-gcc-sysroot ......... With -sysroot, pass --sysroot to the compiler [yes]

-pkg-config .......... Use pkg-config [auto] (Unix only)

-D <string> .......... Pass additional preprocessor define
-I <string> .......... Pass additional include path
-L <string> .......... Pass additional library path
-F <string> .......... Pass additional framework path (Apple only)

-sdk <sdk> ........... Build Qt using Apple provided SDK <sdk>. The argument
should be one of the available SDKs as listed by
'xcodebuild -showsdks'.
Note that the argument applies only to Qt libraries
and applications built using the target mkspec - not
host tools such as qmake, moc, rcc, etc.

-android-sdk path .... Set Android SDK root path [$ANDROID_SDK_ROOT]
-android-ndk path .... Set Android NDK root path [$ANDROID_NDK_ROOT]
-android-ndk-platform Set Android platform
-android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
[$ANDROID_NDK_HOST]
-android-abis ....... Comma separated Android abis, default is:
armeabi-v7a,arm64-v8a,x86,x86_64
-android-style-assets Automatically extract style assets from the device at
run time. This option makes the Android style behave
correctly, but also makes the Android platform plugin
incompatible with the LGPL2.1. [yes]

Component selection:

-skip <repo> ......... Exclude an entire repository from the build.
-make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first.
[libs and examples, also tools if not cross-building,
also tests if -developer-build]
-nomake <part> ....... Exclude <part> from the list of parts to be built.
-compile-examples .... When unset, install only the sources of examples
[no on WebAssembly, otherwise yes]
-gui ................. Build the Qt GUI module and dependencies [yes]
-widgets ............. Build the Qt Widgets module and dependencies [yes]
-no-dbus ............. Do not build the Qt D-Bus module
[default on Android and Windows]
-dbus-linked ......... Build Qt D-Bus and link to libdbus-1 [auto]
-dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
-accessibility ....... Enable accessibility support [yes]
Note: Disabling accessibility is not recommended.

Qt comes with bundled copies of some 3rd party libraries. These are used
by default if auto-detection of the respective system library fails.

Core options:

-doubleconversion .... Select used double conversion library [system/qt/no]
No implies use of sscanf_l and snprintf_l (imprecise).
-glib ................ Enable Glib support [no; auto on Unix]
-eventfd ............. Enable eventfd support
-inotify ............. Enable inotify support
-iconv ............... Enable iconv(3) support [posix/sun/gnu/no] (Unix only)
-icu ................. Enable ICU support [auto]
-pcre ................ Select used libpcre2 [system/qt/no]
-pps ................. Enable PPS support [auto] (QNX only)
-zlib ................ Select used zlib [system/qt]

Logging backends:
-journald .......... Enable journald support [no] (Unix only)
-syslog ............ Enable syslog support [no] (Unix only)
-slog2 ............. Enable slog2 support [auto] (QNX only)

Network options:

-ssl ................. Enable either SSL support method [auto]
-no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
-openssl-linked ...... Use OpenSSL and link to libssl [no]
-openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]
-schannel ............ Use Secure Channel [no] (Windows only)
-securetransport ..... Use SecureTransport [auto] (Apple only)

-sctp ................ Enable SCTP support [no]

-libproxy ............ Enable use of libproxy [no]
-system-proxies ...... Use system network proxies by default [yes]

Gui, printing, widget options:

-cups ................ Enable CUPS support [auto] (Unix only)

-fontconfig .......... Enable Fontconfig support [auto] (Unix only)
-freetype ............ Select used FreeType [system/qt/no]
-harfbuzz ............ Select used HarfBuzz-NG [system/qt/no]
(Not auto-detected on Apple and Windows)

-gtk ................. Enable GTK platform theme support [auto]

-lgmon ............... Enable lgmon support [auto] (QNX only)

-no-opengl ........... Disable OpenGL support
-opengl <api> ........ Enable OpenGL support. Supported APIs:
es2 (default on Windows), desktop (default on Unix),
dynamic (Windows only)
-opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
-egl ................. Enable EGL support [auto]
-angle ............... Use bundled ANGLE to support OpenGL ES 2.0 [auto]
(Windows only)
-combined-angle-lib .. Merge LibEGL and LibGLESv2 into LibANGLE (Windows only)

-qpa <name> .......... Select default QPA backend(s) (e.g., xcb, cocoa, windows)
A prioritized list separated by semi-colons.
-xcb-xlib............. Enable Xcb-Xlib support [auto]

Platform backends:
-direct2d .......... Enable Direct2D support [auto] (Windows only)
-directfb .......... Enable DirectFB support [no] (Unix only)
-eglfs ............. Enable EGLFS support [auto; no on Android and Windows]
-gbm ............... Enable backends for GBM [auto] (Linux only)
-kms ............... Enable backends for KMS [auto] (Linux only)
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
-xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no]
(-qt-xcb still uses system version of libxcb itself)

Input backends:
-libudev............ Enable udev support [auto]
-evdev ............. Enable evdev support [auto]
-imf ............... Enable IMF support [auto] (QNX only)
-libinput .......... Enable libinput support [auto]
-mtdev ............. Enable mtdev support [auto]
-tslib ............. Enable tslib support [auto]
-xcb-xinput ........ Enable XInput2 support [auto]
-xkbcommon ......... Enable key mapping support [auto]

Image formats:
-gif ............... Enable reading support for GIF [auto]
-ico ............... Enable support for ICO [yes]
-libpng ............ Select used libpng [system/qt/no]
-libjpeg ........... Select used libjpeg [system/qt/no]

Database options:

-sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
db2 ibase mysql oci odbc psql sqlite2 sqlite tds
[all auto]
-sqlite .............. Select used sqlite3 [system/qt]

Qt3D options:

-assimp .............. Select used assimp library [system/qt/no]
-qt3d-profile-jobs ... Enable jobs profiling [no]
-qt3d-profile-gl ..... Enable OpenGL profiling [no]
-qt3d-simd ........... Select level of SIMD support [no/sse2/avx2]
-qt3d-render ......... Enable the Qt3D Render aspect [yes]
-qt3d-input .......... Enable the Qt3D Input aspect [yes]
-qt3d-logic .......... Enable the Qt3D Logic aspect [yes]
-qt3d-extras ......... Enable the Qt3D Extras aspect [yes]
-qt3d-animation....... Enable the Qt3D Animation aspect [yes]

Further image format options:

-jasper .............. Enable JPEG-2000 support using the JasPer library [no]
-mng ................. Enable MNG support [no]
-tiff ................ Enable TIFF support [system/qt/no]
-webp ................ Enable WEBP support [system/qt/no]

Multimedia options:

-pulseaudio .......... Enable PulseAudio support [auto] (Unix only)
-alsa ................ Enable ALSA support [auto] (Unix only)
-no-gstreamer ........ Disable support for GStreamer
-gstreamer [version] . Enable GStreamer support [auto]
With no parameter, 1.0 is tried first, then 0.10.
-evr ................. Enables EVR in DirectShow and WMF [auto]

QtQuick3D options:

-assimp .............. Select used assimp library [system/qt/no]

TextToSpeech options:

-flite ............... Enable Flite support [auto] (Unix only)
-flite-alsa .......... Enable Flite with ALSA support [auto] (Unix only)
-speechd ............. Enable speech dispatcher support [auto] (Unix only)

WebEngine options:

-webengine-alsa ................ Enable ALSA support [auto] (Linux only)
-webengine-pulseaudio .......... Enable PulseAudio support [auto]
(Linux only)
-webengine-embedded-build ...... Enable Linux embedded build [auto]
(Linux only)
-webengine-icu ................. Use system ICU libraries [system/qt]
(Linux only)
-webengine-ffmpeg .............. Use system FFmpeg libraries [system/qt]
(Linux only)
-webengine-opus ................ Use system Opus libraries [system/qt]
(Linux only)
-webengine-webp ................ Use system WebP libraries [system/qt]
(Linux only)
-webengine-pepper-plugins ...... Enable use of Pepper Flash and Widevine
plugins [auto]
-webengine-printing-and-pdf .... Enable use of printing and output to PDF
[auto]
-webengine-proprietary-codecs .. Enable support for proprietary codecs [no]
-webengine-spellchecker ........ Enable support for spellchecker [yes]
-webengine-native-spellchecker . Enable support for native spellchecker [no]
(macOS only)
-webengine-webrtc .............. Enable support for WebRTC [auto]

3.

  • © 2020-2021 一潭清泓
  • Powered by Hexo Theme Ayer
  • PV: UV:

请我喝杯咖啡吧~

支付宝
微信