[#7100] toolchain fails to build with newer kernel headers

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#7100] toolchain fails to build with newer kernel headers

Submitted By: Timur Aydin

Open Date

2012-05-06 09:30:32     Close Date

2013-07-03 04:07:03

Priority:

Medium     Assignee:

Nobody

Board:

N/A     Silicon Revision:

Resolution:

Fixed     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

Gentoo Linux (~x86 testing)

toolchain rev.:

2011R1     kernel rev.:

2011R1

State:

Closed     Found In Release:

N/A

Is this bug repeatable?:

N/A     

Summary: toolchain fails to build with newer kernel headers

Details:

 

I am building the 2011R1 branch version of the toolchain and it fails with the following error (complete log attached as well):

 

gcc -c -DHAVE_CONFIG_H   -DWITH_DEFAULT_MODEL='"bf537"'  -DPROFILE=1 -DWITH_PROFILE=-1   -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT  -DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN -DWITH_ENVIRONMENT=ALL_ENVIRONMENT  -DWITH_HW=1 -DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN        -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized    -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL   -DHAVE_SDL   -I. -I/home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin -I../common -I/home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/../common -I../../include -I/home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/../../include -I../../bfd -I/home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/../../bfd -I../../opcodes -I/home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/../../opcodes  -g -O2 /home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/dv-eth_phy.c

In file included from /usr/include/linux/ethtool.h:17:0,

                 from /usr/include/linux/mii.h:12,

                 from /home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/dv-eth_phy.c:31:

/usr/include/linux/if_ether.h:130:2: error: expected specifier-qualifier-list before '__be16'

In file included from /usr/include/linux/mii.h:12:0,

                 from /home/ta/uclinux_2011R1/tc/binutils-2.17/sim/bfin/dv-eth_phy.c:31:

/usr/include/linux/ethtool.h:21:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:47:7: error: expected declaration specifiers or '...' before '__u32'

/usr/include/linux/ethtool.h: In function 'ethtool_cmd_speed_set':

/usr/include/linux/ethtool.h:50:4: error: 'struct ethtool_cmd' has no member named 'speed'

/usr/include/linux/ethtool.h:50:21: error: 'speed' undeclared (first use in this function)

/usr/include/linux/ethtool.h:50:21: note: each undeclared identifier is reported only once for each function it appears in

/usr/include/linux/ethtool.h:51:4: error: 'struct ethtool_cmd' has no member named 'speed_hi'

/usr/include/linux/ethtool.h: At top level:

/usr/include/linux/ethtool.h:54:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ethtool_cmd_speed'

/usr/include/linux/ethtool.h:63:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:88:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:96:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:102:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:110:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:190:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:217:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:254:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:267:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:295:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:302:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:331:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:340:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:346:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:385:2: error: expected specifier-qualifier-list before '__be32'

/usr/include/linux/ethtool.h:402:2: error: expected specifier-qualifier-list before '__be32'

/usr/include/linux/ethtool.h:420:2: error: expected specifier-qualifier-list before '__be32'

/usr/include/linux/ethtool.h:436:2: error: expected specifier-qualifier-list before '__u8'

/usr/include/linux/ethtool.h:440:2: error: expected specifier-qualifier-list before '__be16'

/usr/include/linux/ethtool.h:461:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:523:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:546:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:568:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:596:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:607:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:625:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:642:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:656:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:667:2: error: expected specifier-qualifier-list before '__u32'

/usr/include/linux/ethtool.h:678:2: error: expected specifier-qualifier-list before '__u32'

make[2]: *** [dv-eth_phy.o] Error 1

make[2]: Leaving directory `/home/ta/uclinux_2011R1/tcbuild/gdb_build/sim/bfin'

make[1]: *** [all] Error 1

make[1]: Leaving directory `/home/ta/uclinux_2011R1/tcbuild/gdb_build/sim'

make: *** [all-sim] Error 2

 

Follow-ups

 

--- Timur Aydin                                              2012-05-06 10:34:06

I debugged this problem and found that the following patch resolves the issue:

 

diff --git a/binutils-2.17/sim/bfin/dv-eth_phy.c

b/binutils-2.17/sim/bfin/dv-eth_phy.c

index 56aad6f..65203d0 100644

--- a/binutils-2.17/sim/bfin/dv-eth_phy.c

+++ b/binutils-2.17/sim/bfin/dv-eth_phy.c

@@ -25,9 +25,7 @@

 

#ifdef HAVE_LINUX_MII_H

 

-/* Workaround old/broken linux headers.  */

-#define _LINUX_TYPES_H

-#define __u16 unsigned short

+#include <linux/types.h>

#include <linux/mii.h>

 

It seems because some systems have a broken <linux/types.h> header file,

this header was removed and instead some types have been defined inline. But

with my development PC, which currently has linux kernel 3.3.0 installed, using

this header doesn't cause any problems.

 

--- Timur Aydin                                              2012-05-06 10:37:56

Here is the build command line:

 

./BuildToolChain -s /home/ta/uclinux_2011R1/tc -b

/home/ta/uclinux_2011R1/tcbuild -O /home/ta/uclinux_2011R1/toolchain -u

/home/ta/uclinux_2011R1/db1/u-boot -k /home/ta/uclinux_2011R1/db1/linux-kernel

 

--- Mike Frysinger                                           2012-05-06 14:46:43

this has been fixed in the tree already:

http://blackfin.uclinux.org/git/?p=readonly-mirrors/toolchain.git;a=commitdiff;h=257deb79504f769106a6bbe6e1e50bb8161550a4

 

--- Mingquan Pan                                             2013-07-03 05:10:30

So close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

log    application/octet-stream    453789    Timur Aydin

Attachments

Outcomes