From 917f945bcd36d257e37a97ff17a0806f9b5fe686 Mon Sep 17 00:00:00 2001 From: Jaymes Wilks Date: Fri, 20 Jan 2017 11:11:36 -0600 Subject: [PATCH] Fix Sentinel Compile Error GCC intermitently reports MASTER_PROCESSOR_CHIP_TARGET_SENTINEL as being multiply-defined. Indeed it has, but the error only shows up when other errors are present. This commit fixes the underlying coding problem that exposes the GCC annoyance. Also, there is the added benefit that the symbol no longer uses duplicate space for every source file that uses the targeting service. Change-Id: I96dfaad210ab3e16b173c7482708ca1b66f14524 RTC:000000 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35589 Tested-by: Jenkins Server Reviewed-by: Nicholas E. Bofferding Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Reviewed-by: Stephen M. Cprek Reviewed-by: Daniel M. Crowell --- src/include/usr/targeting/common/targetservice.H | 7 ++----- src/usr/targeting/common/targutilbase.C | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H index 79641e7ffe8..5eae01fc7cf 100644 --- a/src/include/usr/targeting/common/targetservice.H +++ b/src/include/usr/targeting/common/targetservice.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -134,10 +134,7 @@ namespace TARGETING * DD framework to bring PNOR device driver online. Note this target * cannot be used as input to any target service APIs. */ -static Target* const MASTER_PROCESSOR_CHIP_TARGET_SENTINEL - = (sizeof(void*) == 4) ? - reinterpret_cast(0xFFFFFFFF) - : reinterpret_cast(0xFFFFFFFFFFFFFFFFULL); +extern Target* const MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; /** * @brief TargetService class diff --git a/src/usr/targeting/common/targutilbase.C b/src/usr/targeting/common/targutilbase.C index 6209c0fcc09..fc4fd9e13ae 100644 --- a/src/usr/targeting/common/targutilbase.C +++ b/src/usr/targeting/common/targutilbase.C @@ -27,6 +27,13 @@ namespace TARGETING { + +// master sentinel defined here to make available before targeting is up +Target* const MASTER_PROCESSOR_CHIP_TARGET_SENTINEL + = (sizeof(void*) == 4) ? + reinterpret_cast(0xFFFFFFFF) + : reinterpret_cast(0xFFFFFFFFFFFFFFFFULL); + /** * @brief Safely fetch the HUID of a Target */