kernel 4.1 compilation issues

487 views
Skip to first unread message

Dallas Clement

unread,
Jul 3, 2015, 7:49:11 PM7/3/15
to beagl...@googlegroups.com
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

William Hermans

unread,
Jul 3, 2015, 9:57:09 PM7/3/15
to beagl...@googlegroups.com
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.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Jul 3, 2015, 9:58:49 PM7/3/15
to beagl...@googlegroups.com
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.

William Hermans

unread,
Jul 3, 2015, 10:02:05 PM7/3/15
to beagl...@googlegroups.com
Sorry function *or* global variable would be more correct.

Dallas Clement

unread,
Jul 3, 2015, 10:47:03 PM7/3/15
to beagl...@googlegroups.com
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

ro...@buy-ei.com

unread,
Jul 3, 2015, 11:34:09 PM7/3/15
to beagl...@googlegroups.com
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 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:
=============================================================================
root@bbb-greenbox2:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

auto ra0
iface ra0 inet dhcp
wpa-ssid "WORKSHOP"
wpa-psk "NEWSLANE1234"

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
# wpa-ssid "essid"
# wpa-psk "password"
======================================================================



here are the contents of my /etc/wpa_supplicant/wpa_supplicant.conf file:
the psk="xxxxxx" is set appropriately
=============================================================================
root@bbb-greenbox2:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant GROUP=netdev
ctrl_interface_group=0
ap_scan=1
update_config=1
network={
ssid="WORKSHOP"
psk="xxxxxxxx"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
auth_alg=OPEN
eap=TTLS PEAP TLS
}

========================================================================

Any ideas would certainly be appreciated in resolving this.
I'm booting with the ethernet cable removed

Thanks,
Ross



William Hermans

unread,
Jul 3, 2015, 11:51:20 PM7/3/15
to beagl...@googlegroups.com
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 :)

ro...@buy-ei.com

unread,
Jul 3, 2015, 11:54:31 PM7/3/15
to beagl...@googlegroups.com
Found a mistake in my info below, I copied a testing
/etc/network/interfaces file, here is the real one:

=========================================================================
root@bbb-greenbox2:/etc/network# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

auto ra0
iface ra0 inet dhcp
wireless-essid any
wireless-mode managed
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
# wpa-ssid "essid"
# wpa-psk "password"

======================================================================

> wpa-psk "xxxxxxxxxxxxxx"
> --
> For more options, visit http://beagleboard.org/discuss
> ---You received this message because you are subscribed to the

William Hermans

unread,
Jul 4, 2015, 12:26:53 AM7/4/15
to beagl...@googlegroups.com
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.

Dallas Clement

unread,
Jul 4, 2015, 12:39:24 PM7/4/15
to beagl...@googlegroups.com
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

ro...@buy-ei.com

unread,
Jul 5, 2015, 12:42:58 PM7/5/15
to beagl...@googlegroups.com
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

weiss....@gmail.com

unread,
May 17, 2016, 3:29:10 PM5/17/16
to BeagleBoard
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.
Reply all
Reply to author
Forward
0 new messages