LTIB Error "Failed building dtc"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LTIB Error "Failed building dtc"

Jump to solution
2,361 Views
fireas
Contributor I

Hello,

 

today I tried to get ltib running the second day - without success.

I used it on Ubuntu 8.04, 9.04 and 10.04.

It's always the same error "Failed building dtc".

I installed LTIB (everythings ok), installed the packages needed and tried to execute ./ltib.

It works about half an hour and then stops with the error.

The log-file:

 

 

Executing(%build): /bin/sh -e /home/maa/LTIB/ltib-e500mc-20091218/tmp/rpm-tmp.16839+ umask 022+ cd /opt/freescale/ltib/usr/src/rpm/BUILD+ cd dtc-1.2.0+ [ host == host ][: 1: ==: unexpected operator+ /usr/bin/make CC=/usr/bin/gcc -mcpu=host -msoft-float -idirafter //usr/include AS=/usr/bin/gcc -mcpu=host -msoft-float -idirafter //usr/include LD=/usr/bin/gcc -mcpu=host -msoft-float -C /opt/freescale/ltib/usr/src/rpm/BUILD/dtc-1.2.0make: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/dtc-1.2.0'     DEP tests/dumptrees.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/dumptrees.c:0: error: bad value (host) for -mtune= switch     DEP tests/trees.S`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/trees.S:0: error: bad value (host) for -mtune= switch     DEP tests/testutils.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/testutils.c:0: error: bad value (host) for -mtune= switch     DEP tests/value-labels.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/value-labels.c:0: error: bad value (host) for -mtune= switch     DEP tests/asm_tree_dump.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/asm_tree_dump.c:0: error: bad value (host) for -mtune= switch     DEP tests/truncated_property.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/truncated_property.c:0: error: bad value (host) for -mtune= switch     DEP tests/path_offset_aliases.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/path_offset_aliases.c:0: error: bad value (host) for -mtune= switch     DEP tests/add_subnode_with_nops.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/add_subnode_with_nops.c:0: error: bad value (host) for -mtune= switch     DEP tests/dtbs_equal_ordered.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/dtbs_equal_ordered.c:0: error: bad value (host) for -mtune= switch     DEP tests/incbin.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/incbin.c:0: error: bad value (host) for -mtune= switch     DEP tests/boot-cpuid.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/boot-cpuid.c:0: error: bad value (host) for -mtune= switch     DEP tests/path-references.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/path-references.c:0: error: bad value (host) for -mtune= switch     DEP tests/references.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/references.c:0: error: bad value (host) for -mtune= switch     DEP tests/string_escapes.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/string_escapes.c:0: error: bad value (host) for -mtune= switch     DEP tests/del_node.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/del_node.c:0: error: bad value (host) for -mtune= switch     DEP tests/del_property.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/del_property.c:0: error: bad value (host) for -mtune= switch     DEP tests/setprop.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/setprop.c:0: error: bad value (host) for -mtune= switch     DEP tests/set_name.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/set_name.c:0: error: bad value (host) for -mtune= switch     DEP tests/rw_tree1.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/rw_tree1.c:0: error: bad value (host) for -mtune= switch     DEP tests/open_pack.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/open_pack.c:0: error: bad value (host) for -mtune= switch     DEP tests/nopulate.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/nopulate.c:0: error: bad value (host) for -mtune= switch     DEP tests/mangle-layout.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/mangle-layout.c:0: error: bad value (host) for -mtune= switch     DEP tests/move_and_save.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/move_and_save.c:0: error: bad value (host) for -mtune= switch     DEP tests/sw_tree1.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/sw_tree1.c:0: error: bad value (host) for -mtune= switch     DEP tests/nop_node.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/nop_node.c:0: error: bad value (host) for -mtune= switch     DEP tests/nop_property.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/nop_property.c:0: error: bad value (host) for -mtune= switch     DEP tests/setprop_inplace.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/setprop_inplace.c:0: error: bad value (host) for -mtune= switch     DEP tests/notfound.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/notfound.c:0: error: bad value (host) for -mtune= switch     DEP tests/get_alias.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/get_alias.c:0: error: bad value (host) for -mtune= switch     DEP tests/node_offset_by_compatible.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/node_offset_by_compatible.c:0: error: bad value (host) for -mtune= switch     DEP tests/node_check_compatible.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/node_check_compatible.c:0: error: bad value (host) for -mtune= switch     DEP tests/node_offset_by_phandle.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/node_offset_by_phandle.c:0: error: bad value (host) for -mtune= switch     DEP tests/node_offset_by_prop_value.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/node_offset_by_prop_value.c:0: error: bad value (host) for -mtune= switch     DEP tests/parent_offset.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/parent_offset.c:0: error: bad value (host) for -mtune= switch     DEP tests/supernode_atdepth_offset.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/supernode_atdepth_offset.c:0: error: bad value (host) for -mtune= switch     DEP tests/get_path.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/get_path.c:0: error: bad value (host) for -mtune= switch     DEP tests/get_phandle.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/get_phandle.c:0: error: bad value (host) for -mtune= switch     DEP tests/getprop.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/getprop.c:0: error: bad value (host) for -mtune= switch     DEP tests/get_name.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/get_name.c:0: error: bad value (host) for -mtune= switch     DEP tests/path_offset.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/path_offset.c:0: error: bad value (host) for -mtune= switch     DEP tests/subnode_offset.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/subnode_offset.c:0: error: bad value (host) for -mtune= switch     DEP tests/find_property.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/find_property.c:0: error: bad value (host) for -mtune= switch     DEP tests/root_node.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/root_node.c:0: error: bad value (host) for -mtune= switch     DEP tests/get_mem_rsv.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.tests/get_mem_rsv.c:0: error: bad value (host) for -mtune= switch     DEP libfdt/fdt_strerror.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.libfdt/fdt_strerror.c:0: error: bad value (host) for -mtune= switch     DEP libfdt/fdt_rw.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.libfdt/fdt_rw.c:0: error: bad value (host) for -mtune= switch     DEP libfdt/fdt_sw.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.libfdt/fdt_sw.c:0: error: bad value (host) for -mtune= switch     DEP libfdt/fdt_wip.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.libfdt/fdt_wip.c:0: error: bad value (host) for -mtune= switch     DEP libfdt/fdt_ro.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.libfdt/fdt_ro.c:0: error: bad value (host) for -mtune= switch     DEP libfdt/fdt.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.libfdt/fdt.c:0: error: bad value (host) for -mtune= switch     DEP ftdump.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.ftdump.c:0: error: bad value (host) for -mtune= switch     LEX convert-dtsv0-lexer.lex.c     DEP convert-dtsv0-lexer.lex.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.convert-dtsv0-lexer.lex.c:0: error: bad value (host) for -mtune= switch     DEP util.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.util.c:0: error: bad value (host) for -mtune= switch     DEP srcpos.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.srcpos.c:0: error: bad value (host) for -mtune= switch     BISON dtc-parser.tab.c     DEP dtc-parser.tab.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.dtc-parser.tab.c:0: error: bad value (host) for -mtune= switch     LEX dtc-lexer.lex.c     DEP dtc-lexer.lex.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.dtc-lexer.lex.c:0: error: bad value (host) for -mtune= switch     DEP treesource.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.treesource.c:0: error: bad value (host) for -mtune= switch     DEP livetree.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.livetree.c:0: error: bad value (host) for -mtune= switch     DEP fstree.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.fstree.c:0: error: bad value (host) for -mtune= switch     DEP flattree.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.flattree.c:0: error: bad value (host) for -mtune= switch     DEP dtc.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.dtc.c:0: error: bad value (host) for -mtune= switch     DEP data.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.data.c:0: error: bad value (host) for -mtune= switch     DEP checks.c`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.checks.c:0: error: bad value (host) for -mtune= switch     CC srcpos.o`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.srcpos.c:1: error: bad value (host) for -mtune= switchmake: *** [srcpos.o] Error 1make: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/dtc-1.2.0'error: Bad exit status from /home/maa/LTIB/ltib-e500mc-20091218/tmp/rpm-tmp.16839 (%build)RPM build errors:    Bad exit status from /home/maa/LTIB/ltib-e500mc-20091218/tmp/rpm-tmp.16839 (%build)Build time for dtc: 2 secondsFailed building dtcDied at ./ltib line 1380.traceback: main::build_host_rpms:1380  main::host_checks:1435   main:542Started: Mon May  3 17:59:22 2010Ended:   Mon May  3 18:24:34 2010Elapsed: 1512 secondsThese packages failed to build:dtcBuild Failed

Can someone help me to get it running?

Seems to me that it's an ubuntu problem, cause i had no problems using it with suse 9.0!?

But the FAQ-file in the subdirectory /doc/ says that it should run with ubuntu 8.04!

 

Thanks in advance for every hint!

 

 

0 Kudos
Reply
1 Solution
1,134 Views
ronco
NXP Employee
NXP Employee

When ltib tries to build the host side packages, it invokes "rpmbuild". This tool apparently creates temporary scripts which then do the work.  One of these temp scripts created for the host side dtc build contains a line:

--------------------------------------------------------------------------------
if [ $PLATFORM == host ]
--------------------------------------------------------------------------------

 
and "$PLATFORM" expands to "host".
 
As it turns out though, Ubuntu 9.04 uses dash as default "/bin/sh" link for running the script, which does not like that script line at all, complains about it, takes the wrong path in the script, and causes the build failure.
 

--------------------------------------------------------------------------------
+ [ host == host ]
[: 1: host: unexpected operator
+ /usr/bin/make CC=/usr/bin/gcc -mcpu=host -msoft-float -idirafter //usr/include AS=/usr/bin/gcc -mcpu=host -msoft-float -idirafter //usr/include LD=/usr/bin/gcc -mcpu=host -msoft-float -C /opt/freescale/ltib/usr/src/rpm/BUILD/dtc-1.2.0
--------------------------------------------------------------------------------

 
On the Ubuntu web is the following:

--------------------------------------------------------------------------------
The [ command (a.k.a. test) must be used carefully in portable scripts. A very common pitfall is to use the == operator, which is a bashism; use = instead.
--------------------------------------------------------------------------------


The easiest way to work around this problem invoke the /bin/bash shell and then run ltib.  I hope this helps.

Regards,
Ron

View solution in original post

0 Kudos
Reply
3 Replies
1,134 Views
fireas
Contributor I

It seems that noone knows about this error!?

0 Kudos
Reply
1,135 Views
ronco
NXP Employee
NXP Employee

When ltib tries to build the host side packages, it invokes "rpmbuild". This tool apparently creates temporary scripts which then do the work.  One of these temp scripts created for the host side dtc build contains a line:

--------------------------------------------------------------------------------
if [ $PLATFORM == host ]
--------------------------------------------------------------------------------

 
and "$PLATFORM" expands to "host".
 
As it turns out though, Ubuntu 9.04 uses dash as default "/bin/sh" link for running the script, which does not like that script line at all, complains about it, takes the wrong path in the script, and causes the build failure.
 

--------------------------------------------------------------------------------
+ [ host == host ]
[: 1: host: unexpected operator
+ /usr/bin/make CC=/usr/bin/gcc -mcpu=host -msoft-float -idirafter //usr/include AS=/usr/bin/gcc -mcpu=host -msoft-float -idirafter //usr/include LD=/usr/bin/gcc -mcpu=host -msoft-float -C /opt/freescale/ltib/usr/src/rpm/BUILD/dtc-1.2.0
--------------------------------------------------------------------------------

 
On the Ubuntu web is the following:

--------------------------------------------------------------------------------
The [ command (a.k.a. test) must be used carefully in portable scripts. A very common pitfall is to use the == operator, which is a bashism; use = instead.
--------------------------------------------------------------------------------


The easiest way to work around this problem invoke the /bin/bash shell and then run ltib.  I hope this helps.

Regards,
Ron

0 Kudos
Reply
1,134 Views
fireas
Contributor I

That was the hint I needed.

The solution was to edit the file "dtc-common.tmpl" in the subdirectory INSTALLDIR_OF_LTIB/dist/lfs-5.1/dtc/ .

I just changed  "if [ $PLATFORM == host ]" to "if [ $PLATFORM = host ]"  - now it runs!

 

Thanks a lot, your my great savior ! :smileyhappy:

0 Kudos
Reply