From patchwork Sun May 9 13:06:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1475953 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=2605:bc80:3010::137; helo=smtp4.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=UYReN9tj; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4FdPc02XRVz9t25 for ; Sun, 9 May 2021 23:07:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9416740479; Sun, 9 May 2021 13:07:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 9ReX4vYI6cMC; Sun, 9 May 2021 13:07:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id A6BCA4047D; Sun, 9 May 2021 13:07:19 +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 E7D281BF2C3 for ; Sun, 9 May 2021 13:07:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D692F40479 for ; Sun, 9 May 2021 13:07:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 LiH011qfabqe for ; Sun, 9 May 2021 13:07:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2472D40466 for ; Sun, 9 May 2021 13:07:15 +0000 (UTC) Received: by mail-wm1-x329.google.com with SMTP id b19-20020a05600c06d3b029014258a636e8so7354270wmn.2 for ; Sun, 09 May 2021 06:07:15 -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=D2gU0d34M80sUeQWCuAMqE6ELD2OWh5nxC45WAIoEEU=; b=UYReN9tjQt2FQcfuYGy6qrIXqjP4aUutL95nJD7obK+M9uT/J88spkahl+CTTTSffF xvGR9mVHAMK4peL+rJmWvXvtaobjAlRcJYHmL4ZBTx34HGBZ/Cp/upIKt0AFp+u66hvv qvaMXgjTVA8fTnwhQ/uhrrHOYPAmG9jR8TqVkROcCRMpamHaZJ9shZa3bfJR4R8P1+E/ XVgLPDSZ9D8eFiIzv26wNg7HdvNbgMIPCV1N+QBUK/4LSRFa0RiXiyFnA4aLSrZE/4zP yJzJsENYyPZ9tf4Ny2MgkSXY8wNn2f2adhklBCAZbmo15GsO/K08CZK98dO4gem4T3La vSVA== 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=D2gU0d34M80sUeQWCuAMqE6ELD2OWh5nxC45WAIoEEU=; b=PuUdpoIpjUlRR/J4chEqj/Mnm35thp//KKRU0kGdCeSnOedGtpdj1Be6ds8nBuAR7v dFv/DKWWtp5SymziK1g35wgEqdrep22IPndyG2MD+i54GpE4ea2molnWO8jgLkS3aPP6 YOGJwCbWdToR47s8VMYa0FqESGwfwEw5dTCdFi0uSZD3rOAA67q5h4iyXHGaTIsTOyXT 7xOM08rrQWx/myfKEtbefuoP1HjDSjeZQgZqJ0ydmSGnprdY5PKwlv5MXCQt4hf5iUX/ JRWRb1eC6ZbxdL/+1Gb+sDeQuFYiJbYKsoJOYSDA/TnAagtboJGyRfpto9BL/xorYlZh 0C0A== X-Gm-Message-State: AOAM5326TKelOpTYDAWomuleVnB8JMjT+eXkgZ+zw9Xjq8xqM9XMU5Ua gJ3HarwnbFusEN3ZovTJ7fjJA7eccus= X-Google-Smtp-Source: ABdhPJwYDqMmCtseW7S3oSbYwSha2zgngiu/U1w5kGa4caeY5lL/hswVXxluDym8SyYpNz3PhSSWqw== X-Received: by 2002:a05:600c:4982:: with SMTP id h2mr20840033wmp.108.1620565633794; Sun, 09 May 2021 06:07:13 -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 v18sm20754162wro.18.2021.05.09.06.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 06:07:13 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sun, 9 May 2021 15:06:34 +0200 Message-Id: <20210509130634.1105988-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2, 1/1] board/qemu/s390x: disable SSP 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: Gerome Burlats , Romain Naour , Fabrice Fontaine , Alexander Egorenkov 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 Reviewed-by: Romain Naour Reviewed-by: Alexander Egorenkov --- Changes v1 -> v2 (after review of Romain Naour): - Move patch from linux to board/qemu/s390x ...01-arch-s390-disable-SSP-when-needed.patch | 47 +++++++++++++++++++ configs/qemu_s390x_defconfig | 1 + 2 files changed, 48 insertions(+) create mode 100644 board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch diff --git a/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch b/board/qemu/s390x/patches/linux/0001-arch-s390-disable-SSP-when-needed.patch new file mode 100644 index 0000000000..c8199d4fd6 --- /dev/null +++ b/board/qemu/s390x/patches/linux/0001-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/configs/qemu_s390x_defconfig b/configs/qemu_s390x_defconfig index 9b3821f043..4aed9d9ae5 100644 --- a/configs/qemu_s390x_defconfig +++ b/configs/qemu_s390x_defconfig @@ -20,6 +20,7 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_GLOBAL_PATCH_DIR="board/qemu/s390x/patches" # host-qemu for gitlab testing BR2_PACKAGE_HOST_QEMU=y