From owner-svn-ports-all@freebsd.org Sat Dec 29 18:47:13 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADE85142A542; Sat, 29 Dec 2018 18:47:13 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ADD9817FD; Sat, 29 Dec 2018 18:47:13 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2A86EF17; Sat, 29 Dec 2018 18:47:12 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBTIlCVW082142; Sat, 29 Dec 2018 18:47:12 GMT (envelope-from tcberner@FreeBSD.org) Received: (from tcberner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTIlC0k082141; Sat, 29 Dec 2018 18:47:12 GMT (envelope-from tcberner@FreeBSD.org) Message-Id: <201812291847.wBTIlC0k082141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tcberner set sender to tcberner@FreeBSD.org using -f From: "Tobias C. Berner" Date: Sat, 29 Dec 2018 18:47:12 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r488682 - head/astro/kstars/files X-SVN-Group: ports-head X-SVN-Commit-Author: tcberner X-SVN-Commit-Paths: head/astro/kstars/files X-SVN-Commit-Revision: 488682 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2ADD9817FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 18:47:13 -0000 Author: tcberner Date: Sat Dec 29 18:47:12 2018 New Revision: 488682 URL: https://svnweb.freebsd.org/changeset/ports/488682 Log: astro/kstars: fix linking with lld7 kstars tries to pass -z nodump to the linker, which is not supported by lld7. This patch adds a little CMake function to check whether the linker accepts that flag, and if not does not add it. PR: 230603 Reported by: jbeich Added: head/astro/kstars/files/ head/astro/kstars/files/patch-git_b7d677a (contents, props changed) Added: head/astro/kstars/files/patch-git_b7d677a ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/astro/kstars/files/patch-git_b7d677a Sat Dec 29 18:47:12 2018 (r488682) @@ -0,0 +1,61 @@ +From b7d677ac9a99ee137c2b8bb75503ce1156a7b650 Mon Sep 17 00:00:00 2001 +From: "Tobias C. Berner" +Date: Wed, 26 Dec 2018 11:37:55 +0100 +Subject: [PATCH] FreeBSD: lld does not support -Wl,-z,nodump + +--- + CMakeLists.txt | 6 +++++- + cmake/modules/CheckNodump.cmake | 23 +++++++++++++++++++++++ + 2 files changed, 28 insertions(+), 1 deletion(-) + create mode 100644 cmake/modules/CheckNodump.cmake + +diff --git CMakeLists.txt CMakeLists.txt +index c8e9b3715..5e4e4ceae 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -295,8 +295,12 @@ IF (UNIX OR APPLE OR ANDROID) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SEC_COMP_FLAGS}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEC_COMP_FLAGS}") + SET(SEC_LINK_FLAGS "") ++ ++ include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CheckNodump.cmake") ++ check_nodump(NODUMP_FLAGS) ++ + IF (NOT APPLE) +- SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") ++ SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} ${NODUMP_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now") + ENDIF () + IF (NOT ANDROID AND NOT APPLE) + SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -pie") +diff --git cmake/modules/CheckNodump.cmake cmake/modules/CheckNodump.cmake +new file mode 100644 +index 000000000..a04bc074b +--- /dev/null ++++ cmake/modules/CheckNodump.cmake +@@ -0,0 +1,23 @@ ++# Check if the linker supports -Wl,z,nodump ++ ++function(check_nodump result) ++ set(NODUMP_FLAGS "-Wl,-z,nodump") ++ cmake_policy(SET CMP0056 NEW) ++ set(CMAKE_EXE_LINKER_FLAGS "${NODUMP_FLAGS}") ++ set(TEST_PROGRAM "int main() { return 0 ; }") ++ set(TEST_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_nodump.cc") ++ file(WRITE "${TEST_FILE}" "${TEST_PROGRAM}") ++ ++ message(STATUS "Checking whether the linker supports ${NODUMP_FLAGS} ...") ++ try_compile(SUPPORT_NODUMP ++ "${CMAKE_CURRENT_BINARY_DIR}/try_has_nodump" ++ "${TEST_FILE}" ++ ) ++ message(STATUS " supports ${NODUMP_FLAGS}: ${SUPPORT_NODUMP}") ++ ++ if(SUPPORT_NODUMP) ++ set(${result} "${NODUMP_FLAGS}") ++ else() ++ set(${result} "") ++ endif() ++endfunction() +-- +2.20.1 +