diff options
author | Yogesh Tyagi <yogesh.tyagi@intel.com> | 2025-09-12 10:48:16 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2025-10-01 18:01:36 +0800 |
commit | 2740652fdb5f85d593e43a7dfea7af8c513aee93 (patch) | |
tree | 05eae0fe5c3459a10c77edaba57c24598aebc8a6 | |
parent | f7ba543caa2dd553cc98569799935a812f910c8b (diff) | |
download | meta-intel-master.tar.gz |
- `-pie` is only valid when linking executables (PIE), not shared
libraries. So remove `-pie` from shared libraries linker flag.
Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2 files changed, 40 insertions, 0 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-fix-build-failure-by-removing-pie-from-sh.patch b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-fix-build-failure-by-removing-pie-from-sh.patch new file mode 100644 index 00000000..3545cd5e --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-fix-build-failure-by-removing-pie-from-sh.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 5b8b59a18f4a54ba912faad861f0af3fdcf127c6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
3 | Date: Wed, 10 Sep 2025 21:15:53 +0800 | ||
4 | Subject: [PATCH] CMakeLists: fix build failure by removing -pie from shared | ||
5 | library targets | ||
6 | |||
7 | With CMake 4.1.0 the build of libipmctl started failing with: | ||
8 | |||
9 | error: undefined reference to `main` in *.S | ||
10 | |||
11 | - `-pie` is only valid when linking executables (PIE), not shared | ||
12 | libraries. | ||
13 | - When applied to a shared library, the linker expects a `main` | ||
14 | symbol, causing the undefined reference error. | ||
15 | - Remove `-pie` from shared libraries linker flag | ||
16 | |||
17 | Upstream-Status: Submitted [https://github.com/intel/ipmctl/pull/221] | ||
18 | |||
19 | Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
20 | --- | ||
21 | CMakeLists.txt | 2 +- | ||
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
25 | index 1c07e682..d7aab78f 100644 | ||
26 | --- a/CMakeLists.txt | ||
27 | +++ b/CMakeLists.txt | ||
28 | @@ -156,7 +156,7 @@ endif() | ||
29 | if(UNIX) | ||
30 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_MSABI_VA_FUNCS -std=c99 -Wformat -Wformat-security -D_XOPEN_SOURCE=500 -Wall -Wfatal-errors -MMD -fPIC -fno-strict-aliasing") | ||
31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wformat -Wformat-security -D_XOPEN_SOURCE=500 -Drestrict=__restrict__ -Wall -Wfatal-errors -MMD -fPIC -fno-strict-aliasing") | ||
32 | - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack -z relro -z now -pie") | ||
33 | + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack -z relro -z now") | ||
34 | elseif(MSVC) | ||
35 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /GS /DynamicBase /sdl") | ||
36 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS /DynamicBase /sdl") | ||
37 | -- | ||
38 | 2.37.3 | ||
39 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0499.bb b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0499.bb index eec0f8b5..a0877071 100644 --- a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0499.bb +++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0499.bb | |||
@@ -19,6 +19,7 @@ SRC_URI = "git://github.com/intel/ipmctl.git;protocol=https;branch=master_3_0;na | |||
19 | git://github.com/tianocore/edk2.git;protocol=https;name=edk2;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/edk2;branch=master \ | 19 | git://github.com/tianocore/edk2.git;protocol=https;name=edk2;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/edk2;branch=master \ |
20 | file://0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch;patchdir=edk2 \ | 20 | file://0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch;patchdir=edk2 \ |
21 | file://0001-CMakeLists-disable-Werror.patch \ | 21 | file://0001-CMakeLists-disable-Werror.patch \ |
22 | file://0001-CMakeLists-fix-build-failure-by-removing-pie-from-sh.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | SRCREV_ipmctl = "a71f2fb1c90dd07f9862b71c789881132193e8f9" | 25 | SRCREV_ipmctl = "a71f2fb1c90dd07f9862b71c789881132193e8f9" |