xref: /aosp_15_r20/external/zlib/patches/README (revision 86ee64e75fa5f8bce2c8c356138035642429cd05)
1*86ee64e7SAndroid Build Coastguard Worker== Patches applied on top of zlib ==
2*86ee64e7SAndroid Build Coastguard Worker
3*86ee64e7SAndroid Build Coastguard Worker - 0000-build.patch: changes from the upstream version, mostly related to the
4*86ee64e7SAndroid Build Coastguard Worker   build.
5*86ee64e7SAndroid Build Coastguard Worker - 0001-simd.patch: integrate Intel SIMD optimizations from
6*86ee64e7SAndroid Build Coastguard Worker   https://github.com/jtkukunas/zlib/
7*86ee64e7SAndroid Build Coastguard Worker - 0002-uninitializedcheck.patch: prevent uninitialized use of state->check
8*86ee64e7SAndroid Build Coastguard Worker
9*86ee64e7SAndroid Build Coastguard Worker== Procedure to create a patch file ==
10*86ee64e7SAndroid Build Coastguard Worker
11*86ee64e7SAndroid Build Coastguard Worker  Assuming you are working in a new feature branch:
12*86ee64e7SAndroid Build Coastguard Worker - git format-patch master --stdout > foo.patch # where naming follows a growing
13*86ee64e7SAndroid Build Coastguard Worker                                                # number plus patch description.
14*86ee64e7SAndroid Build Coastguard Worker - git add foo.patch
15*86ee64e7SAndroid Build Coastguard Worker - git commit -a -m "Local patch."
16*86ee64e7SAndroid Build Coastguard Worker - git rebase -i HEAD~2 # Squashing the second commit
17*86ee64e7SAndroid Build Coastguard Worker
18*86ee64e7SAndroid Build Coastguard Worker  As patches created in this way will feature a ChangeLog, there is no longer
19*86ee64e7SAndroid Build Coastguard Workerthe need to append this file with a description of what the patch does. This
20*86ee64e7SAndroid Build Coastguard Workershould help to solve frequent conflicts in pending new patches on
21*86ee64e7SAndroid Build Coastguard WorkerChromium's zlib.
22*86ee64e7SAndroid Build Coastguard Worker
23*86ee64e7SAndroid Build Coastguard Worker  The plan for the near future is to better insulate the platform specific
24*86ee64e7SAndroid Build Coastguard Workerchanges to ease update adoption with new releases of zlib. This insulation
25*86ee64e7SAndroid Build Coastguard Workerhappens by making changes inside contrib/ rather than the root directory
26*86ee64e7SAndroid Build Coastguard Worker(where conflicts can happen).
27*86ee64e7SAndroid Build Coastguard Worker
28*86ee64e7SAndroid Build Coastguard Worker  If a change modifies enough things inside the root directory that the
29*86ee64e7SAndroid Build Coastguard Workerintention is not immediately clear, generate a .patch file to go with your
30*86ee64e7SAndroid Build Coastguard Workerchange. If the change's modifications in the root directory are small, like:
31*86ee64e7SAndroid Build Coastguard Worker
32*86ee64e7SAndroid Build Coastguard Worker#ifdef FEATURE_FLAG
33*86ee64e7SAndroid Build Coastguard Workeruse_special_feature();
34*86ee64e7SAndroid Build Coastguard Worker#elif
35*86ee64e7SAndroid Build Coastguard Workeruse_default_behavior();
36*86ee64e7SAndroid Build Coastguard Worker#endif
37*86ee64e7SAndroid Build Coastguard Worker
38*86ee64e7SAndroid Build Coastguard Worker  then the intent is clear and a .patch file doesn't need to be generated (since
39*86ee64e7SAndroid Build Coastguard Workerit would not provide much value).
40*86ee64e7SAndroid Build Coastguard Worker
41*86ee64e7SAndroid Build Coastguard Worker  Ideally local changes should have a merge request featured in either:
42*86ee64e7SAndroid Build Coastguard Worker - canonical zlib: https://github.com/madler/zlib/
43*86ee64e7SAndroid Build Coastguard Worker - zlib-ng: https://github.com/Dead2/zlib-ng
44