From patchwork Sat Oct 17 00:47:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Wendling X-Patchwork-Id: 1383577 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CCkwk13lWz9sSf for ; Sat, 17 Oct 2020 11:51:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=HR6TiUoq; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CCkwj3yFnzDr2w for ; Sat, 17 Oct 2020 11:51:17 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--morbo.bounces.google.com (client-ip=2607:f8b0:4864:20::44a; helo=mail-pf1-x44a.google.com; envelope-from=3qt-kxwukdooyadnasaasxq.oayxuzgjbbo-pqhxuefe.alxmne.ads@flex--morbo.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=HR6TiUoq; dkim-atps=neutral Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CCks75hMNzDqcq for ; Sat, 17 Oct 2020 11:48:04 +1100 (AEDT) Received: by mail-pf1-x44a.google.com with SMTP id t26so2344585pfl.5 for ; Fri, 16 Oct 2020 17:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=jAqXNk0u0bLFPugoNWCXsYqJIRxd7ATu/6k8nOgdJT0=; b=HR6TiUoqu3YiI+dW9M6qpJoUaneIr/cmBIDpcvWWRv4+rmokSY/Ebv3x8HJeztSQdd jP7MfhZ3Ye7nF8m0YuRjtYsxIr2RkVRuyrt8ueSv78E3BT5EDAI5nctnRBUqO8SREyz3 nN1/pE+D2Z9zw4skjZ1xVRZAEN+l9jRLaDCG9wLau9EOCPMxOTmGwzxToNiCsSWVXq4E 9Tfh7BkM7BbTf1VjnvqCCJLuuOhhzr3U2lF09I9++CdJFr7vorj+CgfGAKFZEfw+gEeL EM4zkpu7ciB4VP7puytWt6zKDP8uqntWTpFEAH8t+2579h6uAxoDf37bTJApxcYjurV+ 2m8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=jAqXNk0u0bLFPugoNWCXsYqJIRxd7ATu/6k8nOgdJT0=; b=jucGhqPib4bWoT6R1k1vDbT+0UgfbCQcowXjwAE4kvljplHj8J6BbOy4sSGq1kL7QB wovLh0Z7Qx7FO5w/UpaFCRpw8xbq36L/pfq+BfrIlgsY7M7lJ1AWtOa2zAcjH0by5egU 7J/0FjGgXz2tC22dgJdt/NpWVCPyeq0tWW6zcQGtRlBbM8ZgwIpzm51VX62OFuMeKSjz JZ/FswwhsAz2UHd34qossTggxajncV1F/aRFU37kx0+NeBDisAb681GFfJipVaTxn8Io GaMNxGrZHUTtOCSmIRoDlolJfMViJxl+6gPC9yKXyjIje+tLTIfFIM9C6pRCsr5QaIRB qMhQ== X-Gm-Message-State: AOAM533nX/2r9xnfWR47LsUY+ERL9h511sntXQyfDSQPBRWU49hF8ewH HjHshUZr1555gpr2pKVPeHUo/dYLMVkVNnpBBZ2onvnxFN+Pgo4FNblI2xuMCakdRzHbh3RMBSl T924Tlfv7ZN2Eg5MiX+M9+4RnPIqavAD5DNQNYCpy4fDTcC11HshYfMyf2kHhyPUPuy4= X-Google-Smtp-Source: ABdhPJyAPLeeGHxL+1Mi9LdXRCjLyxO1VwHIPVEFlOLIWv8M+I0HlobJ0IkxYtTmJdErvvHaTit+DSjhIw== X-Received: from fawn.svl.corp.google.com ([2620:15c:2cd:202:7220:84ff:fe0f:9f6a]) (user=morbo job=sendgmr) by 2002:a17:90b:3314:: with SMTP id kf20mr6760043pjb.19.1602895681009; Fri, 16 Oct 2020 17:48:01 -0700 (PDT) Date: Fri, 16 Oct 2020 17:47:51 -0700 In-Reply-To: <20201017004752.415054-1-morbo@google.com> Message-Id: <20201017004752.415054-2-morbo@google.com> Mime-Version: 1.0 References: <20201017004752.415054-1-morbo@google.com> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog Subject: [PATCH 1/2] powerpc/wrapper: Add "-z notext" flag to disable diagnostic From: Bill Wendling To: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fangrui Song , Alan Modra , Paul Mackerras , Bill Wendling Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The "-z notext" flag disables reporting an error if DT_TEXTREL is set. ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against symbol: _start in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in >>> referenced by crt0.o:(.text+0x8) in archive arch/powerpc/boot/wrapper.a The BFD linker disables this by default (though it's configurable in current versions). LLD enables this by default. So we add the flag to keep LLD from emitting the error. Cc: Fangrui Song Cc: Alan Modra Signed-off-by: Bill Wendling --- arch/powerpc/boot/wrapper | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index cd58a62e810d..e576d3e4b23f 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -46,6 +46,7 @@ compression=.gz uboot_comp=gzip pie= format= +notext= # cross-compilation prefix CROSS= @@ -353,6 +354,7 @@ epapr) platformo="$object/pseries-head.o $object/epapr.o $object/epapr-wrapper.o" link_address='0x20000000' pie=-pie + notext='-z notext' ;; mvme5100) platformo="$object/fixed-head.o $object/mvme5100.o" @@ -493,8 +495,8 @@ if [ "$platform" != "miboot" ]; then text_start="-Ttext $link_address" fi #link everything - ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" $map \ - $platformo $tmp $object/wrapper.a + ${CROSS}ld -m $format -T $lds $text_start $pie $notext $nodl -o "$ofile" \ + $map $platformo $tmp $object/wrapper.a rm $tmp fi From patchwork Sat Oct 17 00:47:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Wendling X-Patchwork-Id: 1383576 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CCktZ4ptPz9sS8 for ; Sat, 17 Oct 2020 11:49:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=PdMACSbF; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CCktZ1BM3zDqvl for ; Sat, 17 Oct 2020 11:49:26 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--morbo.bounces.google.com (client-ip=2607:f8b0:4864:20::44a; helo=mail-pf1-x44a.google.com; envelope-from=3qz-kxwukdowacfpcuccuzs.qcazwbilddq-rsjzwghg.cnzopg.cfu@flex--morbo.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=PdMACSbF; dkim-atps=neutral Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CCks43PhZzDqMk for ; Sat, 17 Oct 2020 11:48:05 +1100 (AEDT) Received: by mail-pf1-x44a.google.com with SMTP id b195so2340609pfb.9 for ; Fri, 16 Oct 2020 17:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=jsPNLKRt0zVT0owId+SX5kSYWOR84snN45v+3a3AfG8=; b=PdMACSbFfcgqdAAL0gSxsAQD4S8LWoOWgZOzLX4zHianfpWYE7u71cFGln91BamRuB wOut5MrpBl626fI3I/p7Sxoyl/zok3BMWOVssLcxP7V/+kUJmrGmGpbErYn8lz67jQUH xiKTETFxSej6pzlzucQzkC08bhJ3IzNsNdqdpQIehHo5bfK24ahWNH4hiAYcEntJpMBI uiT6EJEKBW9rjAWS1hOMywMoSYF0Pmw1BfprPxtdP3sEzuQeqiZjHbey+1yhfL/yA5WU 82DTWh1LMvrEPg5PVVYu2KEJ0hjlf2kebz0WxwK0EHiQSqQTU76Do8fBM39i6pHMfW/8 WUyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=jsPNLKRt0zVT0owId+SX5kSYWOR84snN45v+3a3AfG8=; b=bOUuE5T0hJCVxpXs/65QplD2705pJ8bVxecaz2cte/buM59HQKEgYE2hhzk1r2Uejg 4xHD512O9ERX1elFqYIDvDLRicoAXC6t08q28aZ5EuUso55gKiznUW5Z5gTRZ6PhbUVL 8Roo9JogvFs91g8jKULgCMmhHRFlLTKSdzFBaw7Afwdj5x2DseovvpjgAdb2/G2hleKb 46Evo62PasowMPCBWVs9B/+HPyUqfmAlQdMq8lznIoCiAuVPKoyzxntXjmhe7wObTc9k 95Nex1idEhVQAdB50te5f/fEm8MJ+RSQLkbnVs9urb7u9pjiaha98ytLwd1qKkyFPTCF Av0A== X-Gm-Message-State: AOAM530udHfiY47hmDEqdsxLKkE+TsXOKMfHG5yPIb7SRV0HDJoVk2xZ cL5rYtNXPWRaOhJ7K+QJfSAV/k0vj+5PboSOFaGVa1l8VRTQrR+27kEU70j55UDqikZ/Vfnt7+9 nlWtv6NjuBaPtxZq6XIRUrAuskke7kgd7UcrybUvrnyK0KwDX+oHo6iGBSBdYMagMgo0= X-Google-Smtp-Source: ABdhPJyujnTqOo0oeIRLZ0m/4nV2sNP8LxrB+GFRw7Gwqe292l9rX4xyV23m/Uq3+m+5rwTPJ9NFj6/+JA== X-Received: from fawn.svl.corp.google.com ([2620:15c:2cd:202:7220:84ff:fe0f:9f6a]) (user=morbo job=sendgmr) by 2002:a17:90a:c388:: with SMTP id h8mr6690265pjt.100.1602895683144; Fri, 16 Oct 2020 17:48:03 -0700 (PDT) Date: Fri, 16 Oct 2020 17:47:52 -0700 In-Reply-To: <20201017004752.415054-1-morbo@google.com> Message-Id: <20201017004752.415054-3-morbo@google.com> Mime-Version: 1.0 References: <20201017004752.415054-1-morbo@google.com> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog Subject: [PATCH 2/2] powerpc/boot: Use clang when CC is clang From: Bill Wendling To: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fangrui Song , Alan Modra , Paul Mackerras , Bill Wendling Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The gcc compiler may not be available if CC is clang. Cc: Fangrui Song Cc: Alan Modra Signed-off-by: Bill Wendling --- arch/powerpc/boot/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index b88fd27a45f0..218f1c9adb5b 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -21,7 +21,11 @@ all: $(obj)/zImage ifdef CROSS32_COMPILE +ifdef CONFIG_CC_IS_CLANG + BOOTCC := $(CROSS32_COMPILE)clang +else BOOTCC := $(CROSS32_COMPILE)gcc +endif BOOTAR := $(CROSS32_COMPILE)ar else BOOTCC := $(CC) From patchwork Wed Nov 18 22:35:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Wendling X-Patchwork-Id: 1402632 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CbyTw0JmNz9s1l for ; Thu, 19 Nov 2020 09:41:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=LS7a0FIt; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CbyTv606czDqcJ for ; Thu, 19 Nov 2020 09:41:39 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--morbo.bounces.google.com (client-ip=2607:f8b0:4864:20::f4a; helo=mail-qv1-xf4a.google.com; envelope-from=3tag1xwukdniacfzc4cc492.0ca96bildd0-12j96ghg.cn9yzg.cf4@flex--morbo.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=LS7a0FIt; dkim-atps=neutral Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CbyM11ns2zDqbr for ; Thu, 19 Nov 2020 09:35:37 +1100 (AEDT) Received: by mail-qv1-xf4a.google.com with SMTP id s8so2588612qvr.20 for ; Wed, 18 Nov 2020 14:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=V1Vpf/r+3OfbIuN6VyOcWCKY6n9LDBI1U6QyMc3bnGY=; b=LS7a0FItnZc0gIHOQHFKN77JpJ8UkHUmaeeRrcUPFa1MazuNvTijFA/TKJSnE9PKTi FJMWVqm276iXCwqHHQMKHLpyfzYSXrfpkomqmu9XG47QJl9RiwXz71zML6jQucodhfpK 56L8b3jpP4UEpZ2i4EHOsgW6JvHAgh+aijHHmmgIeyer5pRwfpfaGzyhzNVlnaae8AVI FOLi43PwPKYyBujiUwyD1VmWlEcjfachnZv/xMAjQAr9brCVrkvw/u26l39S1Z+9inMI RW+ga+Jiucvj3o47sL/tG59yxYNgb8n9jGROITvLHCRpABmJo6u4f/VTpQPeoceU+/dN SPvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=V1Vpf/r+3OfbIuN6VyOcWCKY6n9LDBI1U6QyMc3bnGY=; b=OHUhghUHjftSuYNin3MDnf3ZvTZDnxF75caMCB8zRXzGeS2ABfRsKmRfgqYdDZDoga QwIpUZooNdDm2fQRQfqO8fD8cOm/mH4g3Sg97Ml9zcqbqP+WKLFlYVNyC85KiluO2Zrp H4Cf0Q27y8FYcBsGraqgFLx1Tzj0eFOcAZzzHzuBH+Fu8Htd6e/wKtIwMb6mvFDRVhDl Wwhc4ABwCFt8L48L60tSNrE6QeYUEDV34FA1pwKvxdQvtWRZNepaM5j2ZeDrwmdbvbky +B09JErSGtAA+abIsVRNUxrgDqe3Zz14zjN9FG+cTiE/XsQIsXaJhBslZwBtchY8I8EP Du0Q== X-Gm-Message-State: AOAM533GhsXZevwjiHZOFz/V/9rUNGUp2ZbE0+sGhH/eeRy9skw1HbHf B9auE2o8IXnwzfiQzCCbV6arABsr X-Google-Smtp-Source: ABdhPJzvRz3hGsBvsWKO5f+Gfe7Rt0OvPt9PbJzdjI+CX0cTcdNsBz3SYabilOnTAZiuh2/8iMIr8bVQ3A== X-Received: from fawn.svl.corp.google.com ([100.116.77.50]) (user=morbo job=sendgmr) by 2002:a0c:db8c:: with SMTP id m12mr7355504qvk.11.1605738933668; Wed, 18 Nov 2020 14:35:33 -0800 (PST) Date: Wed, 18 Nov 2020 14:35:13 -0800 In-Reply-To: <20201017004752.415054-3-morbo@google.com> Message-Id: <20201118223513.2704722-4-morbo@google.com> Mime-Version: 1.0 References: <20201017004752.415054-3-morbo@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH 3/3] powerpc/64s: feature: work around inline asm issues From: Bill Wendling To: Michael Ellerman , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Desaulniers , Bill Wendling Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The clang toolchain treats inline assembly a bit differently than straight assembly code. In particular, inline assembly doesn't have the complete context available to resolve expressions. This is intentional to avoid divergence in the resulting assembly code. We can work around this issue by borrowing a workaround done for ARM, i.e. not directly testing the labels themselves, but by moving the current output pointer by a value that should always be zero. If this value is not null, then we will trigger a backward move, which is explicitly forbidden. Signed-off-by: Bill Wendling --- arch/powerpc/include/asm/feature-fixups.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h index b0af97add751..34331c4ba61a 100644 --- a/arch/powerpc/include/asm/feature-fixups.h +++ b/arch/powerpc/include/asm/feature-fixups.h @@ -36,6 +36,18 @@ label##2: \ .align 2; \ label##3: +/* + * If the .org directive fails, it means that the feature instructions + * are smaller than the alternate instructions. This used to be written + * as + * + * .ifgt (label##4b-label##3b) - (label##2b-label##1b) + * .error "Feature section else case larger than body" + * .endif + * + * but clang's assembler complains about the expression being non-absolute + * when the code appears in an inline assembly statement. + */ #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ label##4: \ .popsection; \ @@ -48,11 +60,8 @@ label##5: \ FTR_ENTRY_OFFSET label##2b-label##5b; \ FTR_ENTRY_OFFSET label##3b-label##5b; \ FTR_ENTRY_OFFSET label##4b-label##5b; \ - .ifgt (label##4b- label##3b)-(label##2b- label##1b); \ - .error "Feature section else case larger than body"; \ - .endif; \ - .popsection; - + .popsection; \ + .org . - ((label##4b-label##3b) > (label##2b-label##1b)); /* CPU feature dependent sections */ #define BEGIN_FTR_SECTION_NESTED(label) START_FTR_SECTION(label)