mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
devel/flang[-clang]: remove wrapper script dependency.
Patch flang-clang directly to link the required libraries and include the proper library directories. Hence, the need of the wrapper script (and it's non-optimal behavior) vanishes. While there, mark flang-clang broken on 10. Its LLVM6 base is not supported there and due to libpgmath only working on 12+, there is no need for it anyways.
This commit is contained in:
parent
27f9bf5942
commit
bee4ffe31f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=479487
7 changed files with 53 additions and 18 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
PORTNAME= flang-clang
|
||||
DISTVERSION= 6.0-g20180904
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= devel lang
|
||||
|
||||
MAINTAINER= jmd@FreeBSD.org
|
||||
|
@ -15,6 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
|
|||
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
|
||||
|
||||
ONLY_FOR_ARCHS= amd64
|
||||
IGNORE_FreeBSD_10= base compiler too old
|
||||
|
||||
BUILD_DEPENDS= llvm60>=0:devel/llvm60
|
||||
RUN_DEPENDS= llvm60>=0:devel/llvm60
|
||||
|
@ -37,6 +38,11 @@ CMAKE_ARGS+= -DLLVM_CONFIG=${LOCALBASE}/bin/llvm-config60
|
|||
|
||||
CMAKE_INSTALL_PREFIX= ${PREFIX}/flang
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/lib/Driver/ToolChains/FreeBSD.cpp
|
||||
|
||||
post-install:
|
||||
@${GZIP_CMD} ${STAGEDIR}/${PREFIX}/flang/man/man1/scan-build.1
|
||||
${RLN} ${STAGEDIR}${PREFIX}/flang/bin/flang ${STAGEDIR}${PREFIX}/bin/flang
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
--- lib/Driver/ToolChains/CommonArgs.cpp.orig 2018-09-10 18:28:59 UTC
|
||||
+++ lib/Driver/ToolChains/CommonArgs.cpp
|
||||
@@ -183,6 +183,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const
|
||||
// Add Fortan "main" before the first linker input
|
||||
if (!SeenFirstLinkerInput) {
|
||||
if (needFortranMain(D, Args)) {
|
||||
+ CmdArgs.push_back("-lflangrti");
|
||||
CmdArgs.push_back("-lflangmain");
|
||||
}
|
||||
SeenFirstLinkerInput = true;
|
||||
@@ -206,6 +207,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const
|
||||
}
|
||||
|
||||
if (!SeenFirstLinkerInput && needFortranMain(D, Args)) {
|
||||
+ CmdArgs.push_back("-lflangrti");
|
||||
CmdArgs.push_back("-lflangmain");
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
--- lib/Driver/ToolChains/FreeBSD.cpp.orig 2018-08-24 17:46:18 UTC
|
||||
+++ lib/Driver/ToolChains/FreeBSD.cpp
|
||||
@@ -196,6 +196,11 @@ void freebsd::Linker::ConstructJob(Compilation &C, con
|
||||
assert(Output.isNothing() && "Invalid output.");
|
||||
}
|
||||
|
||||
+ CmdArgs.push_back(Args.MakeArgString("-L%%LOCALBASE%%/flang/lib"));
|
||||
+ CmdArgs.push_back(Args.MakeArgString("-L%%LOCALBASE%%/lib"));
|
||||
+ CmdArgs.push_back(Args.MakeArgString("-L%%LOCALBASE%%/llvm60/lib"));
|
||||
+ CmdArgs.push_back(Args.MakeArgString("-L/usr/lib"));
|
||||
+
|
||||
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
|
||||
const char *crt1 = nullptr;
|
||||
if (!Args.hasArg(options::OPT_shared)) {
|
||||
@@ -263,6 +267,11 @@ void freebsd::Linker::ConstructJob(Compilation &C, con
|
||||
CmdArgs.push_back("--as-needed");
|
||||
CmdArgs.push_back("-lgcc_s");
|
||||
CmdArgs.push_back("--no-as-needed");
|
||||
+ }
|
||||
+
|
||||
+ if (!Args.hasArg(options::OPT_noFlangLibs)) {
|
||||
+ CmdArgs.push_back("-lpgmath");
|
||||
+ CmdArgs.push_back("-lflang");
|
||||
}
|
||||
|
||||
if (Args.hasArg(options::OPT_pthread)) {
|
|
@ -1,3 +1,4 @@
|
|||
bin/flang
|
||||
flang/bin/c-index-test
|
||||
flang/bin/clang
|
||||
flang/bin/clang++
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
PORTNAME= flang
|
||||
DISTVERSION= 6.0-g20180904
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= devel
|
||||
|
||||
MAINTAINER= jmd@FreeBSD.org
|
||||
|
@ -50,10 +51,4 @@ MAKE_JOBS_UNSAFE= yes
|
|||
post-patch:
|
||||
@${CP} -r ${WRKSRC}/tools/flang2/flang2exe/x86_64-Linux ${WRKSRC}/tools/flang2/flang2exe/x86_64-FreeBSD
|
||||
|
||||
post-install:
|
||||
@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
|
||||
< ${FILESDIR}/flang.in > \
|
||||
${WRKDIR}/flang
|
||||
${INSTALL_SCRIPT} ${WRKDIR}/flang ${STAGEDIR}/${PREFIX}/bin/flang
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
FLANG_CFS="-I%%PREFIX%%/flang/include"
|
||||
FLANG_LFS="-L%%PREFIX%%/flang/lib -lflang -lflangmain -lflangrti -lompstub -lexecinfo"
|
||||
for arg in $@; do
|
||||
case "$arg" in
|
||||
-c|-E) FLANG_LFS="";;
|
||||
esac
|
||||
done
|
||||
|
||||
exec %%PREFIX%%/flang/bin/flang $FLANG_LFS $FLANG_CFS $@
|
|
@ -1,4 +1,3 @@
|
|||
bin/flang
|
||||
flang/bin/flang1
|
||||
flang/bin/flang2
|
||||
flang/include/ieee_arithmetic.mod
|
||||
|
|
Loading…
Add table
Reference in a new issue