Bug 10096 - SH4 toolchain does not build Linux kernel magicpanelr2_defconfig
Summary: SH4 toolchain does not build Linux kernel magicpanelr2_defconfig
Status: RESOLVED WONTFIX
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2016.11
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Kieran Weaver
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-17 15:08 UTC by Thomas Petazzoni
Modified: 2024-01-24 03:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Petazzoni 2017-07-17 15:08:57 UTC
Found in http://www.spinics.net/lists/linux-sh/msg51060.html, a Buildroot generated toolchain for SH4 fails to build the Linux kernel magicpanelr2_defconfig:

/opt/cross/kisskb/br-sh4-full-2016.08-613-ge98b4dd/bin/sh4-linux-ld: kernel/sched/built-in.o: uses dsp instructions while previous modules use floating point instructions
/opt/cross/kisskb/br-sh4-full-2016.08-613-ge98b4dd/bin/sh4-linux-ld: kernel/sched/built-in.o: uses instructions which are incompatible with instructions used in previous modules
/opt/cross/kisskb/br-sh4-full-2016.08-613-ge98b4dd/bin/sh4-linux-ld: failed to merge target specific data of file kernel/sched/built-in.o
/home/kisskb/slave/src/scripts/Makefile.build:380: recipe for target 'kernel/built-in.o' failed
make[2]: *** [kernel/built-in.o] Error 1

Full build log at http://kisskb.ellerman.id.au/kisskb/buildresult/12857629/log/

(Note: this is a bug from January 2017, which I notice only now. Before I forget, I fill in a bug report about it, so we can have a look at it later.)
Comment 1 Thomas Petazzoni 2018-04-01 11:56:05 UTC
This problem can be reproduced with the following defconfig:

BR2_sh=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_DEFCONFIG="magicpanelr2"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
Comment 2 Kieran Weaver 2024-01-24 03:25:59 UTC
Reproduced on the current buildroot git head.

From linux commit ded5431ff311d963888ac951131a04fe7633aa79:

"""
From ded5431ff311d963888ac951131a04fe7633aa79 Mon Sep 17 00:00:00 2001
From: Markus Brunner <super.firetwister@gmail.com>
Date: Wed, 12 Sep 2007 11:54:58 +0900
Subject: sh: Magic Panel R2 board support.

This adds support for the SH7720 (SH3-DSP) based Magic Panel R2
board.
"""

The Magic Panel R2 is a SH3 board, not a SH4 board, it's not supported by buildroot.

The root cause is that the SH3-DSP scheduler code saves and loads the SH3 DSP registers via inline ASM, and mixing SH3-DSP code with SH4-FPU code isn't supported.

Marking as RESOLVED/WONTFIX