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

Build fixes #559

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Build fixes #559

merged 3 commits into from
Feb 7, 2025

Conversation

tavip
Copy link
Member

@tavip tavip commented Feb 6, 2025

Backports a patch from upstream to fix build output for test targets and add a workaround to fix parallel builds for tests. Fixes #558.

Jiri Olsa (1):
tools/build: Fix -s detection code in tools/build/Makefile.build

Octavian Purdila (2):
lkl: add tests build barrier
lkl: don't install tests

tools/build/Makefile.build | 10 +++++++++-
tools/lkl/Makefile | 15 +++++++++++----
tools/lkl/Targets | 17 +++++++++++------
3 files changed, 31 insertions(+), 11 deletions(-)

As Dmitry described in [1] changelog the current way of detecting
-s option is broken for new make.

Changing the tools/build -s option detection the same way as it was
fixed for root Makefile in [1].

[1] 4bf7358 ("kbuild: Port silent mode detection to future gnu make.")

Cc: Dmitry Goncharov <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: KP Singh <[email protected]>
Cc: Martin KaFai Lau <[email protected]>
Cc: Song Liu <[email protected]>
Cc: Yonghong Song <[email protected]>
Cc: John Fastabend <[email protected]>
Cc: Hao Luo <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Stanislav Fomichev <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Quentin Monnet <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
@tavip tavip requested a review from thehajime February 6, 2025 01:07
@tavip
Copy link
Member Author

tavip commented Feb 6, 2025

@ddiss could you please check if this fixes the parallel build issue on you side? Not a great solution but it is fairly isolated and simple.

@ddiss
Copy link

ddiss commented Feb 6, 2025

@ddiss could you please check if this fixes the parallel build issue on you side? Not a great solution but it is fairly isolated and simple.

Thanks for the patch! will give it a spin on the Build Service today

@ddiss
Copy link

ddiss commented Feb 6, 2025

The change looks good, but make install -C tools/lkl is broken with b4e2599:

[  184s]   LD      /home/abuild/rpmbuild/BUILD/lkl-0.6.4+git.2c97ed520d4-build/lkl-0.6.4+git.2c97ed520d4/tools/lkl/.WAIT-in.o
[  184s] gcc -pie -z noexecstack  -o /home/abuild/rpmbuild/BUILD/lkl-0.6.4+git.2c97ed520d4-build/lkl-0.6.4+git.2c97ed520d4/tools/lkl/.WAIT /home/abuild/rpmbuild/BUILD/lkl-0.6.4+git.2c97ed520d4-build/lkl-0.6.4+git.2c97ed520d4/tools/lkl/.WAIT-in.o /home/abuild/rpmbuild/BUILD/lkl-0.6.4+git.2c97ed520d4-build/lkl-0.6.4+git.2c97ed520d4/tools/lkl/liblkl.a -lrt -lpthread 
[  184s] /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/Scrt1.o: in function `_start':
[  184s] /home/abuild/rpmbuild/BUILD/glibc-2.40/csu/../sysdeps/x86_64/start.S:103:(.text+0x1b): undefined reference to `main'
[  184s] collect2: error: ld returned 1 exit status
[  184s] make: *** [Makefile:106: /home/abuild/rpmbuild/BUILD/lkl-0.6.4+git.2c97ed520d4-build/lkl-0.6.4+git.2c97ed520d4/tools/lkl/.WAIT] Error 1
[  184s] error: Bad exit status from /var/tmp/rpm-tmp.8n6nkp (%install)

https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html doesn't really explain how .WAIT should affect make install.... perhaps another option would be to add each of the test targets as a .NOTPARALLEL prerequisite?

tavip added 2 commits February 6, 2025 09:00
tools/build does not support parallel builds when objects are shared
between build targets. Keep the test that uses the most common object
first and insert a build barrier to avoid rebuilding common objects.

Signed-off-by: Octavian Purdila <[email protected]>
Separate the tests targets in a different set so that we don't install
them with make install.

Signed-off-by: Octavian Purdila <[email protected]>
@tavip
Copy link
Member Author

tavip commented Feb 6, 2025

The change looks good, but make install -C tools/lkl is broken with b4e2599:

Thanks @ddiss for testing. Should be fixed with 3c97822.

I've also added another patch to remove the tests from the install process.

Copy link
Member

@thehajime thehajime left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link

@ddiss ddiss left a comment

Choose a reason for hiding this comment

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

Looks good and works for me - thanks!

@tavip tavip merged commit 2231833 into lkl:master Feb 7, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallel buld issues and missing output when building certain objects
4 participants