All of lore.kernel.org
 help / color / mirror / Atom feed
* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
@ 2015-04-06 22:50 Mandeep Sandhu
  2015-04-07  0:27 ` John de la Garza
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mandeep Sandhu @ 2015-04-06 22:50 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

I'm having trouble compiling my kernel using a 32-bit toolchain (for
ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.

I understand that 32-bit binaries require "ia32-libs" (or equivalent)
for compiling on 64-bit hosts. I installed the required packages
(lib32z1 lib32ncurses5 lib32bz2-1.0 for Ubuntu 14.10), but still keep
getting errors:

$ make CROSS_COMPILE=arm-none-linux-gnueabi- all
Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
-fstack-protector not supported by compiler
make: arm-none-linux-gnueabi-gcc: Command not found
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
/bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2

I've ensured that the PATH to the toolchain binaries is correct.

If I try to export CROSS_COMPILE to my environment, then too I get an
error (although it's for a different reason):

$ make all
Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
-fstack-protector not supported by compiler
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
gcc: error: unrecognized argument in option ?-mabi=aapcs-linux?
gcc: note: valid arguments to ?-mabi=? are: ms sysv
gcc: error: unrecognized command line option ?-mlittle-endian?
gcc: error: unrecognized command line option ?-mapcs?
gcc: error: unrecognized command line option ?-mno-sched-prolog?
gcc: error: unrecognized command line option ?-mno-thumb-interwork?
gcc: error: unrecognized command line option ?-mfpu=vfp?
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

It looks like make is starting a new shell which does not have either
PATH (1st case) or  CROSS_COMPILE (2nd case) set.

Any hints on how to get make to use the toolchain?

Thanks,
-mandeep

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
  2015-04-06 22:50 cross-compiling kernel using a 32-bit toolchain on a 64-bit machine Mandeep Sandhu
@ 2015-04-07  0:27 ` John de la Garza
  2015-04-07 15:59   ` Mandeep Sandhu
  2015-04-07  3:10 ` Rock Lee
  2015-04-07 16:15 ` Lad, Prabhakar
  2 siblings, 1 reply; 7+ messages in thread
From: John de la Garza @ 2015-04-07  0:27 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Apr 06, 2015 at 03:50:41PM -0700, Mandeep Sandhu wrote:
> 
> I'm having trouble compiling my kernel using a 32-bit toolchain (for
> ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.
> 
> Any hints on how to get make to use the toolchain?
> 

after you export CROSS_COMPILE export ARCH=arm

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
  2015-04-06 22:50 cross-compiling kernel using a 32-bit toolchain on a 64-bit machine Mandeep Sandhu
  2015-04-07  0:27 ` John de la Garza
@ 2015-04-07  3:10 ` Rock Lee
  2015-04-07 16:04   ` Mandeep Sandhu
  2015-04-07 16:15 ` Lad, Prabhakar
  2 siblings, 1 reply; 7+ messages in thread
From: Rock Lee @ 2015-04-07  3:10 UTC (permalink / raw)
  To: kernelnewbies



On 2015/4/7 6:50, Mandeep Sandhu wrote:
> Hi All,
>
> I'm having trouble compiling my kernel using a 32-bit toolchain (for
> ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.
>
> I understand that 32-bit binaries require "ia32-libs" (or equivalent)
> for compiling on 64-bit hosts. I installed the required packages
> (lib32z1 lib32ncurses5 lib32bz2-1.0 for Ubuntu 14.10), but still keep
> getting errors:
>
> $ make CROSS_COMPILE=arm-none-linux-gnueabi- all
> Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
> -fstack-protector not supported by compiler
> make: arm-none-linux-gnueabi-gcc: Command not found
>    CHK     include/config/kernel.release
>    CHK     include/generated/uapi/linux/version.h
>    CHK     include/generated/utsrelease.h
> make[1]: `include/generated/mach-types.h' is up to date.
>    CC      kernel/bounds.s
> /bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
> make[1]: *** [kernel/bounds.s] Error 127
> make: *** [prepare0] Error 2
>
> I've ensured that the PATH to the toolchain binaries is correct.
>
> If I try to export CROSS_COMPILE to my environment, then too I get an
> error (although it's for a different reason):
>
> $ make all
> Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
> -fstack-protector not supported by compiler
>    CHK     include/config/kernel.release
>    CHK     include/generated/uapi/linux/version.h
>    CHK     include/generated/utsrelease.h
> make[1]: `include/generated/mach-types.h' is up to date.
>    CC      kernel/bounds.s
> gcc: error: unrecognized argument in option ?-mabi=aapcs-linux?
> gcc: note: valid arguments to ?-mabi=? are: ms sysv
> gcc: error: unrecognized command line option ?-mlittle-endian?
> gcc: error: unrecognized command line option ?-mapcs?
> gcc: error: unrecognized command line option ?-mno-sched-prolog?
> gcc: error: unrecognized command line option ?-mno-thumb-interwork?
> gcc: error: unrecognized command line option ?-mfpu=vfp?
> make[1]: *** [kernel/bounds.s] Error 1
> make: *** [prepare0] Error 2
>
> It looks like make is starting a new shell which does not have either
> PATH (1st case) or  CROSS_COMPILE (2nd case) set.
>
> Any hints on how to get make to use the toolchain?
>
> Thanks,
> -mandeep
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
Edit .config and set  CONFIG_CROSS_COMPILE to the path where your cross 
compiler is located.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
  2015-04-07  0:27 ` John de la Garza
@ 2015-04-07 15:59   ` Mandeep Sandhu
  0 siblings, 0 replies; 7+ messages in thread
From: Mandeep Sandhu @ 2015-04-07 15:59 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Apr 6, 2015 at 5:27 PM, John de la Garza <john@jjdev.com> wrote:
> On Mon, Apr 06, 2015 at 03:50:41PM -0700, Mandeep Sandhu wrote:
>>
>> I'm having trouble compiling my kernel using a 32-bit toolchain (for
>> ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.
>>
>> Any hints on how to get make to use the toolchain?
>>
>
> after you export CROSS_COMPILE export ARCH=arm
>

This didn't help. I get the same error as before.

Thanks,
-mandeep


>
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
  2015-04-07  3:10 ` Rock Lee
@ 2015-04-07 16:04   ` Mandeep Sandhu
  0 siblings, 0 replies; 7+ messages in thread
From: Mandeep Sandhu @ 2015-04-07 16:04 UTC (permalink / raw)
  To: kernelnewbies

> Edit .config and set  CONFIG_CROSS_COMPILE to the path where your cross
> compiler is located.

This doesn't help either! :/ I'll start afresh. Maybe my setup got
messed-up somehow.

Thanks anyway!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
  2015-04-06 22:50 cross-compiling kernel using a 32-bit toolchain on a 64-bit machine Mandeep Sandhu
  2015-04-07  0:27 ` John de la Garza
  2015-04-07  3:10 ` Rock Lee
@ 2015-04-07 16:15 ` Lad, Prabhakar
  2015-04-07 16:24   ` Mandeep Sandhu
  2 siblings, 1 reply; 7+ messages in thread
From: Lad, Prabhakar @ 2015-04-07 16:15 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Apr 6, 2015 at 11:50 PM, Mandeep Sandhu
<mandeepsandhu.chd@gmail.com> wrote:
> Hi All,
>
> I'm having trouble compiling my kernel using a 32-bit toolchain (for
> ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.
>
> I understand that 32-bit binaries require "ia32-libs" (or equivalent)
> for compiling on 64-bit hosts. I installed the required packages
> (lib32z1 lib32ncurses5 lib32bz2-1.0 for Ubuntu 14.10), but still keep
> getting errors:
>
> $ make CROSS_COMPILE=arm-none-linux-gnueabi- all
> Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
> -fstack-protector not supported by compiler
> make: arm-none-linux-gnueabi-gcc: Command not found

Have built this toolchain or just downloaded from coudesourcery ?
Go to the source where you downloaded toolchain (on your machine not
the website)
traverse to bin directory and try ./arm-none-linux-gnueabi-gcc --version.

Cheers,
--Prabhakar Lad

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cross-compiling kernel using a 32-bit toolchain on a 64-bit machine
  2015-04-07 16:15 ` Lad, Prabhakar
@ 2015-04-07 16:24   ` Mandeep Sandhu
  0 siblings, 0 replies; 7+ messages in thread
From: Mandeep Sandhu @ 2015-04-07 16:24 UTC (permalink / raw)
  To: kernelnewbies

So I found the issue (it was a PIBKAC issue :/)

I was using sudo to try and build the kernel (this was due to a messed
up setup where the whole kernel src tree ended up being written by
root). When copy-pasting my command here, I missed copying the sudo
part and that was precisely the reason for the error. When invoking
sudo, I think the current shells environment variables are not copied
(probably due to security reasons) and that's why it was not picking
up the toolchain paths.

Once I fixed the permissions on the source tree and invoke make as
regular user, it started working.

Sorry about the noise, I should've figured this out earlier.



On Tue, Apr 7, 2015 at 9:15 AM, Lad, Prabhakar
<prabhakar.csengg@gmail.com> wrote:
> On Mon, Apr 6, 2015 at 11:50 PM, Mandeep Sandhu
> <mandeepsandhu.chd@gmail.com> wrote:
>> Hi All,
>>
>> I'm having trouble compiling my kernel using a 32-bit toolchain (for
>> ARM) on a 64-bit host (Ubuntu 14.10). The kernel version is 3.14.17.
>>
>> I understand that 32-bit binaries require "ia32-libs" (or equivalent)
>> for compiling on 64-bit hosts. I installed the required packages
>> (lib32z1 lib32ncurses5 lib32bz2-1.0 for Ubuntu 14.10), but still keep
>> getting errors:
>>
>> $ make CROSS_COMPILE=arm-none-linux-gnueabi- all
>> Makefile:616: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR:
>> -fstack-protector not supported by compiler
>> make: arm-none-linux-gnueabi-gcc: Command not found
>
> Have built this toolchain or just downloaded from coudesourcery ?
> Go to the source where you downloaded toolchain (on your machine not
> the website)
> traverse to bin directory and try ./arm-none-linux-gnueabi-gcc --version.
>
> Cheers,
> --Prabhakar Lad

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-07 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-06 22:50 cross-compiling kernel using a 32-bit toolchain on a 64-bit machine Mandeep Sandhu
2015-04-07  0:27 ` John de la Garza
2015-04-07 15:59   ` Mandeep Sandhu
2015-04-07  3:10 ` Rock Lee
2015-04-07 16:04   ` Mandeep Sandhu
2015-04-07 16:15 ` Lad, Prabhakar
2015-04-07 16:24   ` Mandeep Sandhu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.