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

Compile kernel on 64/32 split archs without redefining TARGET_PREFIX #2506

Merged
merged 6 commits into from
Feb 23, 2018

Conversation

HiassofT
Copy link
Member

Cross compiling the linux kernel and u-boot is normally done via setting appropriate ARCH and CROSS_COMPILE options (which the LE buildsystem already does).

It's therefore not necessary to redefine TARGET_PREFIX in scripts/build

Just add TARGET_KERNEL_PREFIX (defaulting to TARGET_PREFIX on non-split arch builds) in addition to the already existing TARGET_KERNEL_ARCH and use that for compiling kernel, kernel-modules and u-boot

Note: with these changes PKG_IS_KERNEL_PKG becomes an unused marker and can probably be dropped, but I left it intact for now

Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Matthias Reichl <hias@horus.com>
for MOD in `find $INSTALL/usr/lib/kernel-overlays/ -type f -name *.ko`; do
$STRIP --strip-debug $MOD
${TARGET_KERNEL_PREFIX}strip --strip-debug $MOD
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be using $TARGET_PREFIX or $TARGET_KERNEL_PREFIX? If the latter, then $STRIP would be correct here.

Copy link
Member Author

Choose a reason for hiding this comment

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

TARGET_PREFIX is unchanged and always points to the (userspace) target toolchain - as do CC, STRIP etc. so setup_toolchain is fine as it is

kernel compile doesn't need all this, everything's handled inside the kernel build via ARCH and CROSS_COMPILE

@HiassofT
Copy link
Member Author

@Raybuntu Odroid C2 and LePotato seem to use a different toolchain for u-boot than kernel (aarch64-elf instead of aarch64-linux-gnu).

So I'd rather keep these as they are as they don't use $TARGET_PREFIX

We could think about introducing TARGET_UBOOT_PREFIX for such cases, but that'd be a separate refactoring step and as only 2 devices seem to need 3 different toolchains I'm not sure if it's worth the hassle - handling it manually in the device specific package.mk is fine IMO

@HiassofT
Copy link
Member Author

Build+runtime test with Rock64/arm and build test with Wetek Hub (which includes dvb drivers) was fine.

Together with #2505 and a perf kernel backport patch perf built and worked on Rock64/arm - full tree used for the test is here: https://github.com/HiassofT/LibreELEC.tv/tree/rockchip-kernel-perf-build

@Ray-future
Copy link
Contributor

You are correct @HiassofT. Sorry for the noise.

@Ray-future Ray-future merged commit d450819 into LibreELEC:master Feb 23, 2018
@HiassofT HiassofT deleted the le9-kernel-toolchain branch May 1, 2018 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants