Commit Graph
691 Commits
Author SHA1 Message Date
Martin Storsjö 63a5d3c09f build-llvm: Include the llvm-ml tool 2021-08-09 12:08:16 +03:00
Martin Storsjö b7c5fc5ef0 test: Add tests for _bittest* intrinsics 2021-08-09 12:08:16 +03:00
Martin Storsjö 5070c39532 test: Add testing of more float formatting cases, including %a 2021-08-09 12:08:16 +03:00
Martin Storsjö 50fb2ef45d test: Add tests for printf formatting of %+u (and %+<n>[doux]) 2021-08-09 12:08:16 +03:00
Martin Storsjö cf18e2de01 test: Add tests for strtod/strtof/strtold/wcstod/wcstof/wcstold 2021-08-09 12:08:16 +03:00
Martin Storsjö ea4f925038 test: Add a test for printf formatting of long doubles 2021-08-09 12:08:16 +03:00
Martin Storsjö 86630da230 build-compiler-rt: Stop creating an i386-w64-mingw32 sysroot symlink
This shouldn't be needed any longer since
8bd2722f65cfd7883ed9769f7bad3ff50e4c6905 in llvm-project (March 2021).
2021-08-09 12:08:16 +03:00
Martin Storsjö 13e065bf1a build-libcxx: Don't manually install libunwind.dll
libunwind installs the built DLL since
39ad160468e2b6acaa0b2b1ab353079eca4a3b03 (March 2021).
2021-08-09 12:08:16 +03:00
Martin Storsjö 056cb22fb5 build-compiler-rt: Stop setting CMAKE_*_COMPILER_WORKS
Since 8368e4d54c459fe173d76277f17c632478e91add in llvm-project (pushed
on March 11 2021), the lib/builtins CMakeLists.txt sets
CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY, which makes the
compiler tests pass before the toolchain is fully functional, by not
doing linking tests.
2021-08-09 12:08:16 +03:00
Martin Storsjö 98583d7bd9 build-compiler-rt: Do a plain "ninja install" instead of manually copying files
This still requires manually moving the dll files to the arch specific
runtime directory.

This requires building a version of llvm past
8e11bede3a6ac11ebcc05c82fac39899feaf9534 (March 18th 2021)
2021-08-09 12:08:16 +03:00
Martin Storsjö eda9036b6a build-mingw-w64.sh: Bump to the current version from August 8th 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ö 1f5a7e0577 test: Remove a workaround for older wine versions
I've updated my continuous test setup to a newer version of wine now,
not needing this workaround.
2021-08-03 11:36:12 +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
Adrian Antkowiak 9b6966484f Use git depth=1 when cloning llvm 2021-07-05 23:32:07 +03:00
Martin Storsjö 46efff459a build-llvm: Build with a shared libLLVM and libclang-cpp
This reduces the size of e.g. the zipped toolchain for Windows
from 183 MB to 85 MB.
2021-07-01 23:33:28 +03:00
Martin Storsjö e2ad2d4b64 run-tests: Don't assume running on x86
Also use $COPY_X86 for consistency.
2021-07-01 22:36:54 +03:00
Martin Storsjö 1629861108 run-tests: Move a comment closer to the line it refers to 2021-07-01 22:36:54 +03:00
Martin Storsjö bd9c8df3b8 build-libcxx: Don't manually install libc++.dll
libcxx installs the built DLL since
97d6fcce4ec6765c0e77db29c87e8083137c443d in llvm-project (July 2019)
when doing "ninja install".
2021-06-16 14:29:27 +03:00
Martin Storsjö 4951f6f682 build-libcxx: Stop setting -Wno-dll-attribute-no-redeclaration when building libunwind
This is set by libunwind itself since
df6d2e8ab1a4212284e4763724a2211df2c7394a in llvm-project.
2021-06-16 14:15:37 +03:00
Martin Storsjö 14098d92bc build-libcxx: Remove some unused cmake defines
These don't seem to be necessary in practice at the moment.

If building on top of a stripped llvm install, while there's an
older version of llvm (providing llvm-config) installed system
wide, we currently still manage to build things correctly.

(If llvm-config from LLVM 6.0 is available, build-compiler-rt.sh
fails though, but that's unaffected by this change. In current
git versions of compiler-rt, it first and foremost looks inside
the monorepo checkout instead of looking for a potentially
unrelated llvm-config binary.)
2021-06-16 14:04:45 +03:00
Martin Storsjö 59121bc4a0 build-libcxx: Don't manually undefine _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
Instead set the cmake defines that indicate that libcxx is going
to be linked dynamically and going to link in libcxxabi statically,
so that libcxxabi is built statically but with dllexport attributes.
2021-06-16 12:08:54 +03:00
Martin Storsjö 1843f12515 build-libcxx: Stop setting one unnecessary visibility define
Since libcxx includes libcxxabi with
_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS defined, the libcxxabi
declarations contain neither dllimport nor dllexport.

Earlier, we didn't use to include the libcxxabi headers with
_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS defined, but defining
_LIBCXXABI_BUILDING_LIBRARY instead. This caused libcxxabi
declarations to be marked dllexport. If any such functions would
end up emitted as part of the libcxx object files, this would
have been necessary to get them properly exported.

In practice libcxxabi functions aren't generated while included
in libcxx (they aren't templates and/or header inline functions),
_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS gets defined by the cmake
files, so we don't need to set this at all any longer.
2021-06-16 12:05:58 +03:00
Martin Storsjö b37483cec5 build-libcxx: Stop manually defining _LIBCPP_BUILDING_LIBRARY
Since before the LLVM 12.x branch, these aren't necessary any
longer.

(9c30bafd59bf1078bbe1c235c7c25bf7e278e2e9 and
8a73aa8c4c3ee82e7d650c6a957937713a4a9ab4 in llvm-project)

Since 9c30bafd59bf1078bbe1c235c7c25bf7e278e2e9 in llvm-project,
libcxxabi unconditionally defines _LIBCPP_BUILDING_LIBRARY while
building.

Since 8a73aa8c4c3ee82e7d650c6a957937713a4a9ab4 in llvm-project,
libcxx defines _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS if
LIBCXX_ENABLE_STATIC_ABI_LIBRARY is set.
2021-06-16 11:59:02 +03:00
Martin Storsjö 459e37f03f wrappers: Convert dlltool-wrapper to a native executable
This allows running it on windows from processes other than msys
based ones.
2021-06-14 11:44:06 +03:00
Martin Storsjö 657d12c8a5 Backport another libc++ patch for std::filesystem (and locale) usage
This fixes linking against a DLL of libc++ while using the common headers
(generated from the static version of the library, but which work for
both shared and static versions) when calling e.g. std::filesystem::u8path.
2021-05-25 23:55:32 +03:00
Martin Storsjö 168cc5f53d build-mingw-w64-tools: Build and install gendef too 2021-05-04 12:12:16 +03:00
Martin Storsjö 84462c92b0 test: Add options -noop and -wait to the hello-exception test program
This allows easier testing of continuing from manually set
breakpoints.

Also fix compilation for non-windows platforms where __debugbreak()
isn't defined.
2021-05-03 13:08:44 +03:00
Martin Storsjö fc1b1ba110 install-wrappers: Use llvm-windres if available
If the llvm-windres tool is available, use that instead of our own
wrapper that calls clang, llvm-rc and llvm-cvtres separately.
2021-04-26 22:22:31 +03:00
Martin Storsjö 37936ec0ea build-llvm: Install llvm-windres if available
The current llvm main branch contains the tool llvm-windres; make
sure to install and include it, if it exists.
2021-04-26 22:21:42 +03:00
Martin Storsjö 173ac732e9 readme: Rewrite the section on installing prebuilt toolchains
Explain what the different download options are, and prioritize the
downloadable toolchain packages over docker images.
2021-04-23 14:43:46 +03:00
Martin Storsjö 133c93aee4 Dockerfile.cross: Include the tag and architecture in the directory name within the zip 2021-04-23 10:58:42 +03:00
Martin Storsjö f066446b06 build-mingw-w64: Switch to another github mirror
This one seems to (currently) be a bit more up to date.
2021-04-23 10:58:42 +03:00
Martin Storsjö 3a9264f1fd build-mingw-w64: Build to the latest version from today 2021-04-23 10:58:42 +03:00
Martin Storsjö 7730c71209 release: Append the architecture to the cross compiler package 2021-04-23 10:58:42 +03:00
Martin Storsjö 869b038152 release: Add an option for only building a native toolchain 2021-04-23 10:58:42 +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ö f061215ebf strip-llvm: Remove libLTO.dll
In LLVM 12, it no longer ends up called LTO.dll, but libLTO.dll.
2021-04-15 11:37:11 +03:00
Martin Storsjö 7e55d4df92 strip-llvm: Remove the new ld64.lld.darwinnew in newer llvm versions 2021-04-15 11:37:11 +03:00
Martin Storsjö bbbdab6e27 test: Add an option for triggering a breakpoint with hello-exception.cpp 2021-04-15 11:37:11 +03:00
Martin Storsjö 33fe419247 build-mingw-w64: Bump to the latest git master version 2021-04-15 11:37:05 +03:00
Martin Storsjö e45fe5b5f6 build-libcxx: Switch to have libcxxabi provide new/delete operators
This matches how it is set by default in current master versions.

This requires building a version that includes
https://reviews.llvm.org/D89863, otherwise the new/delete operators
aren't properly weak.
2021-04-15 11:36:20 +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ö 2a323ac869 build-llvm: Bump to the LLVM 12.0.0
Notable changes in this release:
- Implicitly add the .exe suffix, even when cross compiling (matching
  a behaviour change in GCC since GCC 8)
- Enable the dynamicbase flag by default in LLD
- Implemented the -wrap option in LLD
- Optimized the generated unwind data for aarch64, reducing the size
  of the unwind data by around 60%
- Error out of LLD if trying to create a DLL with too many exports
2021-04-15 11:29:57 +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