From 9e36299d14f8f9d872d6def7e8af76591ad39fee Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Tue, 15 Feb 2022 12:27:09 -0600 Subject: [PATCH] Workaround Missing SONAME in Libraries https://github.com/DOCGroup/ACE_TAO/issues/1790 --- .github/workflows/build_and_test.yml | 44 +++++++++++++++++++++++++--- docs/cmake.md | 10 +++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d80d16b0c19..92981687029 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1309,7 +1309,16 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --compiler=clang++-5.0 --no-inline --features=uses_wchar=1 --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure \ + --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE \ + --mpc=$GITHUB_WORKSPACE/MPC \ + --compiler=clang++-5.0 \ + --std=c++11 \ + --no-inline \ + --features=uses_wchar=1 \ + --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) + --tests \ + --security - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -1376,7 +1385,17 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --compiler=clang++-5.0 --no-inline --features=uses_wchar=1 --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --rapidjson --mpc=$GITHUB_WORKSPACE/MPC + ./configure \ + --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE \ + --mpc=$GITHUB_WORKSPACE/MPC \ + --compiler=clang++-5.0 \ + --std=c++11 \ + --no-inline \ + --features=uses_wchar=1 \ + --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) + --tests \ + --security \ + --rapidjson - name: check build configuration shell: bash run: | @@ -1562,7 +1581,15 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --compiler=clang++-10 --std=c++11 --tests --security --no-rapidjson --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure \ + --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE \ + --mpc=$GITHUB_WORKSPACE/MPC \ + --compiler=clang++-10 \ + --std=c++11 \ + --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ + --tests \ + --security \ + --no-rapidjson - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -1629,7 +1656,16 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --compiler=clang++-10 --std=c++11 --tests --security --no-rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --mpcopts="-features no_opendds_testing_features=0" + ./configure \ + --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE \ + --mpc=$GITHUB_WORKSPACE/MPC \ + --compiler=clang++-10 \ + --std=c++11 \ + --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ + --tests \ + --security \ + --no-rapidjson \ + --mpcopts="-features no_opendds_testing_features=0" - name: check build configuration shell: bash run: | diff --git a/docs/cmake.md b/docs/cmake.md index 78094e15c40..216f50fd35c 100644 --- a/docs/cmake.md +++ b/docs/cmake.md @@ -484,6 +484,16 @@ OpenDDS, ACE, and TAO in CMake along side the application using This will just install shared libraries, not any development dependencies like `opendds_idl` or static libraries. +If OpenDDS and ACE/TAO is built with `clang`, the shared libraries might be +missing an `SONAME` entry. Is is +[an issue with ACE/TAO](https://github.com/DOCGroup/ACE_TAO/issues/1790). +If trying to use `install(IMPORTED_RUNTIME_ARTIFACTS)` in this case, it causes +the dynamic linker to ignore the libraries and report that they could not be +found. One workaround is to add `SOFLAGS+=-Wl,-h,$(SONAME)` to +`$ACE_ROOT/include/makeinclude/platform_macros.GNU` before building. This can +be done mannually after running the configure script or by passing +`--macros=SOFLAGS+=-Wl,-h,\$\(SONAME\)` to the configure script. + A function called `opendds_get_library_dependencies` is provided to help find out what libraries need to be installed: