From patchwork Mon Sep 14 20:33:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1363894 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=EfGUeamr; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BqykM4TX0z9sTR for ; Tue, 15 Sep 2020 06:33:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3E69A85A5A; Mon, 14 Sep 2020 20:33:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SsjyRUPrt3UX; Mon, 14 Sep 2020 20:33:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 659168535D; Mon, 14 Sep 2020 20:33:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 61ABA1BF368 for ; Mon, 14 Sep 2020 20:33:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5A69B8535D for ; Mon, 14 Sep 2020 20:33:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FLo0ZVkppCy5 for ; Mon, 14 Sep 2020 20:33:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 424A5852DB for ; Mon, 14 Sep 2020 20:33:42 +0000 (UTC) Received: by mail-wm1-f51.google.com with SMTP id a9so1338089wmm.2 for ; Mon, 14 Sep 2020 13:33:42 -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=lj8Zqcp5/8Aa4SFqUsqagTztSxxfmr1o8k7NziAuvTg=; b=EfGUeamr9c2nF7ppdVGX1mxMy5UVW1BohOZK1ZEAFZcVpCMTqChCEc/uOvBHiQwo4B yalTzaPNvuo2rYIxqOCh/So8bZo6VF6C6+U4YSSpNbWTCKQhNP2973tMtE7gKqGrVOAA OuP0zpyavBTRcFclcQ6c5uEl0mvEVi1RaFt+wDPc90iw/UozqkLyJv0KjFVsYyKtVH1q zxtW5ODbMkAIGrkaPAlt1RlND07VVbJG/Jd/c9VtNGp49j0/Uldvx9AiXzAZ5pIGqmxj 7mjcJ8Va+jY52W3io3VkZi0LuWGBBKAy5AKXYvl8Lj7Lz5fPXFlnzYQyCXjV4RZP73nQ ekDA== 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=lj8Zqcp5/8Aa4SFqUsqagTztSxxfmr1o8k7NziAuvTg=; b=OdqFW9kuL+QWqC+T6TXwc7q7DMkvIEVvFh5YP9+w5iHRl1O650gOPBmsx7NMWwSPp4 9LDuq1B+EhtLNmBDHRHN8Xl42S8FL5r5Pz8a8uV5wuU/0yO+Vcq7VHwRlyvTYu9u0kGZ LJgRmoccXcrF5ckWjuUpUbyDgGxI8/cTyydwukjU62600cYBwJWnc3G/qpt4MiEI5P0D a/ju0OMH60CSDGagt17UekuDME8aI9CJoVu1wH8ezaTZGWcNOOIh9RMGFZRgWjQgI/fP VgpojglpNEARiCDB/dFHxp0FmdJvbV+hAg8gw163uLCb4SKBhyeNMsTG8PQg7tphuqeU +UfA== X-Gm-Message-State: AOAM533L7nDOzVzEikJtlId8mnN3mLzKdZ3tnp8ilqzjWSNpkLAotjNO LRT7maH4AYXGdAP9TS0x1Qr3fZpZa20= X-Google-Smtp-Source: ABdhPJxJUWaHG9YF2VMABpVs8nqUmPmK8HWKt/OydbW1Ckl8wu/W1ceKGCzV2emNWPg76ui7rPavrQ== X-Received: by 2002:a05:600c:2246:: with SMTP id a6mr1190600wmm.38.1600115620313; Mon, 14 Sep 2020 13:33:40 -0700 (PDT) Received: from kali.home (2a01cb0881b76d0062c55ff6bf2a37aa.ipv6.abo.wanadoo.fr. [2a01:cb08:81b7:6d00:62c5:5ff6:bf2a:37aa]) by smtp.gmail.com with ESMTPSA id c4sm22503569wrp.85.2020.09.14.13.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 13:33:39 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Mon, 14 Sep 2020 22:33:29 +0200 Message-Id: <20200914203329.3432074-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2,1/1] package/supertux: fix build with RELRO 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: Romain Naour , Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Disable static building of external/squirrel to fix the following build failure with RELRO: /home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/8.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: CMakeFiles/sq_static.dir/sq.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC /home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/8.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status Fixes: - http://autobuild.buildroot.org/results/46e8f5e622ce450a89bc6d70f4bfd38182557901 - http://autobuild.buildroot.org/results/a43720492d817e4555d728546da9114e3ccba952 Signed-off-by: Fabrice Fontaine --- Changes v1 -> v2 (after review of Thomas Petazzoni): - Disable static building of external/squirrel instead of adding -fPIC ...ass-DISABLE_STATIC-to-external-squir.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 package/supertux/0001-CMakeLists.txt-pass-DISABLE_STATIC-to-external-squir.patch diff --git a/package/supertux/0001-CMakeLists.txt-pass-DISABLE_STATIC-to-external-squir.patch b/package/supertux/0001-CMakeLists.txt-pass-DISABLE_STATIC-to-external-squir.patch new file mode 100644 index 0000000000..43652d0906 --- /dev/null +++ b/package/supertux/0001-CMakeLists.txt-pass-DISABLE_STATIC-to-external-squir.patch @@ -0,0 +1,52 @@ +From 95590485d7cd95611eeac1fc06226d45f235c63a Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 13 Sep 2020 22:09:49 +0200 +Subject: [PATCH] CMakeLists.txt: pass DISABLE_STATIC to external/squirrel + +external/squirrel will always build a static binary and library except +if DISABLE_STATIC is defined so define it to avoid the following build +failure with RELRO_FULL: + +/home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/8.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: CMakeFiles/sq_static.dir/sq.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC +/home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/8.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: final link failed: nonrepresentable section on output +collect2: error: ld returned 1 exit status + +Fixes: + - http://autobuild.buildroot.org/results/46e8f5e622ce450a89bc6d70f4bfd38182557901 + - http://autobuild.buildroot.org/results/a43720492d817e4555d728546da9114e3ccba952 + +Signed-off-by: Fabrice Fontaine +--- + CMakeLists.txt | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1ae0d653b..bb4358b01 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -411,6 +411,7 @@ ExternalProject_Add(squirrel + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX} ++ -DDISABLE_STATIC=ON + -DINSTALL_INC_DIR=include) + + if(WIN32) +@@ -424,10 +425,10 @@ if(WIN32) + #For debug run purposes + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat.in" "${PROJECT_BINARY_DIR}/run_supertux.bat") + else() +- add_library(squirrel_lib STATIC IMPORTED) +- set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}") +- add_library(sqstdlib_lib STATIC IMPORTED) +- set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ add_library(squirrel_lib SHARED IMPORTED) ++ set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}squirrel${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ add_library(sqstdlib_lib SHARED IMPORTED) ++ set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() + + include_directories(SYSTEM ${SQUIRREL_PREFIX}/include) +-- +2.28.0 +