From 29e9faf8b1fd74298758848693c90bbef3ee3f31 Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Wed, 19 Dec 2018 12:53:57 +0000 Subject: [PATCH] n1sdp: Fix armclang compilation issues Some of the syntax used in N1SDP is incompatible with Arm Compiler 6, including __packed and static_assert (without ). Change-Id: I445b54b59f63a194e49836dd5b87b7ae577ff24b Signed-off-by: Chris Kay --- .../include/internal/n1sdp_flash_layout.h | 8 ++--- product/n1sdp/scp_ramfw/config_sds.c | 2 +- tools/check_style.py | 1 + tools/ci.py | 29 +++++++++++++++++-- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/product/n1sdp/module/n1sdp_flash/include/internal/n1sdp_flash_layout.h b/product/n1sdp/module/n1sdp_flash/include/internal/n1sdp_flash_layout.h index 099bdfde0..76057176e 100644 --- a/product/n1sdp/module/n1sdp_flash/include/internal/n1sdp_flash_layout.h +++ b/product/n1sdp/module/n1sdp_flash/include/internal/n1sdp_flash_layout.h @@ -32,7 +32,7 @@ struct n1sdp_flash_toc_entry { uint32_t size; uint32_t flags:16; uint32_t checksum:16; -} __packed; +} __attribute__((packed)); /* Flash Table of contents (TOC) */ struct n1sdp_flash_memory_toc { @@ -45,7 +45,7 @@ struct n1sdp_flash_memory_toc { uint32_t entry_count:16; uint32_t checksum:16; struct n1sdp_flash_toc_entry entry[]; -} __packed; +} __attribute__((packed)); /* @@ -77,7 +77,7 @@ struct n1sdp_fip_toc_entry { uint32_t flags; uint32_t image_checksum:16; uint32_t checksum:16; -} __packed; +} __attribute__((packed)); /* NFIP Table of contents (TOC) */ struct n1sdp_fip_memory_toc { @@ -90,6 +90,6 @@ struct n1sdp_fip_memory_toc { uint32_t entry_count:16; uint32_t checksum:16; struct n1sdp_fip_toc_entry entry[]; -} __packed; +} __attribute__((packed)); #endif /* N1SDP_FLASH_LAYOUT_H */ diff --git a/product/n1sdp/scp_ramfw/config_sds.c b/product/n1sdp/scp_ramfw/config_sds.c index ac28f7da6..3656e3b12 100644 --- a/product/n1sdp/scp_ramfw/config_sds.c +++ b/product/n1sdp/scp_ramfw/config_sds.c @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include #include +#include #include #include #include diff --git a/tools/check_style.py b/tools/check_style.py index 9a4865b9f..471348b11 100755 --- a/tools/check_style.py +++ b/tools/check_style.py @@ -60,6 +60,7 @@ IGNORED_TYPES = [ 'LINE_SPACING', # We don't require a blank line after declarations 'SPLIT_STRING', # We allow strings to be split across lines 'FILE_PATH_CHANGES', # Specific to the kernel development process + 'PREFER_PACKED', # __packed is not available in Arm Compiler 6 ] error_count = 0 diff --git a/tools/ci.py b/tools/ci.py index 380258f1f..3ff15f26b 100755 --- a/tools/ci.py +++ b/tools/ci.py @@ -164,11 +164,36 @@ def main(): banner('Test building n1sdp product') cmd = \ - 'CC=arm-none-eabi-gcc CROSS_COMPILE=arm-none-eabi- ' \ + 'CC=arm-none-eabi-gcc ' \ + 'PRODUCT=n1sdp ' \ + 'MODE=debug ' \ + 'make clean all' + result = subprocess.call(cmd, shell=True) + results.append(('Product n1sdp debug build (GCC)', result)) + + cmd = \ + 'CC=armclang ' \ 'PRODUCT=n1sdp ' \ + 'MODE=debug ' \ + 'make clean all' + result = subprocess.call(cmd, shell=True) + results.append(('Product n1sdp debug build (ARM)', result)) + + cmd = \ + 'CC=arm-none-eabi-gcc ' \ + 'PRODUCT=n1sdp ' \ + 'MODE=release ' \ + 'make clean all' + result = subprocess.call(cmd, shell=True) + results.append(('Product n1sdp release build (GCC)', result)) + + cmd = \ + 'CC=armclang ' \ + 'PRODUCT=n1sdp ' \ + 'MODE=release ' \ 'make clean all' result = subprocess.call(cmd, shell=True) - results.append(('Product n1sdp build (GCC)', result)) + results.append(('Product n1sdp release build (ARM)', result)) banner('Test building clark product') -- GitLab