kernel 4.1 compilation issues

Hi,

I attempted to upgrade from the kernel from 3.14 to 4.1 today. I’m getting some compilation issues which seem to be caused by certain dynamically generated function definitions not being declared static inline in include/linux/of.h. If I hand edit this file and add a static inline in front of the function definitions, compilation proceeds successfully with no errors. It looks like maybe these functions are added dynamically to this header file during compilation.

arch/arm/kernel/time.o: In function of_changeset_add_property_u32': /home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1116: multiple definition of of_changeset_add_property_u32’
arch/arm/kernel/setup.o:/home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1116: first defined here
arch/arm/kernel/time.o: In function of_changeset_add_property_copy': /home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/arch/arm/kernel/time.c:61: multiple definition of of_changeset_add_property_copy’
arch/arm/kernel/setup.o:/home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/arch/arm/kernel/setup.c:1116: first defined here
arch/arm/kernel/time.o: In function of_changeset_add_property_string': /home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1089: multiple definition of of_changeset_add_property_string’
arch/arm/kernel/setup.o:/home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1089: first defined here
arch/arm/kernel/time.o: In function of_changeset_add_property_bool': /home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1122: multiple definition of of_changeset_add_property_bool’
arch/arm/kernel/setup.o:/home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1122: first defined here
arch/arm/kernel/time.o: In function of_changeset_add_property_string_list': /home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1110: multiple definition of of_changeset_add_property_string_list’
arch/arm/kernel/setup.o:/home/dallas/projects/mineredge/me-1.6/standard-firmware/buildroot/output/build/linux-4.1/include/linux/of.h:1110: first defined here

Would appreciate any help anyone can provide.

Dallas

arch/arm/kernel/time.o: In function `of_changeset_add_property_u32’:

/**home/dallas/projects/****mineredge/me-1.6/standard-****firmware/buildroot/output/****build/linux-4.1/include/linux/**of.h:1116: multiple definition of `of_changeset_add_property_u32’

So, I do not know everything when it comes to building the kernel. You definitely have multiple definitions happening between object / header files.

What is the correlation between arch/arm/kernel/ and the header files in your home directory ? Do you have multiple sets of kernel files on the system ( for the BBB, for different kernels ) and in use ? If so may have the path to the header files set incorrectly, for the kernel you’re trying to build. If the path is set correctly, then “make clean” before running “make” may be in order.

Unfortunately, I am not all that familiar with buildroot, or arch so I suppose this could be desired behavior ( your directory structure ), but from the outside looking in, it seems suspect.

Also, the static keyword in this context would be meant to limit scope of a function to the file in which is resides, It does not seem correct to me, but that does not mean I’m right either.

Sorry function or global variable would be more correct.

Hi William. Thanks for the reply. I think the more important thing is that this function should be declared “inline”. Adding this to these functions in of.h seems to allow the kernel to compile successfully without multiple declaration issues.

Btw, this problem is very easy to reproduce.

Just do the following on the 4.1 branch.

ARCH=arm make omap2plus_defconfig

ARCH=arm CROSS_COMPILE=…/dl/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make zImage

Hi all and happy 4th to my US colleagues.

root@bbb-greenbox2:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2015-06-29

root@bbb-greenbox2:~# uname -a
Linux bbb-greenbox2 4.1.0-bone9 #1 Wed Jun 24 03:18:08 UTC 2015 armv7l GNU/Linux

I'm trying to get a Logic Supply USB UWN200 WiFi adapter running on my BBB. I've installed the latest console testing image 4.1 Debian on a uSD card. Everything is working except when the request for a DHCP address is sent, no address is returned.

root@bbb-greenbox2:~# ifup ra0

Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/ra0/00:0c:43:00:00:38
Sending on LPF/ra0/00:0c:43:00:00:38
Sending on Socket/fallback
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 15
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
root@bbb-greenbox2:~#

here are the contents of my /etc/network/interfaces file:

Ah yeah I’ve always found the inline keyword a bit confusing but revisiting some documentation it does make sense in a case such as this.

Also, hah ! I’m not sure why, but I read "arch/arm/kernel/" as if you were using arch ( the distro ) . . . silly me.

I also did a google search on various parts of the output you pasted, and nothing relevant came to my attention. I was hoping to help, and in the process learn something new myself . . . as in my nature, but it seems in this case I was not quite so helpful. One thing I did notice. Was that this must be a very new “issue”. Some searches only yielded this post, and mail archive posts related to this. e.g. 1-3 total hits depending on which part of the output to search for.

Anyway, if you figure it out let us know :slight_smile:

Found a mistake in my info below, I copied a testing /etc/network/interfaces file, here is the real one:

Have you read this yet ? http://inspire.logicsupply.com/2014/07/beaglebone-wifi-installation.html

Comments I’ve read in the past indicate that problem related to this wifi adapter range from non working drivers for distro’s other than Angstrom ( until you compile your own ), and USB power not being enough when using one of these adapters.

The link above recommends a 2A barrel jack power supply. But please do read for yourself if you have not yet.

It seems that the file include/linux/of.h gets modified during the kernel configuration process. If after configuring the kernel I change the problem functions to be static inline, the 4.1 kernel builds fine for the am335x.

$(SED) ‘s/int of_changeset_add_property_copy(/static inline int of_changeset_add_property_copy(/’ $(@D)/include/linux/of.h
$(SED) ‘s/int of_changeset_add_property_string(/static inline int of_changeset_add_property_string(/’ $(@D)/include/linux/of.h
$(SED) ‘s/int of_changeset_add_property_string_list(/static inline int of_changeset_add_property_string_list(/’ $(@D)/include/linux/of.h
$(SED) ‘s/int of_changeset_add_property_u32(/static inline int of_changeset_add_property_u32(/’ $(@D)/include/linux/of.h
$(SED) ‘s/int of_changeset_add_property_bool(/static inline int of_changeset_add_property_bool(/’ $(@D)/include/linux/of.h

Simple solution, first I compared a running lxqt image on a BBB, then simply apt-get install wpasupplicant on my console image and all works fine now.

Got to watch that console image, very basic (which is good).

Ross

Quoting William Hermans <yyrkoon@gmail.com>:

The answer of your problem is to turn ON the flag CONFIG_OF_DYNAMIC into your .config, please do not patch the kernel, that’s not a right approach.