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

Avoid overriding WORK_DIR for toolchain #5671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions mk/spksrc.spk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -584,17 +584,15 @@ kernel-modules-%:
$(MSG) ARCH to be processed: $${archs2process} ; \
for arch in $${archs2process} ; do \
$(MSG) "Processing $${arch} ARCH" ; \
MAKEFLAGS= $(PSTAT_TIME) $(MAKE) WORK_DIR=$(PWD)/work-$* ARCH=$$(echo $${arch} | cut -f1 -d-) TCVERSION=$$(echo $${arch} | cut -f2 -d-) strip 2>&1 | tee --append build-$*.log ; \
[ $${PIPESTATUS[0]} -eq 0 ] || false ; \
MAKEFLAGS= $(PSTAT_TIME) $(MAKE) ARCH=$$(echo $${arch} | cut -f1 -d-) TCVERSION=$$(echo $${arch} | cut -f2 -d-) strip 2>&1 | tee --append build-$*.log ; \
[ $${PIPESTATUS[0]} -eq 0 ] ; \
$(MAKE) spkclean ; \
rm -fr $(PWD)/work-$*/$(addprefix linux-, $${arch}) ; \
$(MAKE) -C ../../toolchain/syno-$${arch} clean ; \
done

arch-%: | pre-build-native
ifneq ($(strip $(REQUIRE_KERNEL_MODULE)),)
$(MAKE) $(addprefix kernel-modules-, $(or $(filter $(addprefix %, $(DEFAULT_TC)), $(filter %$(word 2,$(subst -, ,$*)), $(filter $(firstword $(subst -, ,$*))%, $(AVAILABLE_TOOLCHAINS)))),$*))
$(MAKE) REQUIRE_KERNEL_MODULE= REQUIRE_KERNEL= WORK_DIR=$(PWD)/work-$* $(addprefix build-arch-, $*)
$(MAKE) REQUIRE_KERNEL_MODULE= REQUIRE_KERNEL= $(addprefix build-arch-, $(or $(filter $(addprefix %, $(DEFAULT_TC)), $(filter %$(word 2,$(subst -, ,$*)), $(filter $(firstword $(subst -, ,$*))%, $(AVAILABLE_TOOLCHAINS)))),$*))
Comment on lines -597 to +595
Copy link
Contributor

Choose a reason for hiding this comment

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

besides removing WORK_DIR what does the remaining portion do? Presuming alignment with other similar call previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that, for the target arch-XXXX-YYYY, it looks through AVAILABLE_TOOLCHAINS for one which starts with XXXX and ends with both YYYY and DEFAULT_TC, which should give XXXX-YYYY or nothing, in which case it falls back to XXXX-YYYY anyway.

For arch-XXXX, it looks through AVAILABLE_TOOLCHAINS for one which starts with XXXX and ends with DEFAULT_TC, so it should end up picking XXXX-DEFAULT_TC.

Previously the latter case wouldn't build at all, you had to specify the toolchain version in the make target.

else
# handle and allow parallel build for: arch-<arch> | make arch-<arch>-X.Y
@$(MSG) BUILDING package for arch $(or $(filter $(addprefix %, $(DEFAULT_TC)), $(filter %$(word 2,$(subst -, ,$*)), $(filter $(firstword $(subst -, ,$*))%, $(AVAILABLE_TOOLCHAINS)))), $*)
Expand Down