A
A
Alexander Semykin2018-05-14 13:55:50
linux
Alexander Semykin, 2018-05-14 13:55:50

What is wrong with building the embedded Linux kernel?

Gentlemen, I ran into a rather specific problem: I'm trying to build a Linux kernel for one piece of iron using buildroot. During the build process I get the following error:

CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      mm/ksm.o
  LD      sound/built-in.o
  CC      kernel/smp.o
In file included from include/linux/linkage.h:6:0,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:50,
                 from include/linux/mmzone.h:7,
                 from include/linux/gfp.h:5,
                 from include/linux/mm.h:9,
                 from mm/ksm.c:18:
include/linux/export.h:57:2: error: expected ‘,’ or ‘;’ before ‘extern’
  extern typeof(sym) sym;     \

In the export.h file, this fragment is used in a macro:
/* For every exported symbol, place a struct in the __ksymtab section */
#define __EXPORT_SYMBOL(sym, sec)				\
  extern typeof(sym) sym;					\
  __CRC_SYMBOL(sym, sec)					\
  static const char __kstrtab_##sym[]			\
  __attribute__((section("__ksymtab_strings"), aligned(1))) \
  = VMLINUX_SYMBOL_STR(sym);				\
  extern const struct kernel_symbol __ksymtab_##sym;	\
  __visible const struct kernel_symbol __ksymtab_##sym	\
  __used							\
  __attribute__((section("___ksymtab" sec "+" #sym), unused))	\
  = { (unsigned long)&sym, __kstrtab_##sym }

I don't see anything criminal in it. Moreover, it is a standard kernel macro. What is the build error?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question