Commit graph

806 commits

Author SHA1 Message Date
Nikita Popov
3e8f8bf09f Exclude hwasan_symbolize on i686 2024-05-28 16:01:28 +02:00
Nikita Popov
4f3c9f6743 Add i686 -> i386 compiler-rt symlink
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.
2024-05-28 15:57:25 +02:00
Nikita Popov
21909abc79 Fix clang resource directory path
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
2024-05-28 09:41:56 +00:00
Nikita Popov
076286ee98 Remove fedora 38 related workarounds
This chroot is no longer supported on copr.
2024-05-28 08:36:49 +02:00
Nikita Popov
1654df4ed3 Make lto handling similar to current rawhide
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.
2024-05-27 12:42:49 +00:00
Nikita Popov
dd570eaeab Clean up the lto_cflags mess
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.
2024-05-27 12:42:49 +00:00
Nikita Popov
bdef5bb591 More fixes for file lists
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
2024-05-27 09:05:05 +02:00
Nikita Popov
9c52ec74ce Fix i386 build
These binaries are not created on i386, so don't try to remove
them. Alternatively could use rm -f.
2024-05-23 16:07:15 +02:00
Konrad Kleine
8d45d61a8d Fix ModuleNotFoundError: No module named 'myst_parser'
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
2024-05-22 23:42:30 +02:00
Nikita Popov
e0a9a93370 Use wildcard for sanitizer ignore/abi lists
The list of supported sanitizers differs per target, and depending
on that some of these files may or may not be present. Use a
wildcard rather than explicitly listing this out.
2024-05-22 09:23:29 +02:00
Tulio Magno Quites Machado Filho
b9e4db6642 Fix rhbz #2248872
Ensure the versioned llvm-config alternative gets removed during major
upgrades of the non-compat package.

Also add code that removes the versioned llvm-config alternatives of
the previous 3 LLVM versions. These versions didn't remove their own
versioned llvm-config alternative, leading to broken output, e.g.
llvm-config-16 points to llvm-config-64 from LLVM 17.
2024-05-21 12:18:51 +00:00
Nikita Popov
18588fefc1 Use wildcard for libclang_rt libraries
https://github.com/llvm/llvm-project/pull/92456 added a new
libclang_rt.ctx_profile.a library.

Given that these all have a fixed prefix, I think it's fine to
use a wildcard for them instead of explicitly listing them.
2024-05-20 06:49:48 +02:00
Konrad Kleine
e2c0dad901 Fixup File listed twice warning:
This is a fixup for 66fec669b9.

This fixes these RPM build warnings about cmake files being listed twice.

```
RPM build warnings:
    File listed twice: /usr/lib64/cmake/clang/AddClang.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangConfig.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangConfigVersion.cmake
    File listed twice:
/usr/lib64/cmake/clang/ClangTargets-relwithdebinfo.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangTargets.cmake
/usr/share/clang/clang-format-ddiff.py
    File listed twice: /usr/lib64/cmake/clang/AddClang.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangConfig.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangConfigVersion.cmake
    File listed twice:
/usr/lib64/cmake/clang/ClangTargets-relwithdebinfo.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangTargets.cmake
/usr/share/clang/clang-format-diff.py
```
2024-05-17 08:46:08 +00:00
Konrad Kleine
66fec669b9 Avoid listing files twice
This should solve this warning:

```
RPM build warnings:
    File listed twice: /usr/lib64/cmake/clang/AddClang.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangConfig.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangConfigVersion.cmake
    File listed twice:
/usr/lib64/cmake/clang/ClangTargets-relwithdebinfo.cmake
    File listed twice: /usr/lib64/cmake/clang/ClangTargets.cmake
    absolute symlink: /usr/bin/clang-format-diff ->
/usr/share/clang/clang-format-diff.py
    File listed twice:
/usr/lib/clang/19/include/fuzzer/FuzzedDataProvider.h
    File listed twice: /usr/lib/clang/19/include/orc/c_api.h
    File listed twice:
/usr/lib/clang/19/include/profile/InstrProfData.inc
    File listed twice:
/usr/lib/clang/19/include/profile/instr_prof_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/allocator_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/asan_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/common_interface_defs.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/coverage_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/dfsan_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/hwasan_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/linux_syscall_hooks.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/lsan_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/memprof_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/msan_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/netbsd_syscall_hooks.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/scudo_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/tsan_interface.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/tsan_interface_atomic.h
    File listed twice:
/usr/lib/clang/19/include/sanitizer/ubsan_interface.h
    File listed twice: /usr/lib/clang/19/include/xray/xray_interface.h
    File listed twice:
/usr/lib/clang/19/include/xray/xray_log_interface.h
    File listed twice: /usr/lib/clang/19/include/xray/xray_records.h
    File listed twice: /usr/lib/clang/19/share/asan_ignorelist.txt
    File listed twice: /usr/lib/clang/19/share/cfi_ignorelist.txt
```
2024-05-16 14:03:39 +00:00
Konrad Kleine
9c7986e842 make: Remove LTO objects when cleaning 2024-05-16 13:57:59 +00:00
Konrad Kleine
c24f8fd213 Remove no longer used %llvm_snapshot_source_prefix macro 2024-05-16 12:28:49 +00:00
Konrad Kleine
25d4d7c570 List compiler-rt files
Before I've used `%ifnarch` in the `<FILE>` included with `%files -f <FILE>`.
This produced this error:

```
RPM build errors:
    File must begin with "/": %ifnarch
    File must begin with "/": i386
    File must begin with "/": i486
    File must begin with "/": i586
    File must begin with "/": i686
    File must begin with "/": pentium3
    File must begin with "/": pentium4
    File must begin with "/": athlon
    File must begin with "/": geode
    File must begin with "/": %endif
```

We can optimize this at any point in time later.
2024-05-15 14:44:58 +00:00
Konrad Kleine
d8c157e0e8 Fix paths for compiler-rt files 2024-05-15 13:25:34 +00:00
Konrad Kleine
169d5a1490 Add triple prefix to clang config files
See https://src.fedoraproject.org/rpms/clang/pull-request/240
2024-05-15 13:02:24 +00:00
Konrad Kleine
e49125cc6b Remove OMP SOs
The SOs are no longer installed since this commit:
fa9e90f5d2
2024-05-15 11:41:32 +00:00
Konrad Kleine
b6fa18a60e Use github source code archive
Instead of generating our own archive we now use the github generated
source code archive instead [1]. We now only sync on the LLVM version
and git revision via our own github releases [2].

[1]: https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives#source-code-archive-urls
[2]: https://github.com/fedora-llvm-team/llvm-snapshots/releases/tag/snapshot-version-sync
2024-05-15 11:41:32 +00:00
Konrad Kleine
7c6032138e Fix path to files.compiler-rt.spec.inc 2024-05-13 16:35:09 +00:00
Konrad Kleine
12f6088822 Leave note on removal of all binaries when installing clang compat 2024-05-13 13:13:03 +00:00
Konrad Kleine
384964f66e Remove package libomp-tools
We don't want to package it for RHEL, so we remove it here as well.
2024-05-13 13:05:51 +00:00
Konrad Kleine
2cced93770 Leave note for lld compat packaging 2024-05-13 12:51:15 +00:00
Konrad Kleine
867ae19009 Manually associate files with compiler-rt 2024-05-13 12:41:51 +00:00
Konrad Kleine
fcda275cab Add cmake files explicitly to clang-devel 2024-05-10 12:31:45 +00:00
Konrad Kleine
9b0d37e0c6 Add *.so libraries explicitly for clang-devel
We had too many `*.so` libraries added to the `clang-devel` package.

Before we've added these implicitly by accident:

```
/usr/lib64/libLLVM.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libLTO.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libRemarks.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libclang-cpp.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libclang.so.19.0.0pre20240509.g943617d12ccbd3
/usr/lib64/libclang.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/liblldCOFF.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/liblldCommon.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/liblldELF.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/liblldMachO.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/liblldMinGW.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/liblldWasm.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libomptarget.rtl.amdgpu.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libomptarget.rtl.cuda.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libomptarget.rtl.host.so.19.0pre20240509.g943617d12ccbd3
/usr/lib64/libomptarget.so.19.0pre20240509.g943617d12ccbd3
```

And now we're adding just these because these are the ones that used to
exist within the clang-devel package when it was still being built in
standalone mode:

```
/usr/lib64/libclang-cpp.so
/usr/lib64/libclang.so
```
2024-05-10 10:38:37 +00:00
Konrad Kleine
0997a36a3a Add /usr/share/man/man1/extraclangtools.1.gz to clang-tools-extra 2024-05-10 06:08:45 +00:00
Konrad Kleine
8eb23462f5 List %license for each sub-package 2024-05-10 06:05:31 +00:00
Konrad Kleine
cc68af0166 Adjust URL: and License: tags
The default `License:`-tag on the top-level llvm package is
`Apache-2.0 WITH LLVM-exception OR NCSA` and the default `URL:`-tag is
`http://llvm.org`.

These will be inherited by all sub-packages and so we only need to list
exceptions in the spec file.
2024-05-10 05:57:26 +00:00
Konrad Kleine
3072120e09 Add libomp-tools package
This is to host these files which were installed but previously went
unpackaged:

```
/usr/bin/llvm-omp-device-info
/usr/bin/llvm-omp-kernel-replay
```
2024-05-10 05:56:15 +00:00
Konrad Kleine
aa332fd308 Fixup for ead79795eb 2024-05-08 17:50:31 +00:00
Konrad Kleine
53956c69e3 Manually list binaries and manpages files for the llvm package 2024-05-08 13:26:40 +00:00
Konrad Kleine
0f9eec196f Use LICENSE.TXT file from lld directory 2024-05-08 11:08:59 +00:00
Konrad Kleine
ead79795eb Inline %post and %postun code for llvm-devel 2024-05-08 11:04:38 +00:00
Konrad Kleine
94e85e9ee1 Explicitly name %ldconfig_scriptlets for llvm-libs package 2024-05-08 11:03:59 +00:00
Konrad Kleine
ca1873ab2a Always build shared libs for LLD
We don't want to enable BUILD_SHARED_LIBS for the whole build,
but we do want to build lld libraries.
2024-05-08 08:34:28 +00:00
Konrad Kleine
abce59b8a2 Use lit from in-source 2024-05-08 08:34:18 +00:00
Konrad Kleine
dab3420c0b Remove LLD's HTML documentation files 2024-05-08 08:34:18 +00:00
Nikita Popov
e2b1846619 Explicitly disable LLVM_APPEND_VC_REV
This already happens implicitly because we don't build from a git
checkout. However, currently this also breaks the build due to
https://github.com/llvm/llvm-project/pull/88164. Avoid this by
explicitly disabling the option.
2024-05-08 12:45:11 +09:00
Konrad Kleine
e38f6773f7 Fix path 2024-05-06 14:41:14 +00:00
Konrad Kleine
46b9426cde Remove LLVM_CMAKE_DIR and LLVM_MAIN_SRC_DIR cmake config options 2024-05-06 13:01:05 +00:00
Konrad Kleine
62d32c91f4 enable lld project 2024-05-06 13:00:42 +00:00
Konrad Kleine
86afbcc16c Adjust download URL for tarballs to new project location 2024-05-06 10:48:11 +00:00
Konrad Kleine
ec20e04c07 Fix lld scriptlet naming 2024-05-06 09:05:40 +00:00
Konrad Kleine
e44d92df5c More explicit %postun and %post scriptlets 2024-05-06 09:00:19 +00:00
Konrad Kleine
51efd8123c Apply lld patch 2024-05-06 08:59:45 +00:00
Konrad Kleine
6456b314bc Integrate lld.spec into spec files 2024-05-06 08:20:29 +00:00
Konrad Kleine
f68a60f27c Add lld.spec and patch file 2024-05-06 08:20:29 +00:00