diff --git a/c/debug/_wrap/debug.c b/c/debug/_wrap/debug.c index 4b11a191..32d87903 100644 --- a/c/debug/_wrap/debug.c +++ b/c/debug/_wrap/debug.c @@ -1,6 +1,8 @@ #if defined(__linux__) #define UNW_LOCAL_ONLY +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #endif diff --git a/c/debug/debug.go b/c/debug/debug.go index 16e00eea..76260b0d 100644 --- a/c/debug/debug.go +++ b/c/debug/debug.go @@ -11,8 +11,8 @@ import ( ) const ( - LLGoPackage = "link" - LLGoFiles = "_wrap/debug.c" + LLGoPackage = "link: $(llvm-config --ldflags --libs); -lunwind" + LLGoFiles = "$(llvm-config --cflags): _wrap/debug.c" ) type Info struct { diff --git a/runtime/internal/clite/debug/_wrap/debug.c b/runtime/internal/clite/debug/_wrap/debug.c index 4b11a191..32d87903 100644 --- a/runtime/internal/clite/debug/_wrap/debug.c +++ b/runtime/internal/clite/debug/_wrap/debug.c @@ -1,6 +1,8 @@ #if defined(__linux__) #define UNW_LOCAL_ONLY +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #endif diff --git a/runtime/internal/clite/debug/debug.go b/runtime/internal/clite/debug/debug.go index 10e3a41e..48a27649 100644 --- a/runtime/internal/clite/debug/debug.go +++ b/runtime/internal/clite/debug/debug.go @@ -11,8 +11,8 @@ import ( ) const ( - LLGoPackage = "link" - LLGoFiles = "_wrap/debug.c" + LLGoPackage = "link: $(llvm-config --ldflags --libs); -lunwind" + LLGoFiles = "$(llvm-config --cflags): _wrap/debug.c" ) type Info struct {