Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Nov 2022 18:23:52 GMT
From:      Thierry Thomas <thierry@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 7622388b9269 - main - lang/lfortran: use --export-dynamic linker option
Message-ID:  <202211011823.2A1INqmV042770@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7622388b92699fee9c5f28a1566d405a4ba4c401

commit 7622388b92699fee9c5f28a1566d405a4ba4c401
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-11-01 18:21:52 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-11-01 18:23:50 +0000

    lang/lfortran: use --export-dynamic linker option
    
    Adapt a patch submitted for OpĂȘnBSD by semarie@: with it, all the tests pass.
    
    Obtained from:  https://github.com/lfortran/lfortran/pull/951
---
 lang/lfortran/Makefile                             |  1 +
 lang/lfortran/files/patch-src_bin_CMakeLists.txt   | 24 ++++++++++++++++++++++
 .../files/patch-src_lfortran_tests_CMakeLists.txt  | 13 ++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/lang/lfortran/Makefile b/lang/lfortran/Makefile
index 957ce30def53..a42b5ca3087b 100644
--- a/lang/lfortran/Makefile
+++ b/lang/lfortran/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	lfortran
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.18.0
+PORTREVISION=	1
 CATEGORIES=	lang
 
 MAINTAINER=	fortran@FreeBSD.org
diff --git a/lang/lfortran/files/patch-src_bin_CMakeLists.txt b/lang/lfortran/files/patch-src_bin_CMakeLists.txt
new file mode 100644
index 000000000000..10b23734303d
--- /dev/null
+++ b/lang/lfortran/files/patch-src_bin_CMakeLists.txt
@@ -0,0 +1,24 @@
+--- src/bin/CMakeLists.txt.orig	2022-10-18 21:48:01 UTC
++++ src/bin/CMakeLists.txt
+@@ -2,7 +2,9 @@ add_executable(lfortran lfortran.cpp)
+ target_include_directories(lfortran PRIVATE "tpl")
+ target_link_libraries(lfortran lfortran_lib)
+ if (LFORTRAN_STATIC_BIN)
+-    if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
++    if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
++        OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"
++        OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+         # Link statically on Linux with gcc or clang
+         if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
+                 CMAKE_CXX_COMPILER_ID MATCHES Clang)
+@@ -11,7 +13,9 @@ if (LFORTRAN_STATIC_BIN)
+     endif()
+ endif()
+ 
+-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
++if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
++    OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"
++    OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+     target_link_options(lfortran PRIVATE "LINKER:--export-dynamic")
+ endif()
+ 
diff --git a/lang/lfortran/files/patch-src_lfortran_tests_CMakeLists.txt b/lang/lfortran/files/patch-src_lfortran_tests_CMakeLists.txt
new file mode 100644
index 000000000000..6e02b1e24c67
--- /dev/null
+++ b/lang/lfortran/files/patch-src_lfortran_tests_CMakeLists.txt
@@ -0,0 +1,13 @@
+--- src/lfortran/tests/CMakeLists.txt.orig	2022-10-18 21:48:01 UTC
++++ src/lfortran/tests/CMakeLists.txt
+@@ -43,7 +43,9 @@ target_link_libraries(test_lfortran lfortran_lib p::do
+ add_test(test_lfortran ${PROJECT_BINARY_DIR}/test_lfortran)
+ 
+ if (WITH_LLVM)
+-    if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
++    if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
++        OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"
++        OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+         target_link_options(test_lfortran PRIVATE "LINKER:--export-dynamic")
+     endif()
+ endif()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211011823.2A1INqmV042770>