NEW: devel/llvm (Extra Clang Tools) #2

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

NEW: devel/llvm (Extra Clang Tools) #2

Rafael Sadowski
Long time ago I was trying to import the clang extra tool sets without
luck. It failed because the -extra subpackage has an effect on -main.
More precisely, the cmake parts from the main package.

For this reason, I think it is best to build/install the extra tools in
the main package. I'd be in charge here, too.

I also was trying to crate an extra packages, which includes only the
extra parts but this rise more issue in the eco system.

I have to deal with this topic because more and more people come up to
me and ask about my last try, last otto@. That's good because I think
these tools are helpful.

Best regards and a nice weekend.

RS

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.234
diff -u -p -u -p -r1.234 Makefile
--- Makefile 9 Sep 2019 21:15:16 -0000 1.234
+++ Makefile 21 Sep 2019 12:08:00 -0000
@@ -18,7 +18,7 @@ PKGSPEC-main = llvm-=${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python = py-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main = 0
+REVISION-main = 1
 
 CATEGORIES = devel
 
@@ -40,7 +40,8 @@ EXTRACT_SUFX = .tar.xz
 DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \
  cfe-${LLVM_V}.src${EXTRACT_SUFX} \
  lld-${LLVM_V}.src${EXTRACT_SUFX} \
- lldb-${LLVM_V}.src${EXTRACT_SUFX}
+ lldb-${LLVM_V}.src${EXTRACT_SUFX} \
+ clang-tools-extra-${LLVM_V}.src${EXTRACT_SUFX}
 
 MULTI_PACKAGES = -main -python -lldb
 
@@ -131,6 +132,7 @@ post-extract:
  mv ${WRKDIR}/cfe-${LLVM_V}.src ${WRKSRC}/tools/clang
  mv ${WRKDIR}/lld-${LLVM_V}.src ${WRKSRC}/tools/lld
  mv ${WRKDIR}/lldb-${LLVM_V}.src ${WRKSRC}/tools/lldb
+ mv ${WRKDIR}/clang-tools-extra-${LLVM_V}.src ${WRKSRC}/tools/clang/tools/extra
 
 pre-configure:
  @${SUBST_CMD} ${WRKSRC}/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/llvm/distinfo,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 distinfo
--- distinfo 8 Sep 2019 10:40:39 -0000 1.34
+++ distinfo 21 Sep 2019 12:08:00 -0000
@@ -1,8 +1,10 @@
 SHA256 (cfe-8.0.1.src.tar.xz) = cO/9afeoqySfZrCmirqLCK9Sqiq3EN+4oPuhAmhbFkY=
+SHA256 (clang-tools-extra-8.0.1.src.tar.xz) = GHF5thfk8Hu2BcwhXaBSfmSZC0p91cvMRSoWtk4Cw+E=
 SHA256 (lld-8.0.1.src.tar.xz) = n7oelCSb15E+imw6rcswi3bIw9g8XONsmcPzTXOHPYg=
 SHA256 (lldb-8.0.1.src.tar.xz) = 6Kebqm0R3QZQq0obR59pnfrYKvYny7zUn6by3BThMdc=
 SHA256 (llvm-8.0.1.src.tar.xz) = RHh6bQL3FA8UXiJQ1WyfhJM04R+a43mCdRDtcvErdec=
 SIZE (cfe-8.0.1.src.tar.xz) = 12810056
+SIZE (clang-tools-extra-8.0.1.src.tar.xz) = 1994068
 SIZE (lld-8.0.1.src.tar.xz) = 996440
 SIZE (lldb-8.0.1.src.tar.xz) = 19586288
 SIZE (llvm-8.0.1.src.tar.xz) = 30477608
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-main,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 PLIST-main
--- pkg/PLIST-main 8 Jul 2019 07:56:53 -0000 1.14
+++ pkg/PLIST-main 21 Sep 2019 12:08:00 -0000
@@ -5,17 +5,25 @@
 bin/clang
 bin/clang++
 @bin bin/clang-8
+@bin bin/clang-apply-replacements
+@bin bin/clang-change-namespace
 @bin bin/clang-check
 bin/clang-cl
 bin/clang-cpp
 @bin bin/clang-extdef-mapping
 @bin bin/clang-format
 @bin bin/clang-import-test
+@bin bin/clang-include-fixer
 @bin bin/clang-offload-bundler
+@bin bin/clang-query
 @bin bin/clang-refactor
 @bin bin/clang-rename
+@bin bin/clang-reorder-fields
+@bin bin/clang-tidy
+@bin bin/clangd
 @bin bin/diagtool
 @bin bin/dsymutil
+@bin bin/find-all-symbols
 bin/git-clang-format
 bin/hmaptool
 bin/ld.lld
@@ -72,6 +80,7 @@ bin/llvm-strip
 @bin bin/llvm-tblgen
 @bin bin/llvm-undname
 @bin bin/llvm-xray
+@bin bin/modularize
 @bin bin/obj2yaml
 @bin bin/opt
 @bin bin/sancov
@@ -2349,9 +2358,13 @@ lib/libclangARCMigrate.a
 lib/libclangAST.a
 lib/libclangASTMatchers.a
 lib/libclangAnalysis.a
+lib/libclangApplyReplacements.a
 lib/libclangBasic.a
+lib/libclangChangeNamespace.a
 lib/libclangCodeGen.a
 lib/libclangCrossTU.a
+lib/libclangDaemon.a
+lib/libclangDoc.a
 lib/libclangDriver.a
 lib/libclangDynamicASTMatchers.a
 lib/libclangEdit.a
@@ -2360,9 +2373,14 @@ lib/libclangFrontend.a
 lib/libclangFrontendTool.a
 lib/libclangHandleCXX.a
 lib/libclangHandleLLVM.a
+lib/libclangIncludeFixer.a
+lib/libclangIncludeFixerPlugin.a
 lib/libclangIndex.a
 lib/libclangLex.a
+lib/libclangMove.a
 lib/libclangParse.a
+lib/libclangQuery.a
+lib/libclangReorderFields.a
 lib/libclangRewrite.a
 lib/libclangRewriteFrontend.a
 lib/libclangSema.a
@@ -2370,6 +2388,27 @@ lib/libclangSerialization.a
 lib/libclangStaticAnalyzerCheckers.a
 lib/libclangStaticAnalyzerCore.a
 lib/libclangStaticAnalyzerFrontend.a
+lib/libclangTidy.a
+lib/libclangTidyAbseilModule.a
+lib/libclangTidyAndroidModule.a
+lib/libclangTidyBoostModule.a
+lib/libclangTidyBugproneModule.a
+lib/libclangTidyCERTModule.a
+lib/libclangTidyCppCoreGuidelinesModule.a
+lib/libclangTidyFuchsiaModule.a
+lib/libclangTidyGoogleModule.a
+lib/libclangTidyHICPPModule.a
+lib/libclangTidyLLVMModule.a
+lib/libclangTidyMPIModule.a
+lib/libclangTidyMiscModule.a
+lib/libclangTidyModernizeModule.a
+lib/libclangTidyObjCModule.a
+lib/libclangTidyPerformanceModule.a
+lib/libclangTidyPlugin.a
+lib/libclangTidyPortabilityModule.a
+lib/libclangTidyReadabilityModule.a
+lib/libclangTidyUtils.a
+lib/libclangTidyZirconModule.a
 lib/libclangTooling.a
 @comment lib/libgtest.a
 @comment lib/libgtest_main.a
@@ -2377,6 +2416,7 @@ lib/libclangToolingASTDiff.a
 lib/libclangToolingCore.a
 lib/libclangToolingInclusions.a
 lib/libclangToolingRefactor.a
+lib/libfindAllSymbols.a
 lib/liblldCOFF.a
 lib/liblldCommon.a
 lib/liblldCore.a
@@ -2426,8 +2466,13 @@ share/clang/clang-format-diff.py
 share/clang/clang-format-sublime.py
 share/clang/clang-format.el
 share/clang/clang-format.py
+share/clang/clang-include-fixer.el
+share/clang/clang-include-fixer.py
 share/clang/clang-rename.el
 share/clang/clang-rename.py
+share/clang/clang-tidy-diff.py
+share/clang/run-clang-tidy.py
+share/clang/run-find-all-symbols.py
 share/doc/pkg-readmes/${PKGSTEM}
 share/opt-viewer/
 share/opt-viewer/opt-diff.py

Reply | Threaded
Open this post in threaded view
|

Re: NEW: devel/llvm (Extra Clang Tools) #2

Otto Moerbeek
On Sat, Sep 21, 2019 at 02:28:46PM +0200, Rafael Sadowski wrote:

> Long time ago I was trying to import the clang extra tool sets without
> luck. It failed because the -extra subpackage has an effect on -main.
> More precisely, the cmake parts from the main package.
>
> For this reason, I think it is best to build/install the extra tools in
> the main package. I'd be in charge here, too.
>
> I also was trying to crate an extra packages, which includes only the
> extra parts but this rise more issue in the eco system.
>
> I have to deal with this topic because more and more people come up to
> me and ask about my last try, last otto@. That's good because I think
> these tools are helpful.
>
> Best regards and a nice weekend.

Thanks, works for me.

        -Otto

>
> RS
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/llvm/Makefile,v
> retrieving revision 1.234
> diff -u -p -u -p -r1.234 Makefile
> --- Makefile 9 Sep 2019 21:15:16 -0000 1.234
> +++ Makefile 21 Sep 2019 12:08:00 -0000
> @@ -18,7 +18,7 @@ PKGSPEC-main = llvm-=${LLVM_V}
>  PKGNAME-main = llvm-${LLVM_V}
>  PKGNAME-python = py-llvm-${LLVM_V}
>  PKGNAME-lldb = lldb-${LLVM_V}
> -REVISION-main = 0
> +REVISION-main = 1
>  
>  CATEGORIES = devel
>  
> @@ -40,7 +40,8 @@ EXTRACT_SUFX = .tar.xz
>  DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \
>   cfe-${LLVM_V}.src${EXTRACT_SUFX} \
>   lld-${LLVM_V}.src${EXTRACT_SUFX} \
> - lldb-${LLVM_V}.src${EXTRACT_SUFX}
> + lldb-${LLVM_V}.src${EXTRACT_SUFX} \
> + clang-tools-extra-${LLVM_V}.src${EXTRACT_SUFX}
>  
>  MULTI_PACKAGES = -main -python -lldb
>  
> @@ -131,6 +132,7 @@ post-extract:
>   mv ${WRKDIR}/cfe-${LLVM_V}.src ${WRKSRC}/tools/clang
>   mv ${WRKDIR}/lld-${LLVM_V}.src ${WRKSRC}/tools/lld
>   mv ${WRKDIR}/lldb-${LLVM_V}.src ${WRKSRC}/tools/lldb
> + mv ${WRKDIR}/clang-tools-extra-${LLVM_V}.src ${WRKSRC}/tools/clang/tools/extra
>  
>  pre-configure:
>   @${SUBST_CMD} ${WRKSRC}/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/devel/llvm/distinfo,v
> retrieving revision 1.34
> diff -u -p -u -p -r1.34 distinfo
> --- distinfo 8 Sep 2019 10:40:39 -0000 1.34
> +++ distinfo 21 Sep 2019 12:08:00 -0000
> @@ -1,8 +1,10 @@
>  SHA256 (cfe-8.0.1.src.tar.xz) = cO/9afeoqySfZrCmirqLCK9Sqiq3EN+4oPuhAmhbFkY=
> +SHA256 (clang-tools-extra-8.0.1.src.tar.xz) = GHF5thfk8Hu2BcwhXaBSfmSZC0p91cvMRSoWtk4Cw+E=
>  SHA256 (lld-8.0.1.src.tar.xz) = n7oelCSb15E+imw6rcswi3bIw9g8XONsmcPzTXOHPYg=
>  SHA256 (lldb-8.0.1.src.tar.xz) = 6Kebqm0R3QZQq0obR59pnfrYKvYny7zUn6by3BThMdc=
>  SHA256 (llvm-8.0.1.src.tar.xz) = RHh6bQL3FA8UXiJQ1WyfhJM04R+a43mCdRDtcvErdec=
>  SIZE (cfe-8.0.1.src.tar.xz) = 12810056
> +SIZE (clang-tools-extra-8.0.1.src.tar.xz) = 1994068
>  SIZE (lld-8.0.1.src.tar.xz) = 996440
>  SIZE (lldb-8.0.1.src.tar.xz) = 19586288
>  SIZE (llvm-8.0.1.src.tar.xz) = 30477608
> Index: pkg/PLIST-main
> ===================================================================
> RCS file: /cvs/ports/devel/llvm/pkg/PLIST-main,v
> retrieving revision 1.14
> diff -u -p -u -p -r1.14 PLIST-main
> --- pkg/PLIST-main 8 Jul 2019 07:56:53 -0000 1.14
> +++ pkg/PLIST-main 21 Sep 2019 12:08:00 -0000
> @@ -5,17 +5,25 @@
>  bin/clang
>  bin/clang++
>  @bin bin/clang-8
> +@bin bin/clang-apply-replacements
> +@bin bin/clang-change-namespace
>  @bin bin/clang-check
>  bin/clang-cl
>  bin/clang-cpp
>  @bin bin/clang-extdef-mapping
>  @bin bin/clang-format
>  @bin bin/clang-import-test
> +@bin bin/clang-include-fixer
>  @bin bin/clang-offload-bundler
> +@bin bin/clang-query
>  @bin bin/clang-refactor
>  @bin bin/clang-rename
> +@bin bin/clang-reorder-fields
> +@bin bin/clang-tidy
> +@bin bin/clangd
>  @bin bin/diagtool
>  @bin bin/dsymutil
> +@bin bin/find-all-symbols
>  bin/git-clang-format
>  bin/hmaptool
>  bin/ld.lld
> @@ -72,6 +80,7 @@ bin/llvm-strip
>  @bin bin/llvm-tblgen
>  @bin bin/llvm-undname
>  @bin bin/llvm-xray
> +@bin bin/modularize
>  @bin bin/obj2yaml
>  @bin bin/opt
>  @bin bin/sancov
> @@ -2349,9 +2358,13 @@ lib/libclangARCMigrate.a
>  lib/libclangAST.a
>  lib/libclangASTMatchers.a
>  lib/libclangAnalysis.a
> +lib/libclangApplyReplacements.a
>  lib/libclangBasic.a
> +lib/libclangChangeNamespace.a
>  lib/libclangCodeGen.a
>  lib/libclangCrossTU.a
> +lib/libclangDaemon.a
> +lib/libclangDoc.a
>  lib/libclangDriver.a
>  lib/libclangDynamicASTMatchers.a
>  lib/libclangEdit.a
> @@ -2360,9 +2373,14 @@ lib/libclangFrontend.a
>  lib/libclangFrontendTool.a
>  lib/libclangHandleCXX.a
>  lib/libclangHandleLLVM.a
> +lib/libclangIncludeFixer.a
> +lib/libclangIncludeFixerPlugin.a
>  lib/libclangIndex.a
>  lib/libclangLex.a
> +lib/libclangMove.a
>  lib/libclangParse.a
> +lib/libclangQuery.a
> +lib/libclangReorderFields.a
>  lib/libclangRewrite.a
>  lib/libclangRewriteFrontend.a
>  lib/libclangSema.a
> @@ -2370,6 +2388,27 @@ lib/libclangSerialization.a
>  lib/libclangStaticAnalyzerCheckers.a
>  lib/libclangStaticAnalyzerCore.a
>  lib/libclangStaticAnalyzerFrontend.a
> +lib/libclangTidy.a
> +lib/libclangTidyAbseilModule.a
> +lib/libclangTidyAndroidModule.a
> +lib/libclangTidyBoostModule.a
> +lib/libclangTidyBugproneModule.a
> +lib/libclangTidyCERTModule.a
> +lib/libclangTidyCppCoreGuidelinesModule.a
> +lib/libclangTidyFuchsiaModule.a
> +lib/libclangTidyGoogleModule.a
> +lib/libclangTidyHICPPModule.a
> +lib/libclangTidyLLVMModule.a
> +lib/libclangTidyMPIModule.a
> +lib/libclangTidyMiscModule.a
> +lib/libclangTidyModernizeModule.a
> +lib/libclangTidyObjCModule.a
> +lib/libclangTidyPerformanceModule.a
> +lib/libclangTidyPlugin.a
> +lib/libclangTidyPortabilityModule.a
> +lib/libclangTidyReadabilityModule.a
> +lib/libclangTidyUtils.a
> +lib/libclangTidyZirconModule.a
>  lib/libclangTooling.a
>  @comment lib/libgtest.a
>  @comment lib/libgtest_main.a
> @@ -2377,6 +2416,7 @@ lib/libclangToolingASTDiff.a
>  lib/libclangToolingCore.a
>  lib/libclangToolingInclusions.a
>  lib/libclangToolingRefactor.a
> +lib/libfindAllSymbols.a
>  lib/liblldCOFF.a
>  lib/liblldCommon.a
>  lib/liblldCore.a
> @@ -2426,8 +2466,13 @@ share/clang/clang-format-diff.py
>  share/clang/clang-format-sublime.py
>  share/clang/clang-format.el
>  share/clang/clang-format.py
> +share/clang/clang-include-fixer.el
> +share/clang/clang-include-fixer.py
>  share/clang/clang-rename.el
>  share/clang/clang-rename.py
> +share/clang/clang-tidy-diff.py
> +share/clang/run-clang-tidy.py
> +share/clang/run-find-all-symbols.py
>  share/doc/pkg-readmes/${PKGSTEM}
>  share/opt-viewer/
>  share/opt-viewer/opt-diff.py
>

Reply | Threaded
Open this post in threaded view
|

Re: NEW: devel/llvm (Extra Clang Tools) #2

Jeremie Courreges-Anglas-2
In reply to this post by Rafael Sadowski

Hi,

sorry for the rather late reply.  I've been mulling over this for a few
days.

On Sat, Sep 21 2019, Rafael Sadowski <[hidden email]> wrote:
> Long time ago I was trying to import the clang extra tool sets without
> luck. It failed because the -extra subpackage has an effect on -main.
> More precisely, the cmake parts from the main package.

Debian (as usual) seems to have split llvm in many subpackages.  Surely
they must have hit and solved a similar problem.

> For this reason, I think it is best to build/install the extra tools in
> the main package. I'd be in charge here, too.
>
> I also was trying to crate an extra packages, which includes only the
> extra parts but this rise more issue in the eco system.

So which problems did you hit?

> I have to deal with this topic because more and more people come up to
> me and ask about my last try, last otto@.

> That's good because I think these tools are helpful.

I can understand that, but my stance is simple: my main interest for
devel/llvm is the ports tree.

I'm not happy with longer devel/llvm *build* times but hey, if that's
the only solution available (is it?), fine, let's build those under
devel/llvm.

The size increase of the -main package is a killer IMO: 605MB -> 867MB
on amd64.  sparc64 goes from 714MB to 1.2GB.  Most of this size
increase comes from the additional executables, so removing the
additional .a libs (if possible) does not help.

So as far as I'm concerned I don't like this approach, especially with
6.6 on the radar.

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: NEW: devel/llvm (Extra Clang Tools) #2

Rafael Sadowski
On Sat Sep 28, 2019 at 01:23:06PM +0200, Jeremie Courreges-Anglas wrote:

>
> Hi,
>
> sorry for the rather late reply.  I've been mulling over this for a few
> days.
>
> On Sat, Sep 21 2019, Rafael Sadowski <[hidden email]> wrote:
> > Long time ago I was trying to import the clang extra tool sets without
> > luck. It failed because the -extra subpackage has an effect on -main.
> > More precisely, the cmake parts from the main package.
>
> Debian (as usual) seems to have split llvm in many subpackages.  Surely
> they must have hit and solved a similar problem.
>
> > For this reason, I think it is best to build/install the extra tools in
> > the main package. I'd be in charge here, too.
> >
> > I also was trying to crate an extra packages, which includes only the
> > extra parts but this rise more issue in the eco system.
>
> So which problems did you hit?
>
> > I have to deal with this topic because more and more people come up to
> > me and ask about my last try, last otto@.
>
> > That's good because I think these tools are helpful.
>
> I can understand that, but my stance is simple: my main interest for
> devel/llvm is the ports tree.
>
> I'm not happy with longer devel/llvm *build* times but hey, if that's
> the only solution available (is it?), fine, let's build those under
> devel/llvm.
>
> The size increase of the -main package is a killer IMO: 605MB -> 867MB
> on amd64.  sparc64 goes from 714MB to 1.2GB.  Most of this size
> increase comes from the additional executables, so removing the
> additional .a libs (if possible) does not help.
>
> So as far as I'm concerned I don't like this approach, especially with
> 6.6 on the radar.
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
>
Hi Jeremie, hey ports@,

I understand your objection and I have dealt more intensively with the
install step in the llvm packege and ninja. I think I found THE
SOLUTION.  I have figured out how to install ONLY the extra tools.
Besides, we don't have to build the whole LLVM stack.

Please find attached devel/clang-tools-extra as tarball. This version
was successfully tested by otto@.

I'd take care of the extra tools and keep the port in sync with
devel/llvm.

OK, concerns? Thanks, RS

clang-tools-extra-8.0.1.tar.gz (61K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NEW: devel/llvm (Extra Clang Tools) #2

Jeremie Courreges-Anglas-2
On Sat, Oct 19 2019, Rafael Sadowski <[hidden email]> wrote:

> On Sat Sep 28, 2019 at 01:23:06PM +0200, Jeremie Courreges-Anglas wrote:
>>
>> Hi,
>>
>> sorry for the rather late reply.  I've been mulling over this for a few
>> days.
>>
>> On Sat, Sep 21 2019, Rafael Sadowski <[hidden email]> wrote:
>> > Long time ago I was trying to import the clang extra tool sets without
>> > luck. It failed because the -extra subpackage has an effect on -main.
>> > More precisely, the cmake parts from the main package.
>>
>> Debian (as usual) seems to have split llvm in many subpackages.  Surely
>> they must have hit and solved a similar problem.
>>
>> > For this reason, I think it is best to build/install the extra tools in
>> > the main package. I'd be in charge here, too.
>> >
>> > I also was trying to crate an extra packages, which includes only the
>> > extra parts but this rise more issue in the eco system.
>>
>> So which problems did you hit?
>>
>> > I have to deal with this topic because more and more people come up to
>> > me and ask about my last try, last otto@.
>>
>> > That's good because I think these tools are helpful.
>>
>> I can understand that, but my stance is simple: my main interest for
>> devel/llvm is the ports tree.
>>
>> I'm not happy with longer devel/llvm *build* times but hey, if that's
>> the only solution available (is it?), fine, let's build those under
>> devel/llvm.
>>
>> The size increase of the -main package is a killer IMO: 605MB -> 867MB
>> on amd64.  sparc64 goes from 714MB to 1.2GB.  Most of this size
>> increase comes from the additional executables, so removing the
>> additional .a libs (if possible) does not help.
>>
>> So as far as I'm concerned I don't like this approach, especially with
>> 6.6 on the radar.
>>
>> --
>> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
>>
>
> Hi Jeremie, hey ports@,
>
> I understand your objection and I have dealt more intensively with the
> install step in the llvm packege and ninja. I think I found THE
> SOLUTION.  I have figured out how to install ONLY the extra tools.
> Besides, we don't have to build the whole LLVM stack.
From a quick glance at the docs, this type of target is a ninja feature.
If you apply the same trick to the build step:

  ALL_TARGET =    tools/clang/tools/extra/all

the build step moves from 3827 to 2065 targets, which should improve
build times.

> Please find attached devel/clang-tools-extra as tarball. This version
> was successfully tested by otto@.
>
> I'd take care of the extra tools and keep the port in sync with
> devel/llvm.
>
> OK, concerns? Thanks, RS

The shared libs hack looks nasty but doesn't seem needed.  Well, at
least when restricting the build step to "tools/clang/tools/extra/all".
I would just get rid of it.

More tweaks:
- swig is needed for lldb (absent from your port)
- py-recommonmark is needed for sphinx docs (disabled)
- devel/llvm already depends on devel/gtest, no need to replicate the
  dep here
- on !clang archs, devel/llvm already has the proper dep on eg++, no
  need to replicate here

Here's an updated port with those points addressed.

I suspect that a lot of the arch-specific Makefile goo isn't needed any
more.  The -Dpowerpc bits should probably be left out.




--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

clang-tools-extra-8.0.1-jca1.tar.gz (63K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NEW: devel/llvm (Extra Clang Tools) #2

Rafael Sadowski
On Sun Oct 27, 2019 at 05:07:39PM +0100, Jeremie Courreges-Anglas wrote:

> On Sat, Oct 19 2019, Rafael Sadowski <[hidden email]> wrote:
> > On Sat Sep 28, 2019 at 01:23:06PM +0200, Jeremie Courreges-Anglas wrote:
> >>
> >> Hi,
> >>
> >> sorry for the rather late reply.  I've been mulling over this for a few
> >> days.
> >>
> >> On Sat, Sep 21 2019, Rafael Sadowski <[hidden email]> wrote:
> >> > Long time ago I was trying to import the clang extra tool sets without
> >> > luck. It failed because the -extra subpackage has an effect on -main.
> >> > More precisely, the cmake parts from the main package.
> >>
> >> Debian (as usual) seems to have split llvm in many subpackages.  Surely
> >> they must have hit and solved a similar problem.
> >>
> >> > For this reason, I think it is best to build/install the extra tools in
> >> > the main package. I'd be in charge here, too.
> >> >
> >> > I also was trying to crate an extra packages, which includes only the
> >> > extra parts but this rise more issue in the eco system.
> >>
> >> So which problems did you hit?
> >>
> >> > I have to deal with this topic because more and more people come up to
> >> > me and ask about my last try, last otto@.
> >>
> >> > That's good because I think these tools are helpful.
> >>
> >> I can understand that, but my stance is simple: my main interest for
> >> devel/llvm is the ports tree.
> >>
> >> I'm not happy with longer devel/llvm *build* times but hey, if that's
> >> the only solution available (is it?), fine, let's build those under
> >> devel/llvm.
> >>
> >> The size increase of the -main package is a killer IMO: 605MB -> 867MB
> >> on amd64.  sparc64 goes from 714MB to 1.2GB.  Most of this size
> >> increase comes from the additional executables, so removing the
> >> additional .a libs (if possible) does not help.
> >>
> >> So as far as I'm concerned I don't like this approach, especially with
> >> 6.6 on the radar.
> >>
> >> --
> >> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
> >>
> >
> > Hi Jeremie, hey ports@,
> >
> > I understand your objection and I have dealt more intensively with the
> > install step in the llvm packege and ninja. I think I found THE
> > SOLUTION.  I have figured out how to install ONLY the extra tools.
> > Besides, we don't have to build the whole LLVM stack.
>
> From a quick glance at the docs, this type of target is a ninja feature.
> If you apply the same trick to the build step:
>
>   ALL_TARGET =    tools/clang/tools/extra/all
>
> the build step moves from 3827 to 2065 targets, which should improve
> build times.
>
> > Please find attached devel/clang-tools-extra as tarball. This version
> > was successfully tested by otto@.
> >
> > I'd take care of the extra tools and keep the port in sync with
> > devel/llvm.
> >
> > OK, concerns? Thanks, RS
>
> The shared libs hack looks nasty but doesn't seem needed.  Well, at
> least when restricting the build step to "tools/clang/tools/extra/all".
> I would just get rid of it.

Strange, I thought I tested it. Maybe I picked the wrong one. Works for
me and save a lot of build time (Still too much).

>
> More tweaks:
> - swig is needed for lldb (absent from your port)
> - py-recommonmark is needed for sphinx docs (disabled)
> - devel/llvm already depends on devel/gtest, no need to replicate the
>   dep here
> - on !clang archs, devel/llvm already has the proper dep on eg++, no
>   need to replicate here

Thanks!

>
> Here's an updated port with those points addressed.
>
> I suspect that a lot of the arch-specific Makefile goo isn't needed any
> more.  The -Dpowerpc bits should probably be left out.
>
>

Works fine here but it looks like we both missed the WANTLIB line:

WANTLIB += ${COMPILER_LIBCXX} c curses edit m z

OK to move it into the tree?

Reply | Threaded
Open this post in threaded view
|

Re: NEW: devel/llvm (Extra Clang Tools) #2

Jeremie Courreges-Anglas-5
On Tue, Nov 05 2019, Rafael Sadowski <[hidden email]> wrote:
> On Sun Oct 27, 2019 at 05:07:39PM +0100, Jeremie Courreges-Anglas wrote:

[...]

>> Here's an updated port with those points addressed.
>>
>> I suspect that a lot of the arch-specific Makefile goo isn't needed any
>> more.  The -Dpowerpc bits should probably be left out.
>>
>>
>
> Works fine here but it looks like we both missed the WANTLIB line:
>
> WANTLIB += ${COMPILER_LIBCXX} c curses edit m z
>
> OK to move it into the tree?

Let's remove the arch-specific workarounds before importing this.
Disabling retpoline or ret-protector either isn't warranted either in my
book (it's not on the path to other ports).  On top of my previous
tarball that would give the following diff.  With this, ok jca@


--- Makefile.jca Tue Nov  5 18:32:54 2019
+++ Makefile Tue Nov  5 18:34:47 2019
@@ -27,6 +27,8 @@
 # BSD
 PERMIT_PACKAGE = Yes
 
+WANTLIB += ${COMPILER_LIBCXX} c curses edit m z
+
 MASTER_SITES = https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_V}/
 EXTRACT_SUFX = .tar.xz
 
@@ -62,30 +64,6 @@
  -DLLVM_INCLUDE_EXAMPLES=OFF \
  -DLLVM_INCLUDE_TESTS=OFF \
  -DLLVM_INCLUDE_BENCHMARKS=OFF
-
-# Disable some protections in the compiler to regain performance
-.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
-    ${MACHINE_ARCH} == "i386"
-CXXFLAGS += -fno-ret-protector
-.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
-CXXFLAGS += -mno-retpoline
-.endif
-
-# Workaround relocation overflow
-.if ${MACHINE_ARCH} == "powerpc"
-# As a workaround for the size only build the PowerPC backend
-CONFIGURE_ARGS += -DLLVM_TARGETS_TO_BUILD="PowerPC"
-.elif ${MACHINE_ARCH} == "arm"
-CFLAGS += -mlong-calls
-CXXFLAGS += -mlong-calls
-.endif
-
-.if ${MACHINE_ARCH} == "powerpc"
-PKG_ARGS += -Dpowerpc=1
-.else
-PKG_ARGS += -Dpowerpc=0
-.endif
 
 GCC_VER = 8.3.0
 .if ${MACHINE_ARCH} == "amd64"


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE