Move dbus_to_terminus_effecter code to platform-mc
In the current state , pldm build breaks when attempting to perform
a debug-optimized build (`-O2` optimization), leading to the following
linker error:
```
undefined reference to `pldm::platform_mc::TerminusManager::getActiveEidByName
(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
```
This issue is not encountered in the CI environment, as CI uses the
`-Og` optimization flag, which does not aggressively inline functions.
Consequently, the reference to `getActiveEidByName()` is resolved
without issue. However, when building the project with default
optimizations (debugoptimized [-O2]), the build fails because the
linker cannot resolve the reference to `getActiveEidByName()`, which is
inlined by the compiler.
To address this problem, there are three potential solutions:
1. Prevent Inlining of the Function:
We could use `__attribute__((noinline))` to prevent the compiler
from inlining `getActiveEidByName()`.
2. Move Source Files into `libpldmresponder`:
We could move the `platform-mc/manager.cpp` and
`platform-mc/terminus_manager.cpp` files into the `libpldmresponder`
so the compiler can resolve the reference directly within the
library.
3. Migrate `dbus_to_terminus_effecter.cpp` to the `platform-mc` folder:
The most appropriate solution appears to be migrating the
`dbus_to_terminus_effecter.cpp` file into the `platform-mc` directory.
This file is not inherently tied to `libpldmresponder` but functions as
a requester. Additionally, there are existing community patches that
allow the system to scale from a single host terminus to multiple
terminii, further justifying this move. So, solution #3 is the most
fitting at this stage. By relocating the `dbus_to_terminus_effecter`
code to the `platform-mc` folder, we can ensure proper modularity,
while also resolving the build issue in a clean and scalable manner.
Tested By:
1. meson build -Doptimization=2 works fine with the patchset.
Change-Id: I0ac8be58253bfb0394500f1d34e8431c6103c924
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/.linter-ignore b/.linter-ignore
index 5792d57..bcb64e6 100644
--- a/.linter-ignore
+++ b/.linter-ignore
@@ -1,4 +1,4 @@
-host-bmc/test/host_effecter_jsons/malformed/dbus_to_terminus_effecter.json
-host-bmc/test/host_effecter_jsons/no_json/dummy.json
+platform-mc/test/host_effecter_jsons/malformed/dbus_to_terminus_effecter.json
+platform-mc/test/host_effecter_jsons/no_json/dummy.json
libpldmresponder/test/pdr_jsons/state_effecter/malformed/effecter_pdr.json
libpldmresponder/test/pdr_jsons/state_sensor/malformed/sensor_pdr.json