diff options
author | Zhenhua Luo <zhenhua.luo@freescale.com> | 2013-03-20 15:52:12 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-22 17:01:30 +0000 |
commit | 5b5e03838d7265b1b51023660c15c1c6cb17f50f (patch) | |
tree | 699d0bacf465f416cefe4b98fe7ac31b8b47a885 /meta/classes | |
parent | c896db7c4c9aaef5ce7c40f2b054242b265dd2e1 (diff) | |
download | poky-5b5e03838d7265b1b51023660c15c1c6cb17f50f.tar.gz |
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>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/sanity.bbclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 8cdb06e185..ecc0a434a5 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -327,11 +327,14 @@ def check_gcc_march(sanity_data): | |||
327 | if status != 0: | 327 | if status != 0: |
328 | # Check if GCC could work with march | 328 | # Check if GCC could work with march |
329 | status,result = commands.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test") | 329 | status,result = commands.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test") |
330 | if status == 0: | 330 | if status == 0: |
331 | result = True | 331 | result = True |
332 | else: | ||
333 | result = False | ||
332 | 334 | ||
333 | os.remove("gcc_test.c") | 335 | os.remove("gcc_test.c") |
334 | os.remove("gcc_test") | 336 | if os.path.exists("gcc_test"): |
337 | os.remove("gcc_test") | ||
335 | 338 | ||
336 | return result | 339 | return result |
337 | 340 | ||