0

I'm trying to build a kernel for the Samsung Note 3 (SM-N900A). I'm running into a linker error:

LD init/mounts.o: fatal error: no input files

I'm understanding that to mean that there's no init/mounts.o file, which is the case...there isn't one, but I don't know why. When is it supposed to be generated?

I'm using the Android ndk cross-compiler (android-ndk-r10d).

I set the following variables in the Makefile in the kernel directory:

CROSS_COMPILE=arm-linux-androideabi- and ARCH=arm

I used the following commands to build the kernel:

$ make msm8974_sec_defconfig VARIANT_DEFCONFIG=msm8974_sec_hlteatt_defconfig SELINUX_DEFCONFIG=selinux_defconfig TIMA_DEFCONFIG=tima_defconfig
$ make

If I comment out the part that's trying to link init/mounts.o, I get this error:

LD init/built-in.o: fatal error: no input files

I think it might all be part of the same problem, but I have no idea why these files don't exist or when they're supposed to be generated.

If any has any ideas of what's happening, I'd love to hear. If more details are needed, let me know, and I'll supply them.

Thanks for your help.

Edit:

Here is my entire build output...

mweiss@mweiss-VirtualBox:~/Documents/Android/SharedFolder/SM-N900A_NA_JB_Opensource/kernel$ make
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
 make[1]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      init/main.o
  CHK     include/generated/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  CC      init/do_mounts_rd.o
  CC      init/do_mounts_initrd.o
  LD      init/mounts.o
arm-linux-androideabi-ld.gold: fatal error: no input files
scripts/Makefile.build:429: recipe for target 'init/mounts.o' failed
make[1]: *** [init/mounts.o] Error 1
Makefile:959: recipe for target 'init' failed
make: *** [init] Error 2

Line 959 of Makefile (in kernel) the Makefile is very long:

# build vmlinux.o first to catch section mismatch errors early
ifdef CONFIG_KALLSYMS
  .tmp_vmlinux1: vmlinux.o
endif

This is line 429 of scripts/Makefile.build

$(multi-used-y) : %.o: $(multi-objs-y) FORCE
    $(call if_changed,link_multi-y)

This is the Makefile in init/

obj-y := main.o version.o mounts.o

ifneq ($(CONFIG_BLK_DEV_INITRD),y)
  obj-y                          += noinitramfs.o
else
  obj-$(CONFIG_BLK_DEV_INITRD)   += initramfs.o
endif
obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o

mounts-y            := do_mounts.o
mounts-$(CONFIG_BLK_DEV_RAM)    += do_mounts_rd.o
mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o

# dependencies on generated files need to be listed explicitly
$(obj)/version.o: include/generated/compile.h

# compile.h changes depending on hostname, generation number, etc,
# so we regenerate it always.
# mkcompile_h will make sure to only update the
# actual file if its content has changed.

       chk_compile.h = :
 quiet_chk_compile.h = echo '  CHK     $@'
 silent_chk_compile.h = :
 include/generated/compile.h: FORCE
    @$($(quiet)chk_compile.h)
    $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
    "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC)        $(KBUILD_CFLAGS)"

If there's any more info that would be helpful, let me know.

Thanks for your help.

user1791622
  • 105
  • 1
  • 2
  • 8
  • posting the rest of the makefile would be very helpful – user3629249 Apr 18 '15 at 04:58
  • with the linker complaining about missing object files, there is probably a compile error before which you didn't show us. We need the very first error message to help you. – mfro Apr 18 '15 at 04:59
  • I edited my post to include my build output. The Makefile is very long, so I wasn't sure whether to post it. If you would like to see it, I'll post it...it's like 1500 lines long. It calls a lot of Makfiles in other directories. – user1791622 Apr 18 '15 at 19:08
  • what was the fix? – dazza5000 Jul 03 '19 at 12:31

0 Answers0