79 Commits

Author SHA1 Message Date
Martin Storsjö 087c11746a dockerfile: Skip the openmp tests for arm64ec
This was missed in 4700b4f7bb.
2025-07-18 19:47:28 +03:00
Martin Storsjö cb92de78e7 Include arm64ec in the lists of all architectures
Since LLVM 21.x, the upstream support for ARM64EC in LLD and
compiler-rt is complete enough for us to be able to build it.
2025-07-17 22:48:39 +03:00
Martin Storsjö ed0234b254 docker: Bump the base images to Ubuntu 24.04
As the releases are built (without a surrounding extra container)
on GitHub Actions these days, we don't need to hold the docker
images back to an old version for the sake of compatibility;
instead, updating to a newer version provides more modern tools
for users of the docker image.

The script release.sh, which earlier was used for building releases,
uses docker for doing clean isolated builds, and thus needs to be
updated with the distro version used in the dockerfiles.
2025-04-09 14:28:54 +03:00
Martin Storsjö 83b64f3049 docker: Install nasm instead of yasm
This is one of the packages which aren't needed by the toolchain
build itself, but is provided as a convenience to useres of the image.

Many projects that build standalone x86 assembly can use either
nasm or yasm, but lately most projects prefer nasm (which has
support for newer x86 simd extensions).
2025-01-07 15:52:42 +02:00
Martin Storsjö da453b9920 docker: Stop installing python3-distutils
In Ubuntu 24.04, this package is no longer available.

However, this package probably never actually was needed anyway,
and was probably only provided as a convenience for users of the
docker image.
2025-01-07 15:47:57 +02:00
Martin Storsjö e2e9216853 wrappers: Use clang config files for defaults
This makes these defaults more easy to get picked up in various
use cases, when not directly executing a compiler.
2024-11-06 11:40:30 +02:00
Martin Storsjö e0964ce24c Revert use of Clang config files
This reverts commit 49db4a3a15,
9f1f0104f1,
4f95c14adf,
c34dc64028,
570fdcd251,
4bff0298c5 and
6939aee0c0.

When relying on Clang config files, two issues appeared:

- Running the compiler-rt tests fails, because the compiler-rt tests
  disable any default config files, breaking the compiler
  in this case:
  https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/compiler-rt/test/lit.common.cfg.py#L983

- Wine fails to build using llvm-mingw as cross compiler, because
  Wine adds the --no-default-config flag to Clang while compiling,
  if supported:
  https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/configure.ac?ref_type=tags#L866-868
  This causes llvm-mingw to omit the -rtlib=compiler-rt option
  (specified in a config file), making the compiler look for libgcc
  instead. Doing a check to see that linking succeeds doesn't necessarily
  help here - such a check already exists, but it tests linking with
  -nostdlib -nodefaultlibs:
  https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/aclocal.m4?ref_type=tags#L193-L206
2024-10-14 16:35:17 +03:00
Martin Storsjö 6939aee0c0 wrappers: Use clang config files for defaults
This makes these defaults more easy to get picked up in various
use cases, when not directly executing a compiler.
2024-10-02 15:58:00 +03:00
Martin Storsjö 373c32f91a docker: Bump the base images to Ubuntu 22.04
This raises the versions of bundled software, providing e.g.
autoconf 2.71, which is needed for Python 3.12.

As the releases are built (without a surrounding extra container)
on GitHub Actions these days, we don't need to hold the docker
images back to an old version for the sake of compatibility;
instead, updating to a newer version provides more modern tools
for users of the docker image.
2024-02-20 14:33:13 +02:00
Martin Storsjö f03e8e9f8e docker: Install a newer CMake
LLVM 17 requires CMake 3.20 or newer, while Ubuntu 20.04 ships with
CMake 3.16.3.
2023-07-29 13:45:29 +03:00
Martin Storsjö 5d63c28d85 docker: Upgrade to Ubuntu 20.04
Ubuntu 20.04 comes with CMake 3.16, so there's no need to install
a custom version of CMake for now (for LLVM 16.x; LLVM 17 will have
the requirement raised to CMake 3.20 though).

Also drop the workaround for git issues in the old version in
Ubuntu 18.04.

The latest releases that are built on GitHub Actions without
docker are based on Ubuntu 20.04 anyway, so there's less demand
for building this with an older version for the sake of
compatibility of the built binaries. For users using the built
docker image as such, having it based on a newer base distribution
is beneficial.
2023-06-01 19:54:57 +03:00
Martin Storsjö bf58d32dc4 docker: Make the CMake download and extraction less verbose
The wget command can easily print 800 lines to the docker output
log, and the tar unpacking prints over 6000 lines.
2023-06-01 19:54:57 +03:00
Martin Storsjö 6b8725333a build-openmp: Build the OpenMP library on all architectures
Since a356782426f5bf54a00570e1f925345e5fda7b2e in llvm-project,
OpenMP can be built for mingw/aarch64, since
fb947c358661b3bd3d5e1fa776ec74cc0f308854 it should work correctly
in all currently tested cases, and since
97958c9bb83cec44b6ce13e732b53de0171a5d43 it can be built for
mingw/armv7.
2023-01-29 01:09:17 +02:00
Martin Storsjö c31664aba4 Dockerfile.dev: Merge the ssp tests up with an earlier block 2023-01-29 01:09:17 +02:00
Martin Storsjö fb67e16120 build-all: Stop requiring curl to be available
Curl (or wget) isn't required for fetching libssp any longer,
so don't require it while running build-all.sh.

(It's still required by build-cross-tools.sh, for build-make.sh
though.)
2023-01-29 01:09:17 +02:00
Martin Storsjö 4ee7cc97de build-libssp: Stop building the real libssp from GCC
As mingw-w64 now provides these routines, we no longer need to build
the original library from GCC.

As building with -fstack-protector-strong still links with -lssp
(and -lssp_nonshared), we still need to provide libraries with these
names, but they can be empty dummy libraries.
2023-01-29 01:09:17 +02:00
Martin Storsjö ef9806fc0a run-tests: Stop explicitly linking against -lssp for the fortification test
Since libmingwex.a provides these routines now, we don't need to
specify -lssp manually.
2023-01-29 01:09:17 +02:00
Alvin Wong 9d352374f2 Enable CFGuard by default 2023-01-29 01:09:17 +02:00
Martin Storsjö 22b1ff128b Consistently use the --pdb= form in scripts
Stop using the separate argument form (-Wl,-pdb,<filename>), and
prefer using the option form with an implicit output name.
2022-10-12 15:28:45 +03:00
Martin Storsjö 5ad257fed0 Add comments about the missing $CFGUARD_ARGS when building sanitizers 2022-10-02 10:17:05 +03:00
Alvin Wong e9401c8bfe Add CFGuard options to build scripts (disabled by default) 2022-10-01 13:25:52 +03:00
Martin Storsjö 4c29469eac test: Add a test for fortification of string functions
We currently only run the testcase where it doesn't trigger the
failed checks though.
2022-09-16 19:43:40 +03:00
Martin Storsjö 332193b7ec run-tests: Build the ubsan test case with -fno-sanitize-recover=all
This allows easier programmatic checking that the sanitizer actually
caught the tested issue, when triggering the issue.
2022-09-16 19:42:21 +03:00
Martin Storsjö 81c39dda6a Build libunwind before mingw-w64-libraries
When --unwindlib=libunwind is implicit, we need to build libunwind
to have a complete working C compiler too. Currently this is worked
around by initially creating a dummy, empty libunwind.a, but with
the current version of libcxx/libunwind, we can get rid of that
workaround if we build it as soon as possible.
2022-02-09 14:02:20 +02:00
Martin Storsjö eaf5ac08e5 Build lldb-mi
Building this tool requires having a full LLVM build available;
either by installing without LLVM_INSTALL_TOOLCHAIN_ONLY (and not
stripping the llvm installation yet) or by pointing it at the
LLVM build directory instead. The latter works better for our
normal build flows.
2021-08-16 11:26:37 +03:00
Martin Storsjö ea46c8d98f build-openmp.sh: Use llvm-ml instead of uasm 2021-08-09 12:08:16 +03:00
Martin Storsjö 9188cce153 build-llvm.sh: Bump to llvmorg-13.0.0-rc1
Notable changes since 12.0.0 for llvm-mingw are:

llvm:
- Produce proper cross-section relative relocations on ARM and AArch64
- Fixed the calling convention for AArch64 for variadic functions involving
  floats in the fixed arguments
- Added a windres compatible frontend in llvm-rc, avoiding the need for
  external wrappers
- Build LLVM with -ffunction-sections and --gc-sections, shrinking
  a full build of llvm-mingw without LLVM_BUILD_LLVM_DYLIB by 22%
  (but llvm-mingw uses LLVM_BUILD_LLVM_DYLIB these days, which shrinks
  the build even more)
- Avoid optimizing/changing function calls into stpcpy due to optimizations
- llvm-ml has improved to the point where it can build the OpenMP assembly
  file without needing to use another assembler tool

lld:
- Support linking directly against DLLs without using import libraries
- Improved reliability when running on Windows, avoiding some hangs
  when terminating
- Fixed linking with --export-all-symbols in combination with
  -ffunction-sections
- Fixed --export-all-symbols when linking EXEs
- Fixed autoexport from LTO objects with comdat symbols
- Print warnings with a "ld.lld" prefix instead of "lld-link"
- Avoid thread exhaustion on 32 bit Windows
- Accepting more forms of options, like -static and --stack=

clang:
- Fixed reading long doubles with va_arg on x86_64
- Fixed calling std::once in a dynamically linked libstdc++

runtimes:
- Complete support for std::filesystem in libc++ (which was previously
  backported to 12.0.0 in llvm-mingw too, but the previous release had
  a bug in using e.g. the u8path() method when linking against the DLL
  version of libc++)
- Implemented semaphores in libc++
- Provide the __gcc_personality_seh0 symbol, fixing building C code with
  -fexceptions and __attribute__((cleanup))
- Simplified building/installing compiler-rt and libunwind
- Silenced lots of build warnings in OpenMP
2021-08-09 12:08:13 +03:00
Martin Storsjö 277b8c4c27 Dockerfile: Upgrade the version of git bundled in the docker image
This fixes the root cause for PR #210, differently.
2021-07-05 23:46:29 +03:00
Martin Storsjö c9fec3ee8f Dockerfile: Add a comment about the manually installed CMake 2021-07-05 23:46:23 +03:00
Martin Storsjö 2094638569 patches: Patch the llvm 12.x release to include support for std::filesystem in libcxx 2021-04-23 10:58:42 +03:00
Martin Storsjö e1f30312e9 Dockerfile: Update the installed version of CMake, install an arch specific version
This fixes building the dockerfiles on aarch64.
2021-04-23 10:54:07 +03:00
Martin Storsjö 0200472671 test: Add a testcase for cleanup of C++ destructors while doing longjmp
For x86_64 and aarch64, this requires https://reviews.llvm.org/D89231.

The C++ destructors aren't executed while doing the longjmp (contrary
to how it works MSVC's C++ exceptions), but it no longer crashes.
2021-04-15 11:36:20 +03:00
Martin Storsjö 547927e1d3 dockerfile: Install the zip tool in the base image
This is needed when packaging the cross built toolchains anyway.
2021-04-14 09:37:18 +03:00
Martin Storsjö 9494c9c2a9 dockerfile: Switch vim to vim-tiny in the docker images 2021-04-14 09:37:18 +03:00
Martin Storsjö be89715b8b dockerfile: Install python3
This is required by LLVM 12.
2021-04-14 09:37:18 +03:00
Martin Storsjö 82a540877d dockerfile: Install a newer version of CMake
This is required if building the master version of LLVM, past the
11 release branch.
2021-04-14 09:37:18 +03:00
Martin Storsjö 790bc40855 test: Add a testcase for throwing/catching C++ exceptions across DLLs 2021-02-19 16:19:47 +02:00
Orgad Shaneh 959f14a1c1 libssp: Download directory from gitlab instead of svn
svn is typically blocked on corporate firewalls.
2020-11-11 12:48:15 +02:00
Martin Storsjö d334f83671 docker: Install curl and less in the base test images
Having less available should make debugging in the docker images a bit
more accessible.

Curl is a nice-to-have at the moment, while we also have wget available
from before.
2020-11-03 14:04:21 +02:00
Martin Storsjö 2377f1a839 test: Explicitly test linking the C++ runtime statically 2020-10-23 12:17:35 +03:00
Martin Storsjö 9031eb6791 Build the OpenMP runtime in docker based builds
LLVM's OpenMP implementation only supports Windows on x86, and it
requires a MASM-compatible assembler to build it. Build UASM
for this purpose, for now. (UASM isn't available packaged in
debian/ubuntu repos.) In the future, llvm-ml should be able
to handle it instead, but it's not currently mature enough.

Not including it in the regular build-all.sh for now, as UASM
isn't generally available.
2020-10-15 23:23:05 +03:00
Martin Storsjö c82a6f2340 test: Add a testcase for the global termminate handler 2020-09-16 00:07:46 +03:00
Martin Storsjö 3fd3e58979 build-mingw-w64: Split out building tools to a separate script
This simplifies build-mingw-w64.sh. When building on native
windows (where we also provide unprefixed tools, we can't have
the yet incomplete compiler toolchain in $PATH when building
the mingw-w64 tools. (Logically, build-mingw-w64-tools belong
with build-llvm and install-wrappers; using the original system
compiler to build tools that are supposed to run on the current
machine, as opposed to the cross target, like when building the
runtimes.)
2020-09-16 00:03:57 +03:00
Martin Storsjö 308f7227c5 test: Add an idl testcase 2020-09-16 00:03:57 +03:00
Martin Storsjö 2c1a4645d9 Update the base distro used for dockerfiles and linux releases to Ubuntu 18.04
There's probably not much need for binaries based on 16.04 any longer.
2020-03-25 00:24:26 +02:00
Martin Storsjö b5ae2b5cc7 Allow overriding the default crt in dockerfiles with --build-arg DEFAULT_CRT=msvcrt 2019-11-13 12:39:30 +02:00
Martin Storsjö 0f9d9f1986 Check out llvm sources using the new llvm git monorepo
This updates compiler-rt, libunwind, libcxxabi and libcxx to a newer
version, matching the compiler.

This will be the official, canonical repo in the future.

For the non-dev Dockerfile build, this means that all the llvm based
subprojects need to be built in one RUN to avoid storing the llvm
checkout in the docker layers.
2019-09-12 13:14:19 +03:00
Martin Storsjö 315e1ab683 Install the needed packages in docker images with --no-install-recommends
This avoids installing a few unneeded ones, but requires manually
picking ca-certificates instead.
2019-08-01 22:30:32 +03:00
Martin Storsjö 97ca0681bc wrappers: Split out shared helpers for native wrapper executables to a header 2019-05-06 11:04:53 +03:00
Martin Storsjö 8cf83f259e Add the testcase from llvm PR40322 2019-04-30 00:03:19 +03:00