[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] xen/x86: fix usage of [[:blank:]] with BSD grep


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 13 Feb 2026 14:56:13 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tOeq7193SlRPvCKtblBZpMGYEgs2rVdelCsSnZJPcyw=; b=C9IVR982FKIRH1l6RXS0PbXMOceuEssFNo1vrwTTTRrYYt31tUHi2CJBV1KUSxlVcCcs8rfPxgMzda6w9P+l+uRAkzcO5UJ9pbasx3HLsyzKiGtQA1X06Np23v44TM6GXiFjc+eQ9Pt4qdMxAYDQnWf+Z2JNFOSFRVuwZmBFVX9qKVkqe6RJm+9nslBh3qY5rBhiRkqg+lwnyS9NJLK3acXO9UKkiFkrtJc1NS2tQJWc4urotNmlKTzbbf9e5crqghUu+7/kEo/FIYmxrViwQ3waGzlAu0kiSbGRgXJp4sR6qRfowVRbHDvK9T9DkqvjDMTRXVxnRMrwwab1ZQAmyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aHIWsDaNeDO6k3LzfU5B2LXndzwwoLs3xhqCFxb9r2NUEm+vqLPfreyKP7aih3ZPLYSC+2wM2pR/JxRXdoBzBC/iO9qIUzcb1NYNg/iRw+bWHSVCe6AMq+QpeUNb2Uxcy+LVqPwElH1n209L5ti9FJkgDGkrGhstqhToMpYLuNAkcN65McgMFKOo0ZEw5OHiLP1daeu9e/iH0VHoGq54rUOw5nZTZSznFyylK2AQYW8f9ZoVWfNCRTlT3wC6czcXTEhVqlCcNLrU6W3/sANpmrri9zGxpNDP4VeyDBp9+Vm3vKHyXnvnQSlpqZyHOLuqbaiENVUTf1WemXRJFYSsAw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 13 Feb 2026 13:56:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

BSD grep only recognizes [[:blank:]] as a valid expression when using
extended (modern) regular expressions.  Pass -E to the grep call used in
efi-nr-fixups.

Additionally, the return from `wc -l` is space padded on BSD, and hence
the content of efi-nr-fixups is "       2", not plain "2".  Strip the
spaces in the Makefile using $(strip ...).

Fixes: 1be65ec4c8bc ('x86/EFI: avoid use of GNU ld's --disable-reloc-section 
when possible')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/arch.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 2e06ae2582dc..37fe65bc13cb 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -100,7 +100,7 @@ endif
 ifeq ($(XEN_BUILD_PE),y)
 
 # Check if the linker produces fixups in PE by default
-efi-nr-fixups := $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep 
'^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l)
+efi-nr-fixups := $(strip $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | 
grep -E '^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l))
 
 ifeq ($(efi-nr-fixups),2)
 MKRELOC := :
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.