Brad Bishop | 7f28bc5 | 2017-12-03 23:42:40 -0500 | [diff] [blame] | 1 | From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001 |
| 2 | From: Haiqing Bai <Haiqing.Bai@windriver.com> |
| 3 | Date: Fri, 25 Nov 2016 16:48:01 +0800 |
| 4 | Subject: [PATCH] crda: Use target word size instead of host's. |
| 5 | |
| 6 | In key2pub.py, the codes check the wordsize |
| 7 | of the host machine but not the target's, this fix |
| 8 | fetches the wordsize of target from the build system. |
| 9 | |
| 10 | Upstream-Status: Pending |
| 11 | Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> |
| 12 | --- |
| 13 | utils/key2pub.py | 4 ++-- |
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 15 | |
| 16 | diff --git a/utils/key2pub.py b/utils/key2pub.py |
| 17 | index 3e84cd2..401d58a 100755 |
| 18 | --- a/utils/key2pub.py |
| 19 | +++ b/utils/key2pub.py |
| 20 | @@ -58,9 +58,9 @@ def print_ssl_32(output, name, val): |
| 21 | output.write('};\n\n') |
| 22 | |
| 23 | def print_ssl(output, name, val): |
| 24 | - import struct |
| 25 | + import os |
| 26 | output.write('#include <stdint.h>\n') |
| 27 | - if len(struct.pack('@L', 0)) == 8: |
| 28 | + if os.getenv('TARGET_BITS') == '64': |
| 29 | return print_ssl_64(output, name, val) |
| 30 | else: |
| 31 | return print_ssl_32(output, name, val) |
| 32 | -- |
| 33 | 1.9.1 |
| 34 | |