From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=adPAr1VS; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Fri, 31 May 2019 14:01:25 -0700 Received: by mail-wr1-f65.google.com with SMTP id o12so211121wrj.9 for ; Fri, 31 May 2019 14:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2AvUiKoQEI3gKZPimxD3eR9eFxLn/Kkzvc6WUHG2JyU=; b=adPAr1VSQF1FedYE5oNWyNVEg0yy7wGsmduSrEiGkjcIYQVU7NlKjyhc44Sch8gdPY sGs4q7zTwVbufH1r8G9J6XiRexQC/cDCXRrwB5+WQ+vLu5x9dm2y0zRYB5vIYw8eSuhQ VgNZSH15SQy7kuTPm2/isnvDLK4PdoOxSeX0BvTQ1WpHfyAW1wcVfdX3NArYHvz9GmvN o1ZOovkVl/CyJnWwDDXXdd0YowNI7yUkg66T4wQ3neiEmqcjSkIrda7J5KzLsCFvbBf8 GMD+q1ATkNZAi56DmDYj2cPXi2BnlKkM1MsWNzd5fLdQaoWHzOEjKpyFhQA0NjCqexE+ kdgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2AvUiKoQEI3gKZPimxD3eR9eFxLn/Kkzvc6WUHG2JyU=; b=V0lVO9UWB/7SxRgatBmgSUe9tPB9lli8uEVF0NjB4CdqQSZIh7/LJtskB7+wpjn6Fp ywnsCnF2pUuuLYTGl5Ylo8+lPDVLcZcZ5XjbQFKki3kSEtx3dg+UvRoY5bvHS4pnYJgi ii4kceBIZ47WNhmIeadEhPac5YikfqFu3BXPrfHKPxJ5et0NLayeHDETexsYLudzfnoM GUUL1u9TR/YmzFYIlklZ8b19smh3V57V1oDtlRvGD0DajBj0Dl/DqT52uKaqrQk9UyHO 0f/VOk11fOoqpVYu6oDXfBNOV59vbe7AJA0T55tgppZfFMy54rbKXMYfBYm4sRHohd3j Lyqw== X-Gm-Message-State: APjAAAXsMZR71XekrRvsMSZtCLXxnacBC3d8FG1dFrL+g6UEHOPWSqjB UUFZU8Wzl1cAm82Q6BtbbTE6FCxATKo= X-Google-Smtp-Source: APXvYqyov0OtrxNjaMbbtNnHX6+0b5+YkoSaAaBNcR+BFrAm9QHa1ChYWlnrebrtRuwtipMcZaCWuA== X-Received: by 2002:adf:e742:: with SMTP id c2mr8138072wrn.249.1559336483415; Fri, 31 May 2019 14:01:23 -0700 (PDT) Return-Path: Received: from sudo.home ([2a01:cb1d:112:6f00:c225:e9ff:fe2e:ea8]) by smtp.gmail.com with ESMTPSA id x68sm6892068wmf.13.2019.05.31.14.01.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 14:01:22 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Laszlo Ersek , "Gao, Liming" , "Wang, Jian J" , Leif Lindholm , Michael D Kinney Subject: [PATCH] ArmPkg/ArmSoftFloatLib GCC4x: fix build failure Date: Fri, 31 May 2019 23:01:15 +0200 Message-Id: <20190531210115.29818-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The upstream SoftFloat code that was recently incorporated into ArmSoftFloatLib uses some parameterization to tweak the inlining and optimization behavior for different compilers. The custom platform.h file that sets these parameters is based on the upstream version for Linux/ARM, but was updated to include the 'always_inline' GCC attribute into the INLINE macro, to ensure that all definitions that are marked as inline are not only inlined into their callers, but also to ensure that no version of the function is ever emitted into the object file. This works fine on recent GCC and Clang, but the latter part turns out to break on GCC 4.x, resulting in duplicate definition linker errors. Fortunately, the synticatically more appriopriate 'static inline' works fine on both the recent and the older compilers, so let's switch to that instead. Cc: Laszlo Ersek Cc: "Gao, Liming" Cc: "Wang, Jian J" Cc: Leif Lindholm Cc: Michael D Kinney Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmSoftFloatLib/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPkg/Library/ArmSoftFloatLib/platform.h b/ArmPkg/Library/ArmSoftFloatLib/platform.h index 31e843463a38..07800a9d5b79 100644 --- a/ArmPkg/Library/ArmSoftFloatLib/platform.h +++ b/ArmPkg/Library/ArmSoftFloatLib/platform.h @@ -5,7 +5,7 @@ */ #define LITTLEENDIAN 1 -#define INLINE inline __attribute__((always_inline)) +#define INLINE static inline #define SOFTFLOAT_BUILTIN_CLZ 1 #define SOFTFLOAT_FAST_INT64 #include "opts-GCC.h" -- 2.20.1