Remove version.spec.inc from git
================================
We no longer track `version.spec.inc` in git. This is useful for
development. If we build a snapshot, the file is required but if we
build a `release` build (see below), then we don't include it.
Make improvements
=================
We distinguish between `snapshot-` and `release-` builds now in the
`Makefile`. These old targets are mapped to their new counterparts and a
deprecation warning is shown:
* `setup` -> `snapshot-setup`
* `local-rpm` -> `snapshot-rpm`
* `local-srpm` -> `snapshot-srpm`
* `local-prep` -> `snapshot-prep`
* `local-clean` -> `snapshot-clean`
We also have these new Make targets that run the build process with a
release tarball instead:
* `release-setup`
* `release-rpm`
* `release-srpm`
* `release-prep`
* `release-clean`
The targets `local-list-check` and `local-tmt-vm` have been commented
out because I think they were not needed. I just kept them for future
reference of research done in those areas.
All builds described by the `Makefile` are still local and no `mock` is
involved. I find this the easiest to debug.
Toggle default bcond state for snapshot_build
=============================================
We want to be able to build non-snapshot releases with this repo. That's
why be default the build condition `snapshot_build` is off. So
only when you explicitly enable `--with=snapshot_build` or define
`--define "_with_snapshot_build 1"` you'll be able to build a snapshot.
If however the build happens in Copr with a namespace that begins with
`fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by
default and there's no need to enable it explicitly with `--with=snapshot_build`.
Things related to release update
================================
* Add llvm-project tarball and signature to sources
* Fix: error: source 1001 defined multiple times
* Fix: error: source 1006 defined multiple times
* Fix missing newline
* Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch
* Only enable offload runtime in snapshot mode
Misc.
=====
* Add missing prep dependency
This should make it easier to analyze which parts of the build
are slow. The new package is only available in snapshot builds,
we don't want to ship it in production.
This ports the change from https://src.fedoraproject.org/rpms/compiler-rt/pull-request/67
to big-merge, which is a bit more complicated here due to the
explicit file lists.
By default compiler_rt_triple is the same as llvm_triple. For x86
it is i386-redhat-linux-gnu instead, with a symlink to the
llvm_triple i686-redhat-linux-gnu.
And then the file list also needs to ship that symlink.
The clang resource directory is always in lib/, while this was
creating the directories in lib64 (for 64-bit symbols).
This should fix the following error on ppc64le:
> error: Directory not found: /builddir/build/BUILDROOT/llvm-19.0.0~pre20240528.g1de1ee9cbabd64-1.fc39.ppc64le/usr/lib/clang/19/bin
Have a --with lto_build option, where LTO is enabled by default
for everything except i686 and riscv. Use that flag to condition
whether `-DLLVM_UNITTEST_LINK_FLAGS` is passed.
Additionally, make use of the new Fat LTO functionality in rawhide
to use `-fno-lto` instead of `-Wl,-plugin-opt=O0` to save more
time linking unit tests.
We were defining lto_cflags in three places. It looks like on
aarch64 nil won (LTO disabled), while on other architectures
`-flto=thin` won.
I think on rawhide, this means that we're currently shipping
bitcode in static archives, because the required
`-ffat-lto-objects` option from redhat-rpm-config is missing.
Resolve this by leaving the option at its default value --
if enabling it on aarch64 causes issues, we can disable it just
there again.
Also reenable the LLVM_UNITTEST_LINK_FLAGS option, which should
reduce the amount of time LTO takes.
Fix these errors on s390x by excluding the files on that arch:
File not found: /builddir/build/BUILDROOT/llvm-19.0.0~pre20240526.gc87a7b3bdb6737-1.fc41.s390x/usr/lib/clang/19/lib/s390x-redhat-linux-gnu/clang_rt.crtbegin.o
File not found: /builddir/build/BUILDROOT/llvm-19.0.0~pre20240526.gc87a7b3bdb6737-1.fc41.s390x/usr/lib/clang/19/lib/s390x-redhat-linux-gnu/clang_rt.crtend.o
File not found: /builddir/build/BUILDROOT/llvm-19.0.0~pre20240526.gc87a7b3bdb6737-1.fc41.s390x/usr/lib/clang/19/lib/s390x-redhat-linux-gnu/liborc_rt.a
Fix this error on i686 by explicitly creating the directory.
This matches what the implementation did pre-big-merge. I think
we do want to keep this directory structure consistent across all
arches.
Directory not found: /builddir/build/BUILDROOT/llvm-19.0.0~pre20240526.gc87a7b3bdb6737-1.fc41.i386/usr/lib/clang/19/bin
This should fix this error which appears on RHEL only:
```
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/sphinx/config.py", line 326, in eval_config_file
execfile_(filename, namespace)
File "/usr/lib/python3.9/site-packages/sphinx/util/pycompat.py", line 88, in execfile_
exec(code, _globals)
File "/builddir/build/BUILD/llvm-project-c1d5cc99c6ba8e897ea145dbb2221a155b5e3e5a/llvm/redhat-linux-build/tools/clang/docs/conf.py", line 42, in <module>
import myst_parser
ModuleNotFoundError: No module named 'myst_parser'
```
See also https://github.com/fedora-llvm-team/llvm-snapshots/issues/492