From 4e9ae2d45af76091a59490e0f55abd8538208ba5 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Sun, 7 Jul 2024 15:58:02 +0800 Subject: [PATCH] ltp: fix the link error raised by "proc.h" inclusion error the link error are: arm-none-eabi-ld: /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/staging/libapps.a(1-4.c.home.guoshichao.work_profile.vela_os.vela_ltp_1.apps.testing.ltp_3.o): in function `tst_process_state_wait3': /home/guoshichao/work_profile/vela_os/vela_ltp_1/apps/testing/ltp/ltp/testcases/open_posix_testsuite/include/proc.h:63: multiple definition of `tst_process_state_wait3'; /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/staging/libapps.a(1-3.c.home.guoshichao.work_profile.vela_os.vela_ltp_1.apps.testing.ltp_3.o):/home/guoshichao/work_profile/vela_os/vela_ltp_1/apps/testing/ltp/ltp/testcases/open_posix_testsuite/include/proc.h:63: first defined here Signed-off-by: guoshichao --- ...oc.h-header-file-duplicate-inclusion.patch | 37 +++++++++++++++++++ testing/ltp/Makefile | 1 + 2 files changed, 38 insertions(+) create mode 100644 testing/ltp/0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch diff --git a/testing/ltp/0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch b/testing/ltp/0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch new file mode 100644 index 000000000..910150dac --- /dev/null +++ b/testing/ltp/0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch @@ -0,0 +1,37 @@ +From 6d38a0543d57f80954f9b2c2ec1f4a4c33b30894 Mon Sep 17 00:00:00 2001 +From: guoshichao +Date: Mon, 8 Jul 2024 16:38:22 +0800 +Subject: [PATCH] ltp: fix the "tst_process_state_wait3" multi define error + +VELAPLATFO-34850 + +fix the link error by making the "tst_process_state_wait3" to "static +inline" function + +Signed-off-by: guoshichao + +diff --git a/testcases/open_posix_testsuite/include/proc.h b/testcases/open_posix_testsuite/include/proc.h +index befb837..5d1d676 100644 +--- a/testcases/open_posix_testsuite/include/proc.h ++++ b/testcases/open_posix_testsuite/include/proc.h +@@ -19,7 +19,7 @@ + # include + # include + +-int tst_process_state_wait3(pid_t pid, const char state, ++static inline int tst_process_state_wait3(pid_t pid, const char state, + long maxwait_s) + { + char proc_path[128], cur_state; +@@ -58,7 +58,7 @@ int tst_process_state_wait3(pid_t pid, const char state, + return 1; + } + #else +-int tst_process_state_wait3(pid_t pid PTS_ATTRIBUTE_UNUSED, ++static inline int tst_process_state_wait3(pid_t pid PTS_ATTRIBUTE_UNUSED, + const char state PTS_ATTRIBUTE_UNUSED, long maxwait_s) + { + struct timespec maxwait_ts; +-- +2.45.1 + diff --git a/testing/ltp/Makefile b/testing/ltp/Makefile index 0cdf50c27..979ff770a 100644 --- a/testing/ltp/Makefile +++ b/testing/ltp/Makefile @@ -256,6 +256,7 @@ $(LTP_UNPACK): ltp-$(LTPS_VERSION).zip $(Q) patch -d $(LTP_UNPACK) -p1 < 0008-test-ltp-fix-ltp_interfaces_sigaction_23_10-deadloop.patch $(Q) patch -d $(LTP_UNPACK) -p1 < 0009-ltp-modify-user-code-for-fdcheck-compatibility.patch $(Q) patch -d $(LTP_UNPACK) -p1 < 0010-ltp-fix-build-warning.patch + $(Q) patch -d $(LTP_UNPACK) -p1 < 0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch # Download and unpack tarball if no git repo found ifeq ($(wildcard $(LTP_UNPACK)/.git),)