Skip to content

Commit

Permalink
tools/elfutils: prevent invalid include of stack binary
Browse files Browse the repository at this point in the history
In some versions of Xcode, some C++ header has an include
of the standard C++ header "stack" while "." is in the include paths
which can conflict with the binary "stack" built by elfutils.
This leads to a decode error as the binary is interpreted as text.

Add an arbitrary dependency between stack and the C++ program.

Signed-off-by: Michael Pratt <[email protected]>
  • Loading branch information
mcprat authored and robimarko committed Sep 30, 2024
1 parent 3f98f68 commit 484f71f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/elfutils/patches/100-portability.patch
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,13 @@

/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -92,6 +92,7 @@ strings_LDADD = $(libelf) $(libeu) $(arg
ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
+EXTRA_stack_DEPENDENCIES = $(if $(findstring srcfiles,$(bin_PROGRAMS)),$(srcfiles_OBJECTS))
elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD)
srcfiles_SOURCES = srcfiles.cxx

0 comments on commit 484f71f

Please sign in to comment.