Skip to content

Instantly share code, notes, and snippets.

@agentzh

agentzh/a.patch Secret

Created February 1, 2021 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentzh/9983a76db4a18a9aa1160e8b03c9874e to your computer and use it in GitHub Desktop.
Save agentzh/9983a76db4a18a9aa1160e8b03c9874e to your computer and use it in GitHub Desktop.
Fix compilation error on aarch64 linux:
WARNING: cannot find module /home/agentzh/git/systemtap.new/a.out debuginfo: No DWARF information found [man warning::debuginfo]
In file included from /opt/stap/share/systemtap/runtime/linux/../linux/regs.c:16,
from /opt/stap/share/systemtap/runtime/linux/../regs.c:20,
from /opt/stap/share/systemtap/runtime/linux/runtime.h:251,
from /opt/stap/share/systemtap/runtime/runtime.h:26,
from /tmp/stapblsqtY/stap_9b24fb2c80d42c5c58d165f9c20c403e_6889_src.c:21:
/opt/stap/share/systemtap/runtime/compatdefs.h: In function ‘_stp_is_compat_task2’:
/opt/stap/share/systemtap/runtime/compatdefs.h:38:2: error: #error architecture not supported, no TIF_32BIT flag?
38 | #error architecture not supported, no TIF_32BIT flag?
| ^~~~~
/opt/stap/share/systemtap/runtime/compatdefs.h:40:1: error: no return statement in function returning non-void [-Werror=return-type]
40 | }
| ^
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:279: /tmp/stapblsqtY/stap_9b24fb2c80d42c5c58d165f9c20c403e_6889_src.o] Error 1
make: *** [Makefile:1806: /tmp/stapblsqtY] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed. [man error::pass4]
--- a/runtime/compatdefs.h
+++ b/runtime/compatdefs.h
@@ -26,6 +26,8 @@ static inline int _stp_is_compat_task2(struct task_struct* tsk)
return test_tsk_thread_flag(tsk, TIF_IA32);
#elif defined (__x86_64__) /* post TIF_IA32 */
return (tsk->mm && (tsk->mm->context.flags & MM_CONTEXT_UPROBE_IA32));
+#elif defined (__aarch64__) && defined(TIF_32BIT)
+ return test_tsk_thread_flag(tsk, TIF_32BIT);
#elif defined(__s390__) || defined(__s390x__)
return test_tsk_thread_flag(tsk, TIF_31BIT);
#elif defined (__mips__) && !defined(TIF_32BIT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment