Cannot build root filesystem using Buildroot on Ubuntu 14.10

Asked by JeffreyK

 Hello,

    I'm building Linux kernel and root filesystem for Arrow SoCKit.

    I've installed cross compiler on Ubuntu 14.10 machine:
    $ sudo apt-get install gcc-arm-linux-gnueabihf
    $ arm-linux-gnueabihf-gcc --version
    arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.9.1-16ubuntu6) 4.9.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    The cross-compiler works. I've used it to build kernel for Arrow SoCKit:
    $ make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm socfpga_defconfig
    $ alias armmake='make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm' <--I put this into .profile
    $ armmake -j4 uImage LOADADDR=0x8000 <-- this produced the expected uImage

    But then I run into problem trying to build root fs for SoCKit using Buildroot-2014.11:
    $ make menuconfig
    Within Buildroot menuconfig I set the Toolchain as follows:
    Toolchain type (External toolchain) --->
    Toolchain (Custom toolchain) --->
    Toolchain origin (Pre-installed toolchain) --->
    (/usr/) Toolchain path
    (arm-linux-gnueabihf) Toolchain prefix
    External toolchain kernel headers series (3.1.x) --->
    External toolchain C library (glibc/eglibc) ---> [*] Toolchain has RPC support? [*] Toolchain has C++ support?
    () Extra toolchain libraries to be copied to target
    [ ] Copy gdb server to the Target
    [ ] Build cross gdb for the host
    [ ] Purge unwanted locales
    () Generate locale data
    [ ] Copy gconv libraries [*] Enable MMU support
    (-pipe) Target Optimizations
    () Target linker options
    [ ] Register toolchain within Eclipse Buildroot plug-in

    Then run make and get the following error:
    $ make
    /usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
    make[1]: Entering directory '/home/jeff/buildroot-2014.11'
    BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/home/jeff/buildroot-2014.11/output/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/jeff/buildroot-2014.11/output/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/jeff/buildroot-2014.11/output/build/buildroot-config/tristate.config BR2_CONFIG=/home/jeff/buildroot-2014.11/.config BR2_EXTERNAL=support/dummy-external /home/jeff/buildroot-2014.11/output/build/buildroot-config/conf --silentoldconfig Config.in
    make[1]: Leaving directory '/home/jeff/buildroot-2014.11'
    >>> toolchain-external undefined Configuring
    cc1: fatal error: /usr/arm-linux-gnueabihf//usr/include/linux/version.h: No such file or directory
    compilation terminated.
    support/scripts/check-kernel-headers.sh: 38: support/scripts/check-kernel-headers.sh: /tmp/check-headers.uAeguv: Permission denied
    package/pkg-generic.mk:172: recipe for target '/home/jeff/buildroot-2014.11/output/build/toolchain-external-undefined/.stamp_configured' failed
    make: *** [/home/jeff/buildroot-2014.11/output/build/toolchain-external-undefined/.stamp_configured] Error 1

    I've used Buildroot in Arch Linux without encountering the above problem. I'm new to Ubuntu, and can't figure out what is going wrong.

    Can anyone help? Thanks!

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu gcc-defaults-armhf-cross Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Michal Gonda (mipo01) said :
#2

Try to analyze this output:
cc1: fatal error: /usr/arm-linux-gnueabihf//usr/include/linux/version.h: No such file or directory
    compilation terminated.

I suppose this should help you.

Revision history for this message
Wojtek Zabołotny (wzab01) said :
#3

I have faced the similar problem on Arch Linux
The situation was even stranger, because there was no clear error message from the compiler.
Just the

  /tmp/check-headers.uAeguv: Permission denied

The reason was, that the /tmp directory was mounted with "noexec" option.
To cure it, I had to change the following lines in the /etc/fstab:

# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid,noexec,size=2G 0 0

into:

# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid,size=2G 0 0

So that's another possible problem with Buildroot. The system must be configured to allow
execution of files in /tmp

Revision history for this message
Francois Gervais (dc-fgervais) said :
#4

Wow many thanks @Wojtek Zabołotny.

I would have searched forever if I wouldn't have found this old reply of yours. I'm on docker, I mounted /tmp as tmpfs and it seems that by default it is mounted with noexec.

In my case the cure was to change my compose file to:

tmpfs:
    - /tmp:exec

Thanks again, I would upvote if this would be a thing here.