Commit graph

24 commits

Author SHA1 Message Date
Yann E. MORIN 55fc80260b packages: host gcc >= 4.8 is now guaranteed
... so we can drop all config options about it and previous versions.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-10-27 10:00:29 +01:00
Romain Naour edad1d9f79 package/llvm: add llvm RTTI option
Allow to build LLVM with run-time type information as this feature is
needed (for example) by mesa3d's Gallium Nouveau driver or the Clover
OpenCL state tracker when llvm support is enabled in mesa3d.

While we only care about RTTI support in the target, we also need to
enable it in the host LLVM, so that llvm-config gives the proper
result.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-10-25 23:27:36 +02:00
Romain Naour c61153407c package/{llvm, clang, lld}: update comment to keep them at the same version.
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-10-25 18:16:13 +02:00
Romain Naour a09f5e55de package/llvm: bump to version 9.0.0
The github download url doesn't contain the llvm 9.0.0 archive,
so use the previous url.

Since v9.0.0, it was relicensed to the Apache License 2.0 with
LLVM Exceptions. Update the license file hash.

Use host-python3 to build llvm [1]

Disable explicitely Z3 support since there is no such package
in Buildroot.

[1] 213d1037e9

See:
http://releases.llvm.org/9.0.0/docs/ReleaseNotes.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
Cc: Joseph Kogut <joseph.kogut@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-10-05 22:02:52 +02:00
Valentin Korenblit 9728190cd8 package/llvm: bump to 8.0.1
Project moved to github, updated project URL

Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-17 14:24:25 +02:00
Matt Weber 2abba0dfb3 package/llvm: disable libxml2
libxml2 is needed during Windows builds to populate the COFF
file manifest info.  This isn't required for Linux builds.

Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-08-01 18:43:19 +02:00
Matt Weber d899557e4e package llvm/clang: note about version bumping dep
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Acked-by: Romain Naour <romain.naour@smile.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-08-01 18:42:09 +02:00
Valentin Korenblit 2a17fb6057 package/llvm: fix build with gcc < 5.1
Fixes:
http://autobuild.buildroot.net/results/0c046a1b57a4f0b992333003d41062e1b256eb0d

Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
[Arnout: add explanatory comment suggested by Romain]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-04-13 16:51:56 +02:00
Valentin Korenblit 31e65e476e package/llvm: bump to 8.0.0
The license file hash changed due to a copyright year update:

-Copyright (c) 2003-2018 University of Illinois at Urbana-Champaign.
+Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.

Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-04-10 19:03:51 +02:00
Romain Naour d3245ce425 package/llvm: set the path to llvm-config
While building llvm for the target (x86_64), the build failed due to
path poisoning (-I/usr/include/libxml2) while building NATIVE tools
(i.e for the host). The llvm package tries to build a tool for the host
with the cross-compiler which doesn't work when the paranoid toolchain
wrapper (BR2_COMPILER_PARANOID_UNSAFE_PATH) is enabled.

We know that llvm (target) needs llvm-tablegen and llvm-config built by
host-llvm, but only LLVM_TABLEGEN is provided by llvm.mk. Adding
LLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config for llvm (target)
fixes the path poisoining issue since llvm doesn't build the NATIVE
variant.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Tested-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-01-17 09:56:49 +01:00
Valentin Korenblit 8ad93cc634 package/llvm: bump to version 7.0.1
Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-12-27 16:38:41 +01:00
Valentin Korenblit 09a76d507d package/llvm: bump to version 7.0.0
LLVM_BUILD_GLOBAL_ISEL does no longer exist

LICENSE.TXT hash changed due to the Copyright date update.

Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Tested-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-09-30 20:07:35 +02:00
Romain Naour 900fec702a package/llvm: bump to version 6.0.1
http://releases.llvm.org/6.0.1/docs/ReleaseNotes.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Joseph Kogut <joseph.kogut@gmail.com>
Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-07-27 23:46:06 +02:00
Joseph Kogut 2d8ce733b8 llvm: bump to version 6.0.0
Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
Tested-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-06-15 22:23:15 +02:00
Valentin Korenblit db3dd60025 package/llvm: fix host-llvm build with GCC8
This patch fixes the build of lli for host-llvm when using GCC 8.

It was taken from llvm-5.0 package for Fedora 28.

Link to bug: https://bugzilla.redhat.com/show_bug.cgi?id=1540620

Fixes:

http://autobuild.buildroot.net/results/824c70e982d8ec7e518cf4db058767df42db6b04/

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-05-17 22:01:53 +02:00
Valentin Korenblit e702d5f69b package/llvm: bump to version 5.0.2
5.0.2  is API and ABI compatible with 5.0.0 and 5.0.1 and includes
mitigations for CVE-2017-5715 (Spectre Variant 2) for X86 and MIPS.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-05-17 20:53:00 +02:00
Valentin Korenblit cf1f6cd1e7 package/llvm: delete LLVMHello.so from /usr/lib
LLVMHello.so contains the Hello World example of an
LLVM pass. It is not needed on the target.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-05-02 11:33:22 +02:00
Valentin Korenblit 62285fbe46 package/llvm: fix typo in llvm.mk
"+=" was missing in -DLLVM_TARGETS_TO_BUILD, so LLVM_CONF_OPTS and
HOST_LLVM_CONF_OPTS before this option weren't being considered.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-12 21:16:24 +02:00
Valentin Korenblit 4f9e3989f3 package/llvm: remove $ORIGIN/../lib from RPATH
AddLLVM.cmake adds $ORIGIN/../lib to the RPATH of llvm binaries.  This
causes a problem when llvm-config built for the host, installed in
STAGING_DIR, is executed under the following conditions:

* Target architecture same as host architecture (normally x86_64)
* Target's libc different from host's libc (normally glibc)

llvm-config will try to link with the target's libc, resulting in:

./llvm-config: error while loading shared libraries: libc.so.0: cannot open shared object file: No such file or directory.

To avoid this, we simply add pass
-DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib" in HOST_LLVM_CONF_OPTS.

Link to discussion:

  http://lists.busybox.net/pipermail/buildroot/2018-April/218627.html

Fixes:

  http://autobuild.buildroot.net/results/b81c12d529c66a028e2297ea5ce1d6930324fa69/

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-12 21:12:51 +02:00
Valentin Korenblit 4bed9dcd7b package/llvm: add dependency on wchar
Extract from log:

output/build/llvm-5.0.1/include/llvm/Support/ConvertUTF.h:203:53:
error: ‘std::wstring’ has not been declared
bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result);

Also propagate dependency to mesa3d

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-09 21:11:19 +02:00
Valentin Korenblit cf1139a564 package/llvm: add dependency on shared libraries
llvm generates libLLVM.so, so it won't work if BR2_STATIC_LIBS is set

Also propagate llvm dependency to mesa3d.

Link to report from autobuilders:
http://lists.busybox.net/pipermail/buildroot/2018-April/218296.html

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-09 21:10:14 +02:00
Thomas Petazzoni 8f921700b7 llvm: add dependency on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735
LLVM uses std::shared_future, which until gcc 7.x isn't available on
architectures that don't provide lock-free atomics, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735.

Buildroot already has a BR2_TOOLCHAIN_HAS_GCC_BUG_64735 option to
handle such a case, so simply add this new dependency to LLVM. It will
make sure LLVM doesn't get built on ARMv5 platforms using a gcc older
than 7.x.

Fixes:

  http://autobuild.buildroot.net/results/ada497f6a8d20fa1a9adb2b17a138d7b726a6cdc/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-06 21:24:28 +02:00
Valentin Korenblit 29f04d7934 package/llvm: enable AMDGPU
The AMDGPU backend provides ISA code generation for AMD GPU's,
starting with the R600 family up until the current GCN families.

It should not be confused with the AMDGPU Linux kernel DRM driver.

For more info: https://llvm.org/docs/AMDGPUUsage.html

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Tested-by: Jérôme Oufella <jerome.oufella@savoirfairelinux.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-04 22:52:04 +02:00
Valentin Korenblit a098636a6b package/llvm: new package
This patch installs LLVM tools and libraries for the host and
libLLVM.so for the target.

In order to cross-compile LLVM for the target, LLVM
must be installed on the host, or at least llvm-tblgen.
This is necessary as the path to host's llvm-tblgen must
be specified when cross-compiling using the LLVM_TABLEGEN option.
Also, a version of llvm-config that can run on the host will
be required by packages that link with LLVM libraries, so we
need to generate it and install it in STAGING_DIR/usr/bin.

It is important to remark why we need llvm-config(host variant)
installed in STAGING dir. This tool is necessary to build
applications that use LLVM, as it prints the compiler flags,
linker flags and object libraries needed to link against LLVM libs.

More info: https://bugs.chromium.org/p/chromium/issues/detail?id=219369

The original idea was to compile only llvm-tblgen and llvm-config
for the host, as they are the only necessary components. However,
llvm-config tool does not work as expected if it is not linked with
libLLVM.so, so we must also enable LLVM_LINK_LLVM_DYLIB, what builds
LLVM as a single shared library and links LLVM tools with it.

More info: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224847
in comment #11.

If we don't build full LLVM for the host, it would be necessary to
patch configure.ac from mesa3d if we want dynamic linking, because it
uses llvm-config (host variant installed in STAGING_DIR) to get the
necessary LLVM libraries to link with, which has the following problems:

 - llvm-config --shared mode outputs static (even if LLVM is built as
   one shared library) which leads to link issues with libgallium.

 - llvm-config --libs outputs all LLVM tiny libs: -lLLVMLTO,
   -lLLVMPasses,etc instead of the single shared library containing
    all LLVM components (-lLLVM-5.0)

Mesa tries to execute: llvm-config --link-shared --libs, but this outputs
llvm-config: error: libLLVM-5.0.so is missing.

Given that these problems may arise with other packages that use LLVM,
it is preferable to do a full build for the host. Also, having a
complete installation of LLVM on the host will also facilitate the
integration of Clang front-end, which is going to be added in a future
patch.

As option LLVM_BUILD_LLVM_DYLIB is enabled for the llvm target variant,
a single shared library containing all LLVM components is built.
This option is not compatible with BUILD_SHARED_LIBS, which generates
one .so per library and is only recommended for use by LLVM developers.

Tools and utils are not built for the target. The patch aims to provide
LLVM support for other packages.

The main options needed to cross-compile LLVM are the following ones:

LLVM_TABLEGEN
CMAKE_CROSSCOMPILING
LLVM_DEFAULT_TARGET_TRIPLE
LLVM_HOST_TRIPLE
LLVM_TARGET_ARCH
LLVM_TARGETS_TO_BUILD

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
[Thomas:
 - add dependency on thread and C++ and update the Config.in comment
   accordingly.
 - make the Config.in comment depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
   so that it isn't disabled on architectures where LLVM is anyway not
   supported.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-04 22:45:44 +02:00