Skip to content

Commit 255e309

Browse files
authored
Merge pull request #19 from hellium6/llvm20
Add LLVM20, updates for later zig and zls versions
2 parents 0254d4e + 001f7ef commit 255e309

36 files changed

+9741
-1280
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ ZIGF=$(curl -s https://ziglang.org/download/ | grep '\-dev' | head -n1 | sed -ne
6565
## put the fetched value in previous command as DISTNAME
6666
sed -i -e "s/^DISTNAME=.*/DISTNAME= $ZIGF/" Makefile
6767
## or enter manually
68-
#sed -i -e 's/^DISTNAME=.*/DISTNAME= zig-0.15.0-dev.56+d0911786c/' Makefile
68+
#sed -i -e 's/^DISTNAME=.*/DISTNAME= zig-0.15.0-dev.929+31e46be74/' Makefile
6969
## optionally change MASTER_SITES to use a mirror
7070
sed -i -e 's/^MASTER_SITES=.*/MASTER_SITES= https:\/\/zig.linus.dev\/zig\//' Makefile
7171
make makesum # update checksums according to new DISTNAME
@@ -109,9 +109,9 @@ Target: x86_64-unknown-netbsd10.0
109109
Thread model: posix
110110
InstalledDir: /usr/pkg/llvm19/bin
111111
$ zig-master version
112-
0.15.0-dev.77+aa8aa6625
112+
0.15.0-dev.300+9e21ba12d
113113
$ pkg_info -a | grep ^zig
114-
zig-master-0.15.0-dev.77+aa8aa6625 Programming language designed for robustness and clarity
114+
zig-master-0.15.0-dev.300+9e21ba12d Programming language designed for robustness and clarity
115115
```
116116

117117
Example of working with both Zig and Zig master on the same system:
@@ -123,7 +123,7 @@ $ doas pkgin in zig
123123
$ zig version
124124
0.13.0
125125
$ zig-master version
126-
0.15.0-dev.77+aa8aa6625
126+
0.15.0-dev.300+9e21ba12d
127127
### For lang/zig-0.14.0 you'd have to run zig-0.14.0 or
128128
### if you've changed DISTNAME, type "zig" and press tab twice for hint.
129129
### Example:
@@ -135,7 +135,7 @@ $ zig-master version
135135
$ alias zig=zig-master
136136
### above can be added in ~/.bashrc to do this automatically on startup
137137
$ zig version
138-
0.15.0-dev.77+aa8aa6625
138+
0.15.0-dev.300+9e21ba12d
139139
$ cd `mktemp -d`
140140
$ zig init
141141
info: created build.zig
@@ -154,12 +154,12 @@ Example of uninstalling a package:
154154

155155
```sh
156156
$ pkg_info -a | grep ^zig
157-
zig-master-0.15.0-dev.77+aa8aa6625 Programming language designed for robustness and clarity
157+
zig-master-0.15.0-dev.300+9e21ba12d Programming language designed for robustness and clarity
158158
### For lang/zig-0.14.0 the output might be something like:
159159
### zig-isolated0140-0.14.0 Programming language designed for robustness and clarity (prefix isolated)
160160
### For lang/zig-0.13.0 that might be something like:
161161
### zig-isolated0130-0.13.0nb1 Programming language designed for robustness and clarity (prefix isolated)
162-
$ doas pkg_delete zig-master-0.15.0-dev.77+aa8aa6625
162+
$ doas pkg_delete zig-master-0.15.0-dev.300+9e21ba12d
163163
```
164164

165165
### ZLS

pkgsrc/devel/lld20/DESCR

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
LLD is a linker from the LLVM project that is a drop-in replacement for
2+
system linkers and runs much faster than them. It also provides features
3+
that are useful for toolchain developers.
4+
5+
The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS) and
6+
WebAssembly in descending order of completeness. Internally, LLD
7+
consists of several different linkers. The PE/COFF port is complete,
8+
including Windows debug info (PDB) support. The WebAssembly port is
9+
still a work in progress (See WebAssembly lld port). The Mach-O port is
10+
built based on a different architecture than the others. For the details
11+
about Mach-O, please read ATOM-based lld.

pkgsrc/devel/lld20/Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# $NetBSD: Makefile,v 1.26 2024/08/25 06:18:36 wiz Exp $
2+
3+
.include "../../lang/llvm20/version.mk"
4+
5+
DISTNAME= lld-${LLVM_VERSION}.src
6+
## So that this devel/lldXX package can live with devel/lld package
7+
PKGNAME= lld${LLVM_MAJOR_VERSION}-${LLVM_VERSION}
8+
CATEGORIES= devel
9+
10+
MAINTAINER= [email protected]
11+
HOMEPAGE= https://lld.llvm.org/
12+
COMMENT= The LLVM Linker
13+
LICENSE= apache-2.0
14+
15+
USE_CXX_FEATURES= c++14
16+
USE_LANGUAGES= c c++
17+
GCC_REQD+= 7
18+
19+
CMAKE_CONFIGURE_ARGS+= -DCMAKE_BUILD_TYPE=Release
20+
CMAKE_CONFIGURE_ARGS+= -DCMAKE_C_COMPILER=${CC:Q}
21+
CMAKE_CONFIGURE_ARGS+= -DCMAKE_CXX_COMPILER=${CXX:Q}
22+
23+
PYTHON_FOR_BUILD_ONLY= yes
24+
25+
INSTALLATION_DIRS+= libexec/lld
26+
27+
post-configure:
28+
## Workaround to make CMake see the paths
29+
${FIND} ${WRKSRC} -name CMakeCache\.txt -exec sed -i'_orig' \
30+
-e 's,^CMAKE_INSTALL_PREFIX:PATH=/usr/pkg,CMAKE_INSTALL_PREFIX:PATH='${LLVM_ISOLATED_PREFIX}',' \
31+
{} \;
32+
33+
post-install:
34+
## We make binaries available as binnameXX so that it doesn't
35+
## conflict with devel/lld files
36+
${LN} -sf ${LLVM_ISOLATED_PREFIX_BASENAME}/bin/lld ${DESTDIR}${PREFIX}/libexec/lld/ld${LLVM_MAJOR_VERSION}
37+
38+
${MKDIR} -p ${DESTDIR}${PREFIX}/bin
39+
${FIND} ${DESTDIR}${LLVM_ISOLATED_PREFIX}/bin -mindepth 1 -execdir \
40+
${LN} -vsf ${LLVM_ISOLATED_PREFIX}/bin/{} ${DESTDIR}${PREFIX}/bin/{}${LLVM_MAJOR_VERSION} \;
41+
42+
.include "options.mk"
43+
.include "../../devel/cmake/build.mk"
44+
.include "../../lang/llvm20/buildlink3.mk"
45+
.include "../../lang/libunwind/buildlink3.mk"
46+
.include "../../lang/python/tool.mk"
47+
.include "../../mk/atomic64.mk"
48+
.include "../../mk/bsd.pkg.mk"

pkgsrc/devel/lld20/PLIST

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@comment $NetBSD$
2+
bin/ld.lld20
3+
bin/ld64.lld20
4+
bin/lld-link20
5+
bin/lld20
6+
bin/wasm-ld20
7+
libexec/lld/ld20
8+
llvm20/bin/ld.lld
9+
llvm20/bin/ld64.lld
10+
llvm20/bin/lld
11+
llvm20/bin/lld-link
12+
llvm20/bin/wasm-ld
13+
llvm20/include/lld/Common/Args.h
14+
llvm20/include/lld/Common/Arrays.h
15+
llvm20/include/lld/Common/CommonLinkerContext.h
16+
llvm20/include/lld/Common/DWARF.h
17+
llvm20/include/lld/Common/Driver.h
18+
llvm20/include/lld/Common/ErrorHandler.h
19+
llvm20/include/lld/Common/Filesystem.h
20+
llvm20/include/lld/Common/LLVM.h
21+
llvm20/include/lld/Common/Memory.h
22+
llvm20/include/lld/Common/Reproduce.h
23+
llvm20/include/lld/Common/Strings.h
24+
llvm20/include/lld/Common/TargetOptionsCommandFlags.h
25+
llvm20/include/lld/Common/Timer.h
26+
llvm20/include/lld/Common/Version.h
27+
llvm20/lib/cmake/lld/LLDConfig.cmake
28+
llvm20/lib/cmake/lld/LLDConfigVersion.cmake
29+
llvm20/lib/cmake/lld/LLDTargets-release.cmake
30+
llvm20/lib/cmake/lld/LLDTargets.cmake
31+
llvm20/lib/liblldCOFF.a
32+
llvm20/lib/liblldCommon.a
33+
llvm20/lib/liblldELF.a
34+
llvm20/lib/liblldMachO.a
35+
llvm20/lib/liblldMinGW.a
36+
llvm20/lib/liblldWasm.a

pkgsrc/devel/lld20/buildlink3.mk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# $NetBSD: buildlink3.mk,v 1.8 2024/07/06 15:45:08 adam Exp $
2+
3+
BUILDLINK_TREE+= lld
4+
5+
.if !defined(LLD_BUILDLINK3_MK)
6+
LLD_BUILDLINK3_MK:=
7+
8+
BUILDLINK_API_DEPENDS.lld+= lld20>=20.0.0
9+
BUILDLINK_PKGSRCDIR.lld?= ../../devel/lld20
10+
11+
## Consider the /usr/pkg/llvmXX prefix
12+
BUILDLINK_PASSTHRU_DIRS+= ${BUILDLINK_PREFIX.lld}/${LLVM_ISOLATED_PREFIX_BASENAME}
13+
BUILDLINK_INCDIRS.lld?= ${LLVM_ISOLATED_PREFIX_BASENAME}/include
14+
BUILDLINK_LIBDIRS.lld+= ${LLVM_ISOLATED_PREFIX_BASENAME}/lib
15+
16+
.include "../../lang/llvm20/buildlink3.mk"
17+
.endif # LLD_BUILDLINK3_MK
18+
19+
BUILDLINK_TREE+= -lld

pkgsrc/devel/lld20/distinfo

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$NetBSD: distinfo,v 1.24 2024/07/06 15:45:08 adam Exp $
2+
3+
BLAKE2s (cmake-20.1.6.src.tar.xz) = f72b52fc2d78065651175d7d654d1cf75799a4581641f85c63aebb1ea2bc8c60
4+
SHA512 (cmake-20.1.6.src.tar.xz) = 6606f362bc84d986bc54925ea67a9cdd3ca50b730a6a308949ce851ee43d137b62e1bad11292af071224f80313501c18b1f291bf1084ba08bfa27adc5627ab83
5+
Size (cmake-20.1.6.src.tar.xz) = 8644 bytes
6+
BLAKE2s (lld-20.1.6.src.tar.xz) = 16ccc3aa49ae60500c065b89ca5dba773cc26e29affc4ec0121c7b8240ef39d6
7+
SHA512 (lld-20.1.6.src.tar.xz) = 519f2fed14c35098363fed611f235759c69749e091b8b3661c61430dc2e85f65d43155dcb17352be0a63280527b7e38552b692672c6fd2202da84c992100d39c
8+
Size (lld-20.1.6.src.tar.xz) = 1720344 bytes
9+
BLAKE2s (runtimes-20.1.6.src.tar.xz) = d7560527b16ff68f15c50c0a5a59c6299cfa36252b5af947715a23c367348e3e
10+
SHA512 (runtimes-20.1.6.src.tar.xz) = 5155f8b9494596d08c7af06ace8b5c5193f001eb182f931ee84af11e834058e5ff8b8deb945ff0b72bb759c84bccd83de8086ddf973cd93d86b91f4c9bec3f18
11+
Size (runtimes-20.1.6.src.tar.xz) = 8332 bytes
12+
SHA1 (patch-ELF_Config.h) = 484d0818bd4a92f2faafa1337d3f2f08cab4c0fc
13+
SHA1 (patch-ELF_Options.td) = c81907d6e5e099ed2c26de972c6744b7197de3d3

pkgsrc/devel/lld20/options.mk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# $NetBSD: options.mk,v 1.2 2024/08/25 06:18:36 wiz Exp $
2+
3+
PKG_OPTIONS_VAR= PKG_OPTIONS.lld
4+
PKG_SUPPORTED_OPTIONS= tests
5+
6+
.include "../../mk/bsd.options.mk"
7+
8+
.if !empty(PKG_OPTIONS:Mtests)
9+
DISTFILES+= llvm-${PKGVERSION_NOREV}.src${EXTRACT_SUFX}
10+
CMAKE_CONFIGURE_ARGS+= -DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q}
11+
CMAKE_CONFIGURE_ARGS+= -DLLVM_INCLUDE_TESTS=ON
12+
CMAKE_CONFIGURE_ARGS+= -DLLVM_BUILD_TESTS=ON
13+
CMAKE_CONFIGURE_ARGS+= -DLLVM_MAIN_SRC_DIR=${WRKDIR}/llvm-${PKGVERSION_NOREV}.src
14+
CMAKE_CONFIGURE_ARGS+= -DLLVM_EXTERNAL_LIT=${WRKDIR}/llvm-${PKGVERSION_NOREV}.src/utils/lit/lit.py
15+
REPLACE_PYTHON+= ${WRKDIR}/llvm-${PKGVERSION_NOREV}.src/utils/lit/lit.py
16+
TEST_TARGET= check-lld # failing tests fixed in 8.0
17+
TEST_ENV+= LD_LIBRARY_PATH=${WRKDIR}/build/lib
18+
.else
19+
CMAKE_CONFIGURE_ARGS+= -DLLVM_INCLUDE_TESTS=OFF
20+
.endif
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$NetBSD: patch-ELF_Config.h,v 1.9 2022/08/12 08:52:51 pin Exp $
2+
3+
Add dummy option for an AArch64 erratum.
4+
5+
--- ELF/Config.h.orig 2024-09-17 11:26:36.000000000 +0000
6+
+++ ELF/Config.h
7+
@@ -247,6 +247,7 @@ struct Config {
8+
bool enableNonContiguousRegions;
9+
bool executeOnly;
10+
bool exportDynamic;
11+
+ bool fixCortexA53Errata835769;
12+
bool fixCortexA53Errata843419;
13+
bool fixCortexA8;
14+
bool formatBinary = false;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$NetBSD: patch-ELF_Options.td,v 1.5 2022/08/12 08:52:51 pin Exp $
2+
3+
Add dummy option for an AArch64 erratum.
4+
5+
--- ELF/Options.td.orig 2022-06-22 16:46:24.000000000 +0000
6+
+++ ELF/Options.td
7+
@@ -217,6 +217,9 @@ defm filter: Eq<"filter", "Set DT_FILTER
8+
9+
defm fini: Eq<"fini", "Specify a finalizer function">, MetaVarName<"<symbol>">;
10+
11+
+def fix_cortex_a53_835769: F<"fix-cortex-a53-835769">,
12+
+ HelpText<"Apply fixes for AArch64 Cortex-A53 erratum 835769">;
13+
+
14+
def fix_cortex_a53_843419: F<"fix-cortex-a53-843419">,
15+
HelpText<"Apply fixes for AArch64 Cortex-A53 erratum 843419">;
16+

pkgsrc/devel/zls-master/distinfo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$NetBSD: distinfo,v 1.1 2024/04/29 13:27:52 nikita Exp $
22

3-
BLAKE2s (master.zip) = 22d5b9c0a1247d74c7706db265937125a47417c030d996990ff830fe0b9665c6
4-
SHA512 (master.zip) = aefc4b2d9a12020fe2226f3791bfef432d75566321ea5c6d0ac8e6682e925387e0b0b3eea26fa4e870aed9d4ea9bce62229c30cc297fbf718a01fd662941239a
5-
Size (master.zip) = 437904 bytes
3+
BLAKE2s (master.zip) = 26ee2f4248195e4f5895b32e12343f2a5f58fdc8af4ef65a9ad429fa20143f21
4+
SHA512 (master.zip) = ec25c0b8856639d440caf581a826f19250fe9c5a5f9e2091795e49ae21f37c186a2ec45b84db1aabeb60d4da1ea228039495225e3374a64f79c6bc8322259f18
5+
Size (master.zip) = 480489 bytes

0 commit comments

Comments
 (0)