diff mbox

builddeb: fix cross-building to arm64 producing host-arch debs

Message ID 20161104161407.10354-1-kilobyte@angband.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Adam Borowski Nov. 4, 2016, 4:14 p.m. UTC
Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
"aarch64".

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
---
 scripts/package/builddeb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Riku Voipio Nov. 10, 2016, 8:24 a.m. UTC | #1
On 4 November 2016 at 18:14, Adam Borowski <kilobyte@angband.pl> wrote:
> Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
> "aarch64".

I cross-compile arm64 kernels all the time and they come out as arm64.deb.
What exact command are you using to build your kernel to see host arch.deb?

Riku

> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> ---
>  scripts/package/builddeb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 8ea9fd2..3c575cd0 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -51,7 +51,7 @@ set_debarch() {
>                 debarch=hppa ;;
>         mips*)
>                 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
> -       arm64)
> +       aarch64|arm64)
>                 debarch=arm64 ;;
>         arm*)
>                 if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
> --
> 2.10.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Riku Voipio Nov. 10, 2016, 8:47 a.m. UTC | #2
On 10 November 2016 at 10:24, Riku Voipio <riku.voipio@linaro.org> wrote:
> On 4 November 2016 at 18:14, Adam Borowski <kilobyte@angband.pl> wrote:
>> Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
>> "aarch64".
>
> I cross-compile arm64 kernels all the time and they come out as arm64.deb.
> What exact command are you using to build your kernel to see host arch.deb?

OK, I see. UTS_MACHINE use to incorrect, now it has been fixed:

commit cfa88c79462d15098db29edebe623428c3620a4b
Author: Michal Marek <mmarek@suse.com>
Date:   Tue Aug 30 10:31:35 2016 +0200

    arm64: Set UTS_MACHINE in the Makefile

But that commit caused regression to builddeb since it wasn't updated
at the same time.

The patch below is correct fix,

Acked-by: Riku Voipio <riku.voipio@linaro.org>

>> ---
>>  scripts/package/builddeb | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
>> index 8ea9fd2..3c575cd0 100755
>> --- a/scripts/package/builddeb
>> +++ b/scripts/package/builddeb
>> @@ -51,7 +51,7 @@ set_debarch() {
>>                 debarch=hppa ;;
>>         mips*)
>>                 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
>> -       arm64)
>> +       aarch64|arm64)
>>                 debarch=arm64 ;;
>>         arm*)
>>                 if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
>> --
>> 2.10.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Nov. 10, 2016, 11:04 a.m. UTC | #3
On 2016-11-10 09:47, Riku Voipio wrote:
> On 10 November 2016 at 10:24, Riku Voipio <riku.voipio@linaro.org> wrote:
>> On 4 November 2016 at 18:14, Adam Borowski <kilobyte@angband.pl> wrote:
>>> Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
>>> "aarch64".
>>
>> I cross-compile arm64 kernels all the time and they come out as arm64.deb.
>> What exact command are you using to build your kernel to see host arch.deb?
> 
> OK, I see. UTS_MACHINE use to incorrect, now it has been fixed:
> 
> commit cfa88c79462d15098db29edebe623428c3620a4b
> Author: Michal Marek <mmarek@suse.com>
> Date:   Tue Aug 30 10:31:35 2016 +0200
> 
>     arm64: Set UTS_MACHINE in the Makefile
> 
> But that commit caused regression to builddeb since it wasn't updated
> at the same time.

Sorry about that.


> The patch below is correct fix,
> 
> Acked-by: Riku Voipio <riku.voipio@linaro.org>
> 
>>> ---
>>>  scripts/package/builddeb | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
>>> index 8ea9fd2..3c575cd0 100755
>>> --- a/scripts/package/builddeb
>>> +++ b/scripts/package/builddeb
>>> @@ -51,7 +51,7 @@ set_debarch() {
>>>                 debarch=hppa ;;
>>>         mips*)
>>>                 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
>>> -       arm64)
>>> +       aarch64|arm64)
>>>                 debarch=arm64 ;;

UTS_MACHINE is now always aarch64 on this architecture, so maybe stop
matching "arm64" to avoid confusion?

Thanks,
Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Riku Voipio Nov. 10, 2016, 12:17 p.m. UTC | #4
On 10 November 2016 at 13:04, Michal Marek <mmarek@suse.com> wrote:
> On 2016-11-10 09:47, Riku Voipio wrote:
>> On 10 November 2016 at 10:24, Riku Voipio <riku.voipio@linaro.org> wrote:
>>> On 4 November 2016 at 18:14, Adam Borowski <kilobyte@angband.pl> wrote:
>>>> Both Debian and kernel archs are "arm64" but UTS_MACHINE and gcc say
>>>> "aarch64".
>>>
>>> I cross-compile arm64 kernels all the time and they come out as arm64.deb.
>>> What exact command are you using to build your kernel to see host arch.deb?
>>
>> OK, I see. UTS_MACHINE use to incorrect, now it has been fixed:
>>
>> commit cfa88c79462d15098db29edebe623428c3620a4b
>> Author: Michal Marek <mmarek@suse.com>
>> Date:   Tue Aug 30 10:31:35 2016 +0200
>>
>>     arm64: Set UTS_MACHINE in the Makefile
>>
>> But that commit caused regression to builddeb since it wasn't updated
>> at the same time.
>
> Sorry about that.
>
>
>> The patch below is correct fix,
>>
>> Acked-by: Riku Voipio <riku.voipio@linaro.org>
>>
>>>> ---
>>>>  scripts/package/builddeb | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
>>>> index 8ea9fd2..3c575cd0 100755
>>>> --- a/scripts/package/builddeb
>>>> +++ b/scripts/package/builddeb
>>>> @@ -51,7 +51,7 @@ set_debarch() {
>>>>                 debarch=hppa ;;
>>>>         mips*)
>>>>                 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
>>>> -       arm64)
>>>> +       aarch64|arm64)
>>>>                 debarch=arm64 ;;
>
> UTS_MACHINE is now always aarch64 on this architecture, so maybe stop
> matching "arm64" to avoid confusion?

I was wondering if it might makes sense to keep the arm64 around for a
while, for example if someone reverts the UTS_MACHINE setting patch
from arch/arm64 for unrelated reasons and still tries to build a deb.
But I guess that's a corner case, and it's indeed cleaner without the
arm64 bit. So either way works for me.

Riku
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 8ea9fd2..3c575cd0 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -51,7 +51,7 @@  set_debarch() {
 		debarch=hppa ;;
 	mips*)
 		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
-	arm64)
+	aarch64|arm64)
 		debarch=arm64 ;;
 	arm*)
 		if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then