implement origin RPATHs for bazel

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Build
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      bazel creates shared libraries that link to a library in the build dir, but we need to use rpaths to make these libraries relocatable.

       

      for example:
      ldd bazel-out/aarch64-fastbuild/bin/src/mongo/platform/visibility_test1
      linux-vdso.so.1 (0x0000ffff80b32000)
      libsrc_Smongo_Splatform_Slibvisibility_Utest_Ulib1_Uwith_Udebug.so => /home/ubuntu/mongo/bazel-out/aarch64-fastbuild/bin/src/mongo/platform/../../../_solib_arm64/libsrc_Smongo_Splatform_Slibvisibility_Utest_Ulib1_Uwith_Udebug.so (0x0000ffff80ab0000)
      libsrc_Smongo_Splatform_Slibvisibility_Utest_Ulibcommon_Uwith_Udebug.so => /home/ubuntu/mongo/bazel-out/aarch64-fastbuild/bin/src/mongo/platform/../../../_solib_arm64/libsrc_Smongo_Splatform_Slibvisibility_Utest_Ulibcommon_Uwith_Udebug.so (0x0000ffff80a90000)
      libsrc_Sthird_Uparty_Sgperftools_Slibtcmalloc_Uminimal_Uwith_Udebug.so => /home/ubuntu/mongo/bazel-out/aarch64-fastbuild/bin/src/mongo/platform/../../../_solib_arm64/libsrc_Sthird_Uparty_Sgperftools_Slibtcmalloc_Uminimal_Uwith_Udebug.so (0x0000ffff80730000)
      libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff80680000)
      libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff80650000)
      libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff804a0000)
      /lib/ld-linux-aarch64.so.1 (0x0000ffff80af9000)
      SCons still will do the install portion and correctly move the bazel libraries out of bazel build dir and to the install/build location and archive will grab all the files correctly, however because the example paths above are recorded into the library, the libraries will not be able to be loaded when the archive is extracted on some other system. So we need to implement $ORIGIN RPATHs before phase 1 is complete

            Assignee:
            Daniel Moody
            Reporter:
            Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: