HOWTO_MERGE revision 1.4 1 1.1 mrg In general, merging process should not be very difficult, but we need to
2 1.1 mrg track various ABI changes and GCC-specific patches carefully. Here is a
3 1.1 mrg general list of actions required to perform the merge:
4 1.1 mrg
5 1.1 mrg * Checkout recent GCC tree.
6 1.4 mrg * Run merge.sh script from libsanitizer directory. The script accepts one
7 1.4 mrg argument that is control version system (svn or git).
8 1.1 mrg * Modify Makefile.am files into asan/tsan/lsan/ubsan/sanitizer_common/interception
9 1.1 mrg directories if needed. In particular, you may need to add new source files
10 1.1 mrg and remove old ones in source files list, add new flags to {C, CXX}FLAGS if
11 1.1 mrg needed and update DEFS with new defined variables. You can find these changes
12 1.1 mrg in corresponding CMakeLists.txt and config-ix.cmake files from compiler-rt source
13 1.1 mrg directory.
14 1.1 mrg * Apply all needed GCC-specific patches to libsanitizer (note that some of
15 1.3 mrg them might be already included to upstream). The list of these patches is stored
16 1.3 mrg into LOCAL_PATCHES file.
17 1.1 mrg * Apply all necessary compiler changes. Be especially careful here, you must
18 1.1 mrg not break ABI between compiler and library. You can reveal these changes by
19 1.1 mrg inspecting the history of AddressSanitizer.cpp and ThreadSanitizer.cpp files
20 1.1 mrg from LLVM source tree.
21 1.1 mrg * Update ASan testsuite with corresponding tests from lib/asan/tests directory.
22 1.1 mrg Not all tests can be migrated easily, so you don't need them all to be adapted.
23 1.1 mrg * Modify configure.ac file if needed (e.g. if you need to add link against new
24 1.4 mrg library for sanitizer libs).
25 1.1 mrg * Add new target platforms in configure.tgt script if needed.
26 1.1 mrg * Bump SONAME for sanitizer libraries in asan/tsan/ubsan libtool-version files
27 1.1 mrg if ABI has changed.
28 1.1 mrg * Regenerate configure script and all Makefiles by autoreconf. You should use
29 1.1 mrg exactly the same autoconf and automake versions as for other GCC directories (current
30 1.1 mrg versions are written in Makefile.in and configure files).
31 1.1 mrg * Run regression testing on at least three platforms (e.g. x86-linux-gnu, x86_64-linux-gnu,
32 1.1 mrg aarch64-linux-gnu, arm-linux-gnueabi).
33 1.1 mrg * Run {A, UB}San bootstrap on at least three platforms.
34 1.4 mrg * Compare ABI of corresponding libclang_rt.asan and newly build libasan libraries.
35 1.4 mrg Similarly you can compare latest GCC release with the newly built libraries
36 1.4 mrg (libasan.so.*, libubsan.so.*, libtsan.so*).
37 1.1 mrg You can use a pretty good libabigail tool (https://sourceware.org/libabigail/index.html)
38 1.1 mrg to perform such a comparision. Note, that the list of exported symbols may differ,
39 1.1 mrg e.g. because libasan currently does not include UBSan runtime.
40 1.1 mrg * Split your changes into logical parts (e.g. raw merge, compiler changes, GCC-specific changes
41 1.1 mrg in libasan, configure/Makefile changes). The review process has O(N^2) complexity, so you
42 1.1 mrg would simplify and probably speed up the review process by doing this.
43 1.1 mrg * Send your patches for review to GCC Patches Mailing List (gcc-patches (a] gcc.gnu.org).
44 1.3 mrg * Update LOCAL_PATCHES file when you've committed the whole patch set with new revisions numbers.
45