package/libtracefs: fix musl build
PATCH v2 1/1 package/libtracefs: fix musl build
Fix the following musl build failure raised since the addition of the package in commit b1dbd3f679e6660325472e3fdca72127d74e6929 if cunit is found:
../utest/tracefs-utest.c: In function 'test_uprobes_instance':../utest/tracefs-utest.c:2492:19: error: 'PATH_MAX' undeclared (first use in this function)
2492 | char self[PATH_MAX] = { 0 };
| ^~~~~~~~- http://autobuild.buildroot.org/results/1a01883231dbc8a7688de26db9a08751165fe8fe
---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Fix build instead of disabling utest
...ATH_MAX-if-it-is-not-already-defined.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 package/libtracefs/0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patch
package/libtracefs/0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patch new file +40 -0
@@ -0,0 +1,40 @@ +From ba750812f68f0f3314494558496c23f934f8faff Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Google)" <[email protected]> +Date: Thu, 22 Feb 2024 11:02:46 -0500 +Subject: libtracefs utest: Add PATH_MAX if it is not already defined + +In some setups PATH_MAX may not be defined (it is usually defined in +linux/limits.h), but we just use PATH_MAX as something to hold the paths +to the tracing files. In that case, just define it to 1024 if it's not +already defined. + +Link: https://lore.kernel.org/linux-trace-devel/[email protected]/ + +Fixes: 845f16976929 ("libtracefs: Add unit tests") +Reported-by: Miko Larsson <[email protected]> +Signed-off-by: Steven Rostedt (Google) <[email protected]> + +Upstream: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/commit/?id=ba750812f68f0f3314494558496c23f934f8faff +Signed-off-by: Fabrice Fontaine <[email protected]> +--- + utest/tracefs-utest.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c +index 963fac7..07ecd32 100644 +--- a/utest/tracefs-utest.c ++++ b/utest/tracefs-utest.c +@@ -26,6 +26,10 @@ + + #define gettid() syscall(__NR_gettid) + ++#ifndef PATH_MAX ++#define PATH_MAX 1024 ++#endif ++ + #define TRACEFS_SUITE "tracefs library" + #define TEST_INSTANCE_NAME "cunit_test_iter" + #define TEST_TRACE_DIR "/tmp/trace_utest.XXXXXX" +-- +cgit 1.2.3-korg +
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 6 lines · Fabrice Fontaine
Fix the following musl build failure raised since the addition of the package in commit
b1dbd3f679e6660325472e3fdca72127d74e6929if cunit is found:
../utest/tracefs-utest.c: In function 'test_uprobes_instance':../utest/tracefs-utest.c:2492:19: error: 'PATH_MAX' undeclared (first use in this function)
Quoted 7 lines
2492 | char self[PATH_MAX] = { 0 }; | ^~~~~~~~Fixes b1dbd3f679e6660325472e3fdca72127d74e6929- http://autobuild.buildroot.org/results/1a01883231dbc8a7688de26db9a08751165fe8fe
Signed-off-by Fabrice Fontaine <[email protected]>
Applied to master, thanks.
Regards,
Arnout
Quoted 44 lines
---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Fix build instead of disabling utest...ATH_MAX-if-it-is-not-already-defined.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+)create mode 100644
package/libtracefs/0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patchpackage/libtracefs/0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patch new file +30
-0@@ -0,0 +1,40 @@ +From ba750812f68f0f3314494558496c23f934f8faff Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Google)" <[email protected]> +Date: Thu, 22 Feb 2024 11:02:46 -0500 +Subject: libtracefs utest: Add PATH_MAX if it is not already defined + +In some setups PATH_MAX may not be defined (it is usually defined in +linux/limits.h), but we just use PATH_MAX as something to hold the paths +to the tracing files. In that case, just define it to 1024 if it's not +already defined. + +Link: https://lore.kernel.org/linux-trace-devel/[email protected]/ + +Fixes: 845f16976929 ("libtracefs: Add unit tests") +Reported-by: Miko Larsson <[email protected]> +Signed-off-by: Steven Rostedt (Google) <[email protected]> + +Upstream: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/commit/?id=ba750812f68f0f3314494558496c23f934f8faff +Signed-off-by: Fabrice Fontaine <[email protected]> +--- + utest/tracefs-utest.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c +index 963fac7..07ecd32 100644 +--- a/utest/tracefs-utest.c ++++ b/utest/tracefs-utest.c +@@ -26,6 +26,10 @@ + + #define gettid() syscall(__NR_gettid) +
package/libtracefs/0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patch line 40
Quoted 10 lines
package/libtracefs/0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patch new file +10
-0++#ifndef PATH_MAX ++#define PATH_MAX 1024 ++#endif ++ + #define TRACEFS_SUITE "tracefs library" + #define TEST_INSTANCE_NAME "cunit_test_iter" + #define TEST_TRACE_DIR "/tmp/trace_utest.XXXXXX" +-- +cgit 1.2.3-korg +
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle via buildroot <[email protected]> writes:
Quoted 10 lines · Fabrice Fontaine
Fix the following musl build failure raised since the addition of the package in commit
b1dbd3f679e6660325472e3fdca72127d74e6929if cunit is found:../utest/tracefs-utest.c: In function 'test_uprobes_instance':../utest/tracefs-utest.c:2492:19: error: 'PATH_MAX' undeclared (first use in this function)
2492 | char self[PATH_MAX] = { 0 };
| ^~~~~~~~Fixes b1dbd3f679e6660325472e3fdca72127d74e6929- http://autobuild.buildroot.org/results/1a01883231dbc8a7688de26db9a08751165fe8fe
Signed-off-by Fabrice Fontaine <[email protected]>
Quoted 1 line
Applied to master, thanks.
Committed to 2024.02.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot