Bug 27301 - Aarch64 ko compilation failures when CONFIG_COMPAT is defined
Summary: Aarch64 ko compilation failures when CONFIG_COMPAT is defined
Status: RESOLVED NOTABUG
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-01 01:31 UTC by agentzh
Modified: 2021-02-01 04:20 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description agentzh 2021-02-01 01:31:00 UTC
When CONFIG_COMPAT is defined in the kernel's config, stap fails to compile its runtime on Fedora 32 (kernel 5.10):


```
$ /opt/stap/bin/stap -e 'probe process.function("main") { println(register("x0")) }' -c ./a.out
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/stapLY6U32/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/stapLY6U32/stap_9b24fb2c80d42c5c58d165f9c20c403e_6889_src.o] Error 1
make: *** [Makefile:1806: /tmp/stapLY6U32] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
```

That part of runtime code does not handle aarch64 at all. A fix is easy.

A patch is under way.
Comment 1 agentzh 2021-02-01 01:32:20 UTC
BTW, any target C program with a main function will reproduce this.
Comment 2 agentzh 2021-02-01 04:20:34 UTC
Ah, William Cohen was faster than me. Closing this.