[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
georgthegreat wrote: I am OK with fixing this particular guarantee with a test. However, I am not familiar with libc++ testset organization and I need to be guided. Could you, please, provide me with some clues to start wtih? https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
georgthegreat wrote: @ldionne, do you find @arichardson reasoning good enough to proceed with merging this PR? https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
georgthegreat wrote: @ldionne, gentle ping https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
https://github.com/georgthegreat created https://github.com/llvm/llvm-project/pull/80443 We store libunwind code inside monorepo and would like to reduce the overall amount of `-I` flags. >From 3e8bbe318ebbd498a7457afee2192c47650b6dad Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Fri, 2 Feb 2024 18:09:47 +0300 Subject: [PATCH] Use relative includes to allow source-based dependencies without -I --- libunwind/include/libunwind.h | 2 +- libunwind/include/unwind.h| 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h index b2dae8feed9a3..02739b384e9da 100644 --- a/libunwind/include/libunwind.h +++ b/libunwind/include/libunwind.h @@ -13,7 +13,7 @@ #ifndef __LIBUNWIND__ #define __LIBUNWIND__ -#include <__libunwind_config.h> +#include "__libunwind_config.h" #include #include diff --git a/libunwind/include/unwind.h b/libunwind/include/unwind.h index b1775d3a3decc..1973c5826d3ca 100644 --- a/libunwind/include/unwind.h +++ b/libunwind/include/unwind.h @@ -13,7 +13,7 @@ #ifndef __UNWIND_H__ #define __UNWIND_H__ -#include <__libunwind_config.h> +#include "__libunwind_config.h" #include #include @@ -56,9 +56,9 @@ typedef enum { typedef struct _Unwind_Context _Unwind_Context; // opaque #if defined(_LIBUNWIND_ARM_EHABI) -#include +#include "unwind_arm_ehabi.h" #else -#include +#include "unwind_itanium.h" #endif typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
georgthegreat wrote: We have pretty large codebase and we use custom command-graph based build system (consider bazel as a well-known example of such buld system). The system uses module as a basic unit, modules might depend one each other, dependencies might affect dependant modules (but not vise versa). In order to reduce the total size of the command graph, we would like to reduce the amount of `-I` flags induced by the most common modules. libunwind is one of such modules: almost every module transitively depend on it yet very little do include `unwind.h` directly. We include unwind.h using a repository-root-relative-path (i. e. `contrib/libs/libunwind/include/unwind.h`). Everything else just works if we apply this patch. https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
georgthegreat wrote: I understand the _this will definitely break in the future without proper testing_, but libunwind does not experience frequent changes, so this might be a working soluiton even without explicit testing. https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
georgthegreat wrote: @ldionne, gentle ping https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
https://github.com/georgthegreat closed https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
georgthegreat wrote: I applied @ldionne suggestions, I am fine with his approach. https://github.com/llvm/llvm-project/pull/125412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
georgthegreat wrote: @MaskRay, we build libunwind using our own build system with the clang default set of warnings enabled. There is already a couple of `[[maybe_unused]]` attributes in this library, so I do not bring anything new: ``` (dflt) thegeorg@jakku:~/contrib/llvm/libunwind@main$ rg unused]] src/Unwind-EHABI.cpp 890:[[gnu::unused]] static uint64_t src/UnwindCursor.hpp 3050: [[maybe_unused]] const int Result = syscall( ``` https://github.com/llvm/llvm-project/pull/125412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
https://github.com/georgthegreat created https://github.com/llvm/llvm-project/pull/125412 None >From f3f30cca500f839a2e6647ea9acf0cea45a4e178 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 2 Feb 2025 14:35:53 +0100 Subject: [PATCH] Silence -Wunused-parameter warnings in Unwind-wasm.c --- libunwind/src/Unwind-wasm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index b18b32c5d17847..fe016b8f5923ad 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -102,8 +102,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, - uintptr_t value) {} +_LIBUNWIND_EXPORT void _Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context, + [[maybe_unused]] uintptr_t value) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -116,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart(struct _Unwind_Context *context) { +_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) { return 0; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
https://github.com/georgthegreat updated https://github.com/llvm/llvm-project/pull/125412 >From 69307d52fc749c847da74e98624ce1c39f2fe2d9 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 2 Feb 2025 14:35:53 +0100 Subject: [PATCH] Silence -Wunused-parameter warnings in Unwind-wasm.c --- libunwind/src/Unwind-wasm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index b18b32c5d17847a..4b893c8b4f623e3 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -102,8 +102,9 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, - uintptr_t value) {} +_LIBUNWIND_EXPORT void +_Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context, + [[maybe_unused]] uintptr_t value) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -116,7 +117,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart(struct _Unwind_Context *context) { +_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) { return 0; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
https://github.com/georgthegreat updated https://github.com/llvm/llvm-project/pull/125412 >From 69307d52fc749c847da74e98624ce1c39f2fe2d9 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 2 Feb 2025 14:35:53 +0100 Subject: [PATCH 1/3] Silence -Wunused-parameter warnings in Unwind-wasm.c --- libunwind/src/Unwind-wasm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index b18b32c5d1784..4b893c8b4f623 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -102,8 +102,9 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, - uintptr_t value) {} +_LIBUNWIND_EXPORT void +_Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context, + [[maybe_unused]] uintptr_t value) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -116,7 +117,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart(struct _Unwind_Context *context) { +_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) { return 0; } >From acf1c4a81c84071e4a5550e85dd2aecfdac323f1 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Wed, 5 Feb 2025 21:26:24 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Louis Dionne --- libunwind/src/Unwind-wasm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index 4b893c8b4f623..caf92eb0dea0f 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -103,8 +103,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT void -_Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context, - [[maybe_unused]] uintptr_t value) {} +_Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -117,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) { +_Unwind_GetRegionStart(struct _Unwind_Context *) { return 0; } >From 749510a9fd13172f76ea9e574d623f6145249255 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sat, 15 Feb 2025 14:42:55 +0300 Subject: [PATCH 3/3] Fix formatting --- libunwind/src/Unwind-wasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index caf92eb0dea0f..1b97f9763477d 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -102,8 +102,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT void -_Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {} +_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *, + uintptr_t) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
https://github.com/georgthegreat updated https://github.com/llvm/llvm-project/pull/125412 >From 69307d52fc749c847da74e98624ce1c39f2fe2d9 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 2 Feb 2025 14:35:53 +0100 Subject: [PATCH 1/3] Silence -Wunused-parameter warnings in Unwind-wasm.c --- libunwind/src/Unwind-wasm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index b18b32c5d1784..4b893c8b4f623 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -102,8 +102,9 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, - uintptr_t value) {} +_LIBUNWIND_EXPORT void +_Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context, + [[maybe_unused]] uintptr_t value) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -116,7 +117,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart(struct _Unwind_Context *context) { +_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) { return 0; } >From acf1c4a81c84071e4a5550e85dd2aecfdac323f1 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Wed, 5 Feb 2025 21:26:24 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Louis Dionne --- libunwind/src/Unwind-wasm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index 4b893c8b4f623..caf92eb0dea0f 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -103,8 +103,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT void -_Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context, - [[maybe_unused]] uintptr_t value) {} +_Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -117,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { /// Not used in Wasm. _LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) { +_Unwind_GetRegionStart(struct _Unwind_Context *) { return 0; } >From c064b57d771eb75cd02ee7aeb937e284bebc4881 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sat, 15 Feb 2025 14:42:55 +0300 Subject: [PATCH 3/3] Fix formatting --- libunwind/src/Unwind-wasm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c index caf92eb0dea0f..b8b7bc2779f17 100644 --- a/libunwind/src/Unwind-wasm.c +++ b/libunwind/src/Unwind-wasm.c @@ -102,8 +102,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT void -_Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {} +_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {} /// Called by personality handler to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t @@ -115,8 +114,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { } /// Not used in Wasm. -_LIBUNWIND_EXPORT uintptr_t -_Unwind_GetRegionStart(struct _Unwind_Context *) { +_LIBUNWIND_EXPORT uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *) { return 0; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
georgthegreat wrote: @ldionne, may we proceed with merging this? https://github.com/llvm/llvm-project/pull/125412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)
georgthegreat wrote: I think this is how my clang-format-16 auto-formatted it. I have applied the formatting from the check, it is green now. https://github.com/llvm/llvm-project/pull/125412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits