Using $ORIGIN as RUNPATH for runtime link
When upgrading from GPDB5 to GPDB6, gpupgrade will need to be able to call binaries from both major versions. Relying on LD_LIBRARY_PATH is not an option because this can cause binaries to load libraries from the wrong version. Instead, we need the libraries to have RPATH/RUNPATH set correctly. Since the built binaries may be relocated we need to use a relative path. This commit disables the rpath configure option (which would result in an absolute path) and use LDFLAGS to use `$ORIGIN`. For most ELF files a RUNPATH of `$ORIGIN/../lib` is correct. For pygresql python module and the quicklz_compressor extension, the RUNPATH needs to be adjusted accordingly. The LDFLAGS for those artifacts can be modified with different environment variables PYGRESQL_LDFLAGS and QUICKLZ_LDFLAGS. We always use `--enable-new-dtags` to set RUNPATH. On CentOS 6, with new dtags, both DT_RPATH and DT_RUNPATH are set and DT_RPATH will be ignored. [#171588878] Co-authored-by: NBradford D. Boyle <bboyle@pivotal.io> Co-authored-by: NXin Zhang <xzhang@pivotal.io> (cherry picked from commit 2eec06b39abe8cb5370e949056f26997b9d02572)
Showing
想要评论请 注册 或 登录