Commit Graph
147 Commits
Author SHA1 Message Date
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ö 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ö 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ö 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ö 62b208aee2 Use llvm-objcopy/llvm-strip instead of a shell script wrapper and binutils 2019-01-24 10:58:20 +02:00
Martin Storsjö 585c767ee4 Use llvm-ar with the flag 'L' instead of a helper MRI script for merging archives 2018-12-20 12:11:10 +02:00
Martin Storsjö 99e2fefc9d Use nproc and sysctl -n hw.cpu for default initializing CORES
This avoids having to pass --build-arg CORES=n when building the
docker images.
2018-11-09 22:20:34 +02:00
Konstantin Pavlov e0f186967a Don't remove the workdir itself
Since Docker 18.09, this breaks later stages.
2018-11-09 14:09:24 +02:00
Martin Storsjö f5008d5380 Merge build-mingw-w64-widl.sh back into build-mingw-w64.sh
This allows checking out the mingw-w64 repo if it is missing, when
building widl.
2018-10-17 22:45:54 +03:00
Martin Storsjö 5390b58835 Consistently use "COPY .. ./" in Dockerfiles
This avoids potential issues and confusion with cases where a plain "." as
target doesn't work.
2018-10-16 20:25:39 +03:00
Martin Storsjö e9d8d57ec6 Fix adding build-compiler-rt.sh after wiping the build dir
With newer docker versions, "COPY foo .", when the workdir doesn't exist,
produces a plain file named as the workdir, breaking the rest of the build.
2018-10-16 19:42:31 +03:00
Martin Storsjö fb4862b0d6 Split out building widl to a separate shell script
When cross compiling a llvm-mingw toolchain, we need to build widl
for the intended host environment as well.
2018-10-02 21:34:54 +03:00
Martin Storsjö 6bb0cfca58 Convert TOOLCHAIN_ARCHS from ENV to ARG
This allows overriding it with --build-arg.
2018-10-02 21:34:54 +03:00
Martin Storsjö a38e52fff5 Build address sanitizer 2018-10-02 14:53:53 +03:00
Martin Storsjö ab1da59a48 Use a single COPY command in dockerfiles for both *.sh and *.c for wrappers 2018-09-14 09:38:44 +02:00
Martin Storsjö d6a9b3b9dc Split the non-dev version of Dockerfile into a few smaller steps
Now that we can build compiler-rt and libunwind with a stripped
llvm install, we can build things in a few smaller steps without
ending up with a larger docker image than before.
2018-08-03 14:47:33 +03:00
Martin Storsjö 609fe4b81d Use binutils objcopy and strip if available
For x86 architectures, binutils objcopy and strip can be used as
such.

For armv7 and aarch64, binutils doesn't recognize the architectures
and refuse to touch the files. For most/everything that objcopy/strip
do, the actual architecture doesn't really matter though. Therefore,
provide a wrapper script and a minimal tool for editing PE executables,
that change the architecture from armv7 and aarch64 to i686 and x86_64
respectively before invoking binutils, and change it back afterwards.

In case the binutils tools are missing, just return a successful result
without doing anything for stripping operations (previously, we had the
<triplet>-strip tool symlinked to /bin/true, so this isn't any worse than
before) and fail for other objcopy operations.
2018-07-25 00:56:58 +03:00
Josh de Kock 08224169fd Add windres wrapper for LLVM tools 2018-05-05 00:14:45 +03:00
Martin Storsjö c9db1e06b5 Build libssp from gcc
gcc/libssp's configure script runs checks for flags that clang doesn't
implement. We actually just need to set a few HAVE defines and compile
the .c sources, so just check out this subdirectory using svn and build
it using a custom makefile.
2018-04-23 00:26:05 +03:00
Martin Storsjö e9975fabab Squash all build steps in the dockerfile, producing a much smaller image
Keep the old dockerfile with a different file name, for easier
testing/debugging (where later steps can be tweaked without
rebuilding everything).
2018-04-02 16:00:27 +03:00
Martin Storsjö f856480113 Clean up properly after installing packages 2018-04-01 23:30:12 +03:00
Martin Storsjö d3ff718bd1 Remove unnecessary llvm files at the end
This doesn't help reduce the docker image size since it's done
in a separate RUN step than the one that added the files. (compiler-rt
and libunwind currently fail to build after stripping the llvm
installation though.)
2018-04-01 23:27:21 +03:00
Martin Storsjö 511222e6b5 Skip a redundant subdirectory in the docker image 2018-04-01 22:45:30 +03:00
Martin Storsjö 166a2bab65 Install the toolchain to /opt/llvm-mingw, in the docker image 2018-04-01 22:45:30 +03:00
Martin Storsjö 6dc488eca7 Remove an unnecessary command from the end of a step in the dockerfile 2018-04-01 22:45:30 +03:00
Martin Storsjö 7297bb65a5 Add a more thorough test case, testing various CRT features
Simplify building of the test cases at the same time; stop building
hello-cpp with -fno-exceptions.
2018-03-20 12:00:56 +02:00
Martin Storsjö 421b7f671c Rename hello.cpp to hello-cpp.cpp 2018-03-20 11:51:33 +02:00
Martin Storsjö d7d80f084a Rename the hello subdirectory to test 2018-03-20 11:08:32 +02:00
Martin Storsjö 098f6750d7 Automatically extract the clang version number when installing compiler-rt 2018-01-18 10:00:01 +02:00
Martin Storsjö 583baaa612 Make windres output in res format instead of in coff
This makes the output architecture independent, allowing
the x86_64 GNU binutils binary to be used for other
architectures as well, including arm/arm64 which aren't supported
by binutils.
2018-01-10 10:53:02 +02:00
Martin Storsjö 41985ce12e Cheat and pull windres from the normal binutils packages
LLVM does have llvm-rc, which almost does what is needed.
Currently missing features:
- It doesn't run the C preprocessor (which can be wrapped with
  a shellscript easily if necessary)
- It chokes on C structs/typedefs normally found in included
  C headers
2018-01-10 10:53:02 +02:00
Martin Storsjö 55e8aef024 Provide <triplet>-<tool> wrappers and links to many llvm tools
Provide wrappers named <triplet>-gcc and <triplet>-g++ as well,
to ease cross compilation with e.g. autotools, to allow just
specifying --host=<triplet>.

Provide wrappers for objdump and ld that provide specific output
that autotools look for.

Provide <triplet>-strip as a symlink to /bin/true, since there is
no strip tool available yet (and llvm-objcopy doesn't support
COFF yet).
2018-01-10 10:53:02 +02:00
Martin Storsjö f67075c23c Build the C test apps earlier
This gives easier to read error messages if a simple C program
fails to link.
2018-01-10 10:53:02 +02:00
Martin Storsjö 58ba889792 Build llvm with ninja, if available
This speeds up incremental builds.
2018-01-10 10:53:02 +02:00
Martin Storsjö 672182424e Move the test apps to a subdirectory 2018-01-10 10:53:02 +02:00
Martin Storsjö 9925666790 Rename the wrapper script, for consistency 2018-01-10 10:53:02 +02:00
Martin Storsjö f79e7158c9 Rename merge_archives.sh for consistency 2018-01-10 10:53:02 +02:00
Martin Storsjö e56a519fdc Split the building of the toolchain into individual shellscripts
This simplifies building the toolchain outside of docker.
2018-01-10 10:24:48 +02:00
Martin Storsjö 04323b03a5 Stop setting some environment variables at the end
One shouldn't rely on these being set.
2018-01-09 21:38:42 +02:00
Martin Storsjö e6a0db1009 Force libcxx to use win32 threads even if pthread.h happens to be available 2018-01-09 00:03:18 +02:00
Martin Storsjö a70eb52fe7 Update to the latest version of mingw-w64 and libcxx
This version of mingw-w64 provides a few more import libraries
for aarch64, and allows using a lot more uncommon stdio functions
with ucrtbase.

The new libcxx version allows forcing using win32 threads even
if pthread.h exists.
2018-01-09 00:03:18 +02:00
Martin Storsjö abdc20fb41 Remove some commented out build commands 2018-01-08 23:35:59 +02:00
Martin Storsjö 7837c52041 Remove some unnecessary packages from the base ubuntu setup 2018-01-08 23:09:05 +02:00
Martin Storsjö 2292a091cf Make the number of parallel make jobs configurable 2017-12-20 11:52:45 +02:00
Martin Storsjö 0a00556c73 Install idl files along with the headers 2017-12-20 11:23:37 +02:00