I'm trying to build the version of Linux Kernel for versatile board but I got this error during the build step

init/mounts.o: In function `tty_port_users':
    do_mounts_initrd.c:(.text+0x0): multiple definition of `tty_port_users'
    init/main.o:main.c:(.text+0x0): first defined here
    scripts/Makefile.build:297: recipe for target 'init/built-in.o' failed
    make[1]: *** [init/built-in.o] Error 1
    Makefile:881: recipe for target 'init' failed
    make: *** [init] Error 2

I executed the following commands (In order)

  1. $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- versatile_defconfig
  2. $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage

The result of arm-linux-gnueabi-gcc -v

Using built-in specs. COLLECT_GCC=arm-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/5/lto-wrapper Target: arm-linux-gnueabi Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.2.1-22ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-armel-cross --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv5t --with-float=soft --disable-werror --enable-multilib --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include Thread model: posix gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu1)

I kown that version is very old I already tried the 4.2 version and everything went fine but I think there should be a way to solve this problem.
thanks for your interest

  • If 4.2 worked why do you need to get 2.6 working? – David King Dec 22 '15 at 14:21
  • please run the command arm-linux-gnueabi-gcc -v and post the output ... (PS: I couldn't find on kernel.org - latest in 2.6.32 series was – Murray Jensen Dec 22 '15 at 22:10
  • Hello @Murray Jensen I added the result of arm-linux-gnueabi-gcc -v to the post. thanks for your comment – Younes Dec 23 '15 at 10:18
  • Read this ... not sure that 2.6 kernels can be built with gcc4 or gcc5, but you could try adding the option -fgnu89-inline or similar ... by the way, the problem is that handling of functions declared extern inline has changed between compiler versions - tty_port_users is such a function and it appears that the compiler is emitting a copy of it in every C module that references it. See Section 6.41 [An Inline Function is As Fast As a Macro], page 446 of this – Murray Jensen Dec 23 '15 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.