Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gklib] Fix build error with Android triplet #37416

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ports/gklib/fix-error-in-clang17.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/error.c b/error.c
index e2a18cf..2daeef9 100644
--- a/error.c
+++ b/error.c
@@ -15,6 +15,8 @@ This file contains functions dealing with error reporting and termination

#include <GKlib.h>

+extern int backtrace(void **buffer, int size);
+extern char **backtrace_symbols(void *const *buffer, int size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this adds a declaration, but where is the definition if not on Linux/glibc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing that out. My original assumption was that these two functions wouldn't be called when not on Linux/glibc, so I didn't consider whether they were actually defined.
Now I've added conditions to them, so they're only declared if the execinfo.h header file can be found.
This is the original text in the source's CMake: check_include_file(execinfo.h HAVE_EXECINFO_H)


/* These are the jmp_buf for the graceful exit in case of severe errors.
Multiple buffers are defined to allow for recursive invokation. */
2 changes: 1 addition & 1 deletion ports/gklib/fix-mingw.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index 122e087..c8a322f 100644
#endif
#include <inttypes.h>
#include <sys/types.h>
+#ifndef _WIN32 # MinGW
+#ifndef _WIN32
#include <sys/resource.h>
+#endif
#include <sys/time.h>
Expand Down
1 change: 1 addition & 0 deletions ports/gklib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
build-fixes.patch
fix-mingw.patch
fix-error-in-clang17.patch
)

# Delete files that are workarounds for very old copies of msvc.
Expand Down
2 changes: 1 addition & 1 deletion ports/gklib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gklib",
"version-date": "2022-07-27",
"port-version": 2,
"port-version": 3,
"description": "General helper libraries for KarypisLab.",
"homepage": "https://github.com/KarypisLab/GKlib/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3010,7 +3010,7 @@
},
"gklib": {
"baseline": "2022-07-27",
"port-version": 2
"port-version": 3
},
"gl2ps": {
"baseline": "1.4.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gklib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "838ab025528e16ce02e01d4ba36f7b3ac7aff4bb",
"version-date": "2022-07-27",
"port-version": 3
},
{
"git-tree": "7f9c6f0e711860da19899fbe78e027d0a5e8cfc1",
"version-date": "2022-07-27",
Expand Down