Bug 14501 - lttng-modules v2.11 package fails to build
Summary: lttng-modules v2.11 package fails to build
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2021.05
Hardware: All Linux
: P5 blocker
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-05 07:39 UTC by Sreedhar Mahadevan
Modified: 2022-01-11 13:20 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
Buildroot .config files (40.84 KB, application/zip)
2022-01-05 15:58 UTC, Sreedhar Mahadevan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sreedhar Mahadevan 2022-01-05 07:39:01 UTC
Hello,

I am not able to successfully build the lttng-modules package with Buildroot v2021.05. I get the following syntax errors:

output/build/lttng-modules-2.11.0/./probes/../instrumentation/events/lttng-module/timer.h:313:41: error: invalid use of undefined type ‘const struct itimerval’
  313 |   ctf_integer(long, interval_usec, value->it_interval.tv_usec)
      |                                         ^~

output/build/lttng-modules-2.11.0/./lib/../lib/ringbuffer/frontend.h:82:6: error: implicit declaration of function ‘smp_read_barrier_depends’ [-Werror=implicit-function-declaration]
   82 |      smp_read_barrier_depends(); (cpu) < nr_cpu_ids; });)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~

/output/build/lttng-modules-2.11.0/./lib/../wrapper/trace-clock.h:168:3: error: implicit declaration of function ‘read_barrier_depends’ [-Werror=implicit-function-declaration]
  168 |   read_barrier_depends(); /* load ltc before content */
      |   ^~~~~~~~~~~~~~~~~~~~

The errors look mostly syntactical and is replicated with a fresh clone of v2021.08, v2021.11, v2020.05, v2020.08 also. The lttng-tools and lttng-babeltrace packages build without issues but the moment lttng-modules is selected and built, it fails. Is this issue known already? Are there any solutions for it?
Comment 1 Thomas Petazzoni 2022-01-05 13:36:30 UTC
Thanks for the bug report. Could you provide the Buildroot .config that allows to reproduce this issue ?
Comment 2 Sreedhar Mahadevan 2022-01-05 15:58:40 UTC
Created attachment 9196 [details]
Buildroot .config files

Hi Thomas,

I am attaching two .config files here. The reason is that I suspected the external tool chain option to create the issue, because of which I tried using buildroot's own tool chain. Unfortunately I encountered the same error using both configurations. 

Request you to kindly use these configurations and check if you can reproduce the issue at your end.

Thanks and regards,
Sreedhar
Comment 3 Sreedhar Mahadevan 2022-01-06 07:59:58 UTC
Would like to update one development from my end. I cloned the lttng-modules package directly from its Github repository: https://github.com/lttng/lttng-modules

From this lttng-modules environment, I tried building lttng-modules v2.13.0 based on the instructions in its README.md file by referencing the custom linux version that I was using (v5.10.x corresponding to Buildroot v2021.05) and it built successfully. When I tried building lttng-modules v2.12.0 and v2.11.0 and I got the exact error which I encountered in the Buildroot environment (reported earlier in this bug report). I see that buildroot v2021.08 and 2021.11 all continue using lttng-modules v2.11.0 and all seem to have the same issue. 

Is this possibly the reason for the issue? If yes, how do I solve it? I tried hacking into the buildroot/package/lttng-modules/lttng-modules.mk and lttng-modules.hash files but I still faced issues with the wrong sha256 hashes. Can you please help?
Comment 4 Fabrice Fontaine 2022-01-06 17:52:39 UTC
From understanding, the issue is raised on kernel >= 5.6 and lttng-modules has fixed this issue with https://github.com/lttng/lttng-modules/commit/edfdcb685c3f56dde803244449f79ad7bed03798

But there is a lot of other commits needed to be able to build on newer kernels so I think that a bump is indeed the best course of action.

You can find a patch here:
https://patchwork.ozlabs.org/project/buildroot/patch/20220106174949.1064731-1-fontaine.fabrice@gmail.com/
Comment 5 Sreedhar Mahadevan 2022-01-07 13:50:07 UTC
Thanks a lot for the response. I shall try this out and give a feedback.
Comment 6 Fabrice Fontaine 2022-01-07 19:39:32 UTC
FYI, patch was applied on master with
https://git.buildroot.net/buildroot/commit/?id=48b77b25b71fa3c47b8d6fac1da46ea122715350
Comment 7 Sreedhar Mahadevan 2022-01-11 13:20:10 UTC
Thanks a lot for the solutions and sorry for the late reply. I was able to get it built successfully using the v2.11.9 version of lttng-modules by changing the versions in the lttng-modules.mk and lttng-modules.hash files. 

Thanks again for the information about the patch on master. Really appreciate it.

The bug report can be closed.