HOWTO_MERGE 2.8 KB

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