Commit Graph
674 Commits
Author SHA1 Message Date
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
Martin Storsjö b34e1cd82b windres-wrapper: Don't leave the .preproc.rc behind if producing .res 2021-04-09 13:42:29 +03:00
Martin Storsjö 4012843f3e built-llvm: Add options for doing a stage2 build, and for building with LTO 2021-03-22 14:07:49 +02:00
Martin Storsjö 84fc501cf8 build-compiler-rt: Tolerate cases where the output libs already have normalized arch names
This is needed since 8bd2722f65cfd7883ed9769f7bad3ff50e4c6905
(and 8e11bede3a6ac11ebcc05c82fac39899feaf9534) in llvm-project
(past the 12.x release branch), which will allow us to get rid of the
whole arch renaming part (once we can assume we're building a version
newer than that).
2021-03-22 14:06:11 +02:00
Martin Storsjö c3529a6b9b windres-wrapper: Implement support for the --preprocessor option 2021-03-10 10:22:06 +02:00
Martin Storsjö 1db63b8682 build-all: Switch to requiring curl instead of wget
The dockerfiles install both tools, and the scripts that use them
(build-make.sh and build-libssp.sh) can make do with either curl
or wget, but e.g. macOS ships with curl but not wget.
2021-03-08 09:09:07 +02:00
Martin Storsjö 790bc40855 test: Add a testcase for throwing/catching C++ exceptions across DLLs 2021-02-19 16:19:47 +02:00
Long Nguyen c0596d3170 Unset CC before building to prevent env pollution 2021-02-10 14:42:34 +02:00
Martin Storsjö cc0055bc96 Fix the help printouts in scripts
Printing '<triple>' causes the shell to try to read a file named
triple. One could either quote it, or just remove the angle brackets;
removing the brackets for simplicity.
2021-02-09 13:54:16 +02:00
Long Nguyen ee0585ae9e build-mingw-w64.sh: Switch to github mirror 2021-02-03 11:49:25 +02:00
Martin Storsjö 5533a5ad53 run-tests: Fix running with a relative path to the toolchain
This fixes github issue #181.
2021-01-25 14:45:34 +02:00
Martin Storsjö 4b063063f2 build-llvm: Don't explicitly disable LLDB's dependencies
They are supposed to be autodetected these days, and the build
shouldn't fail if they aren't available.
2021-01-25 10:44:39 +02:00
Long Nguyen 8a7dcd4ef1 build-cross-tools: Quote the path 2020-11-22 10:44:54 +02:00
Martin Storsjö e5612ac52e crt-test: Add a few more log2 tests for negative outputs with exact inputs 2020-11-21 21:34:50 +02:00
Martin Storsjö d5cda17953 wrappers: Return 0 when printing help in the windres wrapper 2020-11-21 21:34:50 +02:00
Russell Haley 5497454d16 Update windres-wrapper --version to return 0
modified:   wrappers/windres-wrapper.c - print_version now passes 0 to
exit function.
2020-11-21 21:33:14 +02:00
Martin Storsjö 22ef268489 build-libssp: Allow downloading with either wget or curl 2020-11-11 12:51:27 +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