From 8cb59a75eab69c13401d20636d8e040b698f28af Mon Sep 17 00:00:00 2001 From: guoshichao Date: Sun, 7 Jul 2024 16:04:14 +0800 Subject: [PATCH] ltp: fix the build warning the warning are: ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:163: warning: "NSIG" redefined 163 | #define NSIG (sizeof(signals)/sizeof(int)) | In file included from /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/include/pthread.h:35, from ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:31: /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/include/signal.h:53: note: this is the location of the previous definition 53 | #define NSIG _NSIG /* _NSIG variant commonly used */ Signed-off-by: guoshichao --- testing/ltp/0012-ltp-fix-build-error.patch | 32 ++++++++++++++++++++++ testing/ltp/Makefile | 1 + 2 files changed, 33 insertions(+) create mode 100644 testing/ltp/0012-ltp-fix-build-error.patch diff --git a/testing/ltp/0012-ltp-fix-build-error.patch b/testing/ltp/0012-ltp-fix-build-error.patch new file mode 100644 index 000000000..b535c0860 --- /dev/null +++ b/testing/ltp/0012-ltp-fix-build-error.patch @@ -0,0 +1,32 @@ +From 9606a31fbff78592352bcccf667ab0eb7a26ef5a Mon Sep 17 00:00:00 2001 +From: fangxinyong +Date: Tue, 29 Aug 2023 19:03:51 +0800 +Subject: [PATCH] ltp: fix build error + +VELAPLATFO-8233 + +ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:171: error: "NSIG" redefined [-Werror] + 171 | #define NSIG (sizeof(signals)/sizeof(int)) +In file included from /home/work/ssd1/workspace/MiRTOS-CI/nuttx/include/pthread.h:35, + from ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:31: +/home/work/ssd1/workspace/MiRTOS-CI/nuttx/include/signal.h:53: note: this is the location of the previous definition + 53 | #define NSIG _NSIG /* _NSIG variant commonly used */ + +Change-Id: I5a7d695612dd8f17ad735a369a9b904ee71f70ee +Signed-off-by: fangxinyong + +diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c +index 0617210bf..dda0c3a09 100644 +--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c ++++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c +@@ -168,6 +168,7 @@ static void *test(void *arg LTP_ATTRIBUTE_UNUSED) + sigset_t set; + int i, j = 0; + int signals[] = { SIGBUS, SIGKILL, SIGABRT, SIGCHLD, SIGHUP }; ++#undef NSIG + #define NSIG (sizeof(signals)/sizeof(int)) + int operation[] = { SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK }; + +-- +2.45.1 + diff --git a/testing/ltp/Makefile b/testing/ltp/Makefile index 979ff770a..aeb415f48 100644 --- a/testing/ltp/Makefile +++ b/testing/ltp/Makefile @@ -257,6 +257,7 @@ $(LTP_UNPACK): ltp-$(LTPS_VERSION).zip $(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 + $(Q) patch -d $(LTP_UNPACK) -p1 < 0012-ltp-fix-build-error.patch # Download and unpack tarball if no git repo found ifeq ($(wildcard $(LTP_UNPACK)/.git),)