fix march sanity check issue
authorZhenhua Luo <zhenhua.luo@freescale.com>
Wed, 20 Mar 2013 07:52:12 +0000 (15:52 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Mar 2013 17:01:30 +0000 (17:01 +0000)
commit4eae0d0b94ddcbfd2dd395cbe73e4978c2b22669
tree12abe7c69d5f95a315ba20eb4c5f3cb6eda6d071
parentf6025403dd4ed55cde7d5c047f96989a82a5642b
fix march sanity check issue

1. check if gcc_test is really generate before os.remove("gcc_test") to avoid
   following error:
      ERROR: Execution of event handler 'check_sanity_eventhandler' failed
      Traceback (most recent call last):
      File "check_sanity_eventhandler(e)", line 4, in check_sanity_eventhandler(e=<bb.event.ConfigParsed object at 0x3151450>)
      File "sanity.bbclass", line 107, in check_sanity(sanity_data=<bb.data_smart.DataSmart object at 0x11ba110>)
      File "sanity.bbclass", line 22, in check_gcc_march(sanity_data=<bb.data_smart.DataSmart object at 0x11ba110>)
      OSError: [Errno 2] No such file or directory: 'gcc_test'
2. set result to False when build failed with -march=native to ensure
   -march=native is appended to BUILD_CFLAGS  when host gcc really supports this flag,
   otherwise following error appears when build native packages.
      | cap_text.c:1: error: bad value (native) for -march= switch
      | cap_text.c:1: error: bad value (native) for -mtune= switch

(From OE-Core rev: 4a4228fe250c8b23a5deeb25825d61c6e84a47a2)

Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sanity.bbclass