From patchwork Sun May 9 09:18:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1475949 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TkHIqNs1; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 4FdJXG1hB7z9tlN for ; Sun, 9 May 2021 19:18:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 106CB83CB9; Sun, 9 May 2021 09:18:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CbCPpkQlgV1B; Sun, 9 May 2021 09:18:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 51AFB83C96; Sun, 9 May 2021 09:18:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8BA241BF5A4 for ; Sun, 9 May 2021 09:18:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7A0E740486 for ; Sun, 9 May 2021 09:18:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8e0v_5osiAGM for ; Sun, 9 May 2021 09:18:45 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by smtp4.osuosl.org (Postfix) with ESMTPS id 414C34035A for ; Sun, 9 May 2021 09:18:45 +0000 (UTC) Received: by mail-wr1-x430.google.com with SMTP id n2so13544084wrm.0 for ; Sun, 09 May 2021 02:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=V78b0xV9wSayKbta9y/BxLjWDMqSx2mr0cslhB+XAJQ=; b=TkHIqNs1O3KbEqgfIEypZLgSk/Oes0fra0K+Xf6FEH+t874vp+TlBPPuUqh3j61oPV +Td6ocVNvW3UWusGWfeqWrBwyvzJsMZOPlv9hO+t08qQ04HPejvJv8lihzLJW6W90scV dxuacOA5mFh5OgqZCkQ6z8IbyXynDFU4xu8ngl1zVE163VZgBvoZJeeI/orD3yj9Mq9y 51FO0rPOcpiMUAYmW8QNbl6eCuHVqYMFbT26QRgpkzf//8sdErAAZcQsGEjwxv0q6yWl kRyEW9PPx6S2kyMelpogUxAG3QkQiIAQ6mHIhyDfrb6k7mZnbNMMKbNybhmyt/Zdy8AM r2IA== 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=V78b0xV9wSayKbta9y/BxLjWDMqSx2mr0cslhB+XAJQ=; b=JzlwdMKl2/E+1UvVX26DuzWSE0DCwEKFAyGffaKUOKUcr4pl1fBIrOyYnOm3Am1r4e EDdWMHUH5WIcUA+vyUm6H0jpwsO5rzrDI/gX3+8S8BXOdjwRBqLw7kk1HlkmLv01zeAG 9P2PuOEhPYcKMq1zLIYmpxMWQs5+ig50b302EOQ1pqCVosUAsi7qEHb3e45SApM1gmnC xrKz4JQyF4OTJSFRJJWs3b+ptlJsOsjsi5gp+10b0hrVoduov38Ksw7PQ4+tLPvXVnNW VbcoDie9LYV/u2X/eP1siwtq8AwjzvRpTsLao7rbIXFbPNeLmxDG+XPPP6DKxhosWMYn 6vnw== X-Gm-Message-State: AOAM5314n8eismgK+nbbXl6HFpUWTxG48Y0jNYOpVXsOx980iQ7B8/V1 Eh707aDzuVTB8Qb7XF14pfFPm8veiwo= X-Google-Smtp-Source: ABdhPJxZ5Lse5tQlBPy900+7wxVGSJE3xgOwdM0TDWC6JahyAZh93I96JC/jKuirzYRMMiL56OZkUw== X-Received: by 2002:adf:d091:: with SMTP id y17mr23541100wrh.107.1620551923064; Sun, 09 May 2021 02:18:43 -0700 (PDT) Received: from kali.home (lfbn-ren-1-1383-171.w86-229.abo.wanadoo.fr. [86.229.230.171]) by smtp.gmail.com with ESMTPSA id t206sm14219852wmb.11.2021.05.09.02.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 02:18:42 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sun, 9 May 2021 11:18:00 +0200 Message-Id: <20210509091800.708933-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] linux: disable SSP on s390 when needed X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fix build failure raised since commit 810ba387bec3c5b6904e8893fb4cb6f9d3717466 by disabling SSP when needed Fixes: - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361 Signed-off-by: Fabrice Fontaine --- ...02-arch-s390-disable-SSP-when-needed.patch | 47 +++++++++++++++++++ linux/linux.mk | 7 +++ 2 files changed, 54 insertions(+) create mode 100644 linux/0002-arch-s390-disable-SSP-when-needed.patch diff --git a/linux/0002-arch-s390-disable-SSP-when-needed.patch b/linux/0002-arch-s390-disable-SSP-when-needed.patch new file mode 100644 index 0000000000..c8199d4fd6 --- /dev/null +++ b/linux/0002-arch-s390-disable-SSP-when-needed.patch @@ -0,0 +1,47 @@ +From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 8 May 2021 22:03:11 +0200 +Subject: [PATCH] arch/s390: disable SSP when needed + +Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in +KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to +avoid linking errors related to undefined references to +'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces +-fstack-protector. + +Fixes: + - https://gitlab.com/kubu93/buildroot/-/jobs/1247043361 + +Signed-off-by: Fabrice Fontaine +--- + arch/s390/Makefile | 1 + + arch/s390/purgatory/Makefile | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/s390/Makefile b/arch/s390/Makefile +index e443ed9947bd..098abe3a56f3 100644 +--- a/arch/s390/Makefile ++++ b/arch/s390/Makefile +@@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY + KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain + KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables + KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding ++KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector + KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member) + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g) + KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,)) +diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile +index c57f8c40e992..21c4ebe29b9a 100644 +--- a/arch/s390/purgatory/Makefile ++++ b/arch/s390/purgatory/Makefile +@@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes + KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare + KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding + KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common ++KBUILD_CFLAGS += -fno-stack-protector + KBUILD_CFLAGS += $(CLANG_FLAGS) + KBUILD_CFLAGS += $(call cc-option,-fno-PIE) + KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS)) +-- +2.30.2 + diff --git a/linux/linux.mk b/linux/linux.mk index 1457228eb9..338e79d23d 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -274,6 +274,13 @@ define LINUX_TRY_PATCH_TIMECONST endef LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST +define LINUX_TRY_PATCH_ARCH_S390_SSP + @if patch -p1 --dry-run -f -s -d $(@D) <$(LINUX_PKGDIR)/0002-arch-s390-disable-SSP-when-needed.patch.conditional >/dev/null ; then \ + $(APPLY_PATCHES) $(@D) $(LINUX_PKGDIR) 0002-arch-s390-disable-SSP-when-needed.patch.conditional ; \ + fi +endef +LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_ARCH_S390_SSP + LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH)) ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),) LINUX_DEPENDENCIES += host-imagemagick