LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-21-2020, 03:44 PM   #1
jiapei100
Member
 
Registered: Jan 2005
Location: Surrey, BC, Canada
Distribution: Ubuntu 12.04
Posts: 70

Rep: Reputation: 15
Failed to build Kernel 4.9 on Jetson Nano


Error messages:

Code:
In file included from ....../kernel-4.9/include/asm-generic/bug.h:13:0,
                 from ....../kernel-4.9/arch/arm64/include/asm/bug.h:67,
                 from ....../kernel-4.9/include/linux/bug.h:4,
                 from ....../kernel-4.9/arch/arm64/include/asm/cmpxchg.h:21,
                 from ....../kernel-4.9/arch/arm64/include/asm/atomic.h:41,
                 from ....../kernel-4.9/include/linux/atomic.h:4,
                 from ....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c:13:
....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c: In function ‘tegra_channel_s_parm’:
....../kernel-4.9/include/linux/kernel.h:838:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                ^
....../nvidia/include/media/mc_common.h:265:2: note: in expansion of macro ‘container_of’
  container_of(vdev, struct tegra_channel, video)
  ^~~~~~~~~~~~
....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c:2029:37: note: in expansion of macro ‘to_tegra_channel’
        struct tegra_channel *chan = to_tegra_channel(vfh->vdev);
                                     ^~~~~~~~~~~~~~~~
....../kernel-4.9/include/linux/kernel.h:838:48: note: (near initialization for ‘chan’)
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                ^
....../nvidia/include/media/mc_common.h:265:2: note: in expansion of macro ‘container_of’
  container_of(vdev, struct tegra_channel, video)
  ^~~~~~~~~~~~
....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c:2029:37: note: in expansion of macro ‘to_tegra_channel’
        struct tegra_channel *chan = to_tegra_channel(vfh->vdev);
                                     ^~~~~~~~~~~~~~~~
....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c: In function ‘tegra_channel_g_parm’:
....../kernel-4.9/include/linux/kernel.h:838:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                ^
....../nvidia/include/media/mc_common.h:265:2: note: in expansion of macro ‘container_of’
  container_of(vdev, struct tegra_channel, video)
  ^~~~~~~~~~~~
....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c:2039:37: note: in expansion of macro ‘to_tegra_channel’
        struct tegra_channel *chan = to_tegra_channel(vfh->vdev);
                                     ^~~~~~~~~~~~~~~~
....../kernel-4.9/include/linux/kernel.h:838:48: note: (near initialization for ‘chan’)
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                ^
....../nvidia/include/media/mc_common.h:265:2: note: in expansion of macro ‘container_of’
  container_of(vdev, struct tegra_channel, video)
  ^~~~~~~~~~~~
....../nvidia/drivers/media/platform/tegra/camera/vi/channel.c:2039:37: note: in expansion of macro ‘to_tegra_channel’
        struct tegra_channel *chan = to_tegra_channel(vfh->vdev);
                                     ^~~~~~~~~~~~~~~~
  LD      drivers/media/platform/tegra-vivid/built-in.o
  CC      drivers/media/platform/tegra/camera/camera_gpio.o
cc1: all warnings being treated as errors
....../kernel-4.9/scripts/Makefile.build:335: recipe for target 'drivers/media/platform/tegra/camera/vi/channel.o' failed
make[7]: *** [drivers/media/platform/tegra/camera/vi/channel.o] Error 1
....../kernel-4.9/scripts/Makefile.build:649: recipe for target 'drivers/media/platform/tegra/camera/vi' failed
make[6]: *** [drivers/media/platform/tegra/camera/vi] Error 2
make[6]: *** Waiting for unfinished jobs....
  CC      drivers/media/platform/tegra/mipical/mipi_cal.o
....../kernel-4.9/scripts/Makefile.build:649: recipe for target 'drivers/media/platform/tegra/camera' failed
make[5]: *** [drivers/media/platform/tegra/camera] Error 2
make[5]: *** Waiting for unfinished jobs....
  CC      drivers/media/platform/tegra/mipical/vmipi/vmipi.o
  LD      drivers/media/platform/tegra/mipical/built-in.o
....../kernel-4.9/scripts/Makefile.build:649: recipe for target 'drivers/media/platform/tegra' failed
make[4]: *** [drivers/media/platform/tegra] Error 2
....../kernel-4.9/scripts/Makefile.build:649: recipe for target 'drivers/media/platform' failed
make[3]: *** [drivers/media/platform] Error 2
....../kernel-4.9/scripts/Makefile.build:649: recipe for target 'drivers/media' failed
make[2]: *** [drivers/media] Error 2
....../kernel-4.9/Makefile:1104: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '........../kernel_out'
Makefile:171: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2


Line 838 in file ....../kernel-4.9/include/linux/kernel.h is:

Code:
 837 #define container_of(ptr, type, member) ({          \
 838     const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
 839     (type *)( (char *)__mptr - offsetof(type,member) );})

My Compiler is gcc/g++ 7.5.0 .


Code:
➜  kernel-4.9 gcc --version
gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 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.

➜  kernel-4.9 g++ --version
g++ (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 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.

Can anybody give me a hand?

Cheers
Pei
 
Old 04-02-2020, 10:07 PM   #2
Forsland
LQ Newbie
 
Registered: Apr 2020
Posts: 3

Rep: Reputation: Disabled
sudo apt install build-essential fakeroot libc6-dev gcc g++ dpkg-dev

If apt complains that i depends on some package, include that one too in the line above.

compile with

make deb-pkg

it should build 4 deb packages one linux-image-4.9.0_4.9-1-amd64.deb (if you are on an Intel 64bit or AMD 64bit)
One image package for debugging, a kernel headers package, and a libc-dev package.

That is if you get kernel tarballs from kernel.org. I don't know how to compile .deb source packages.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Robot kit builds on Jetson Nano LXer Syndicated Linux News 0 07-31-2019 04:30 AM
LXer: Jetson Nano gains 3.4-megapixel HD camera LXer Syndicated Linux News 0 05-18-2019 05:15 AM
LXer: Trimmed-down Jetson Nano module ships on $99 Linux dev kit LXer Syndicated Linux News 0 03-20-2019 12:10 AM
LXer: Nano-iTX carrier for Jetson TX2 offers mini-PCIe add-ons LXer Syndicated Linux News 0 04-15-2017 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration