From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 553A32034C085 for ; Wed, 25 Oct 2017 13:04:31 -0700 (PDT) Received: by mail-wr0-x242.google.com with SMTP id y39so1158236wrd.4 for ; Wed, 25 Oct 2017 13:08:16 -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; bh=qs/zxgvgDXCEaCTlMoreC6xg1Gryi9BCBJkNkQ7Fow4=; b=TvDRWtPPoXFCzBoSSjj8DS7cwjv11dyFXb5kNAunaP1aDegj4YjWCOMZiErkOPi7Zo SjzrLOFuoIMtkau9vSO/c1lLq+aHR+BxBB1l3FJtWRgVSdxxW1QGvN4d6IDYP3Dhj7fq QlSIj0Urciyz3LSebP4gY/euxjfgIdPtqEuw4= 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; bh=qs/zxgvgDXCEaCTlMoreC6xg1Gryi9BCBJkNkQ7Fow4=; b=HGjIhmXVI8PORZFBZRr0Froj8W4jJPWjzaJ2GNDdNn2qNidQjTM6cQgs/71CrjMfCY FRsBAJiWj1Bb3pNy8irkbghsiKYSCpq4aNBLRfRv8rv900Dy2KZm/BK4L60RdyN3SK8+ hynupKpB+e5MsE7xjswKAtR5wAvb9PG40xodDS9V2nCUXbCaWrEen+OHwKotkfmXzXi7 xIUJnVtnBVESKv7OE9plHkPUGjY9Xy4leNRyStEsoil3iPNys8keEv2ZaTjISUg8HNeQ NQVESbEA/xFFn7qQSv9O2gd6cGtb8DNBvdLIDgYIEH8ET361dt9f3rFh+LHg+F4e0Lh/ W5vA== X-Gm-Message-State: AMCzsaXnrkGlbCRzzzXnQt2bkyII6cIv11u3qai90YtwSEOR1PHSXuHo vG58blqx9QfefmvPe3sinUodJ29v5TYNng== X-Google-Smtp-Source: ABhQp+QQJfJxU/mXWvXuuPVJVMNg7hjDcDEmZYPIuw2pQvlW70rmKpnjaS4R8O0PRiop7vVlOe9cwA== X-Received: by 10.223.156.138 with SMTP id d10mr3329126wre.214.1508962094278; Wed, 25 Oct 2017 13:08:14 -0700 (PDT) Received: from localhost.localdomain ([160.171.245.11]) by smtp.gmail.com with ESMTPSA id r23sm3034810wrc.93.2017.10.25.13.08.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 13:08:13 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, liming.gao@intel.com, yonghong.zhu@intel.com, Ard Biesheuvel Date: Wed, 25 Oct 2017 21:08:05 +0100 Message-Id: <20171025200805.1443-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [PATCH v2] BaseTools/tools_def AARCH64 ARM: disable PIE linking X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Oct 2017 20:04:31 -0000 Some prebuilt GCC toolchains targeting aarch64 (e.g., the Debian Stretch one) will default to building PIE executables. This has been observed to corrupt ACPI tables built from .aslc sources, so disable PIE linking altogether when using the GCC toolchain to build for AARCH64 or ARM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- v2: - apply to both AARCH64 and ARM - apply to GCC5 (and up) only - older versions of GCC don't support this option BaseTools/Conf/tools_def.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index e93c2a0bf1ef..df7c109438fd 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -4494,9 +4494,9 @@ DEFINE GCC5_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) DEFINE GCC5_ARM_CC_XIPFLAGS = DEF(GCC49_ARM_CC_XIPFLAGS) DEFINE GCC5_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) DEFINE GCC5_AARCH64_CC_XIPFLAGS = DEF(GCC49_AARCH64_CC_XIPFLAGS) -DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS) +DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS) -no-pie DEFINE GCC5_ARM_DLINK2_FLAGS = DEF(GCC49_ARM_DLINK2_FLAGS) -Wno-error -DEFINE GCC5_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) +DEFINE GCC5_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) -no-pie DEFINE GCC5_AARCH64_DLINK2_FLAGS = DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-error DEFINE GCC5_ARM_ASLDLINK_FLAGS = DEF(GCC49_ARM_ASLDLINK_FLAGS) DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS) -- 2.11.0