1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

302 Commits

Author SHA1 Message Date
David Tenty
d4999fa5bd Build with _XOPEN_SOURCE defined on AIX
Summary:
It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open
and POSIX compatibility mode, to work around stray macros and other
bugs in the headers provided by the system and build compiler.

This patch adds the config to cmake to build with _XOPEN_SOURCE defined
on AIX with a few exceptions. Google Test internals require access to
platform specific thread info constructs on AIX so in that case we build
with _ALL_SOURCE defined instead. Libclang also uses header which needs
_ALL_SOURCE on AIX so we leave that as is as well.

We also add building on AIX with the large file API and doing CMake
header checks with X/OPEN definitions so the results are consistent with
the environment that will be present in the build.

Reviewers: hubert.reinterpretcast, xingxue, andusy

Reviewed By: hubert.reinterpretcast

Subscribers: mgorny, jsji, cfe-commits, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D62533

llvm-svn: 362808
2019-06-07 15:45:25 +00:00
Don Hinton
8b90db1c7f [cmake] When getting Ninja version, don't include CMakeNinjaFindMake
which doesn't play well with passing CMAKE_MAKE_PROGRAM from the
commandline without a path.

Fixes a bug introduced in r361280.

Thanks to Mikael Holmén for reporting this!

llvm-svn: 361501
2019-05-23 15:03:22 +00:00
Don Hinton
83f8553c44 [cmake] Don't use VERSION_GREATER_EQUAL in cmake versions prior to 3.72.
llvm-svn: 361291
2019-05-21 19:25:54 +00:00
Don Hinton
b0ab36dd90 [cmake] Try to make cmake happy and fix bots.
llvm-svn: 361286
2019-05-21 18:51:21 +00:00
Don Hinton
a1b4a637eb [cmake] Bug in r361281: make include optional and fix typo which might make a difference on some systems.
llvm-svn: 361282
2019-05-21 18:15:01 +00:00
Don Hinton
44cf151218 [cmake] Add custom command to touch archives on Darwin so ninja won't rebuild them.
Summary:
clang and newer versions of ninja use high-resolutions timestamps, but
older versions of libtool on Darwin don't, so the archive will often
get an older timestamp than the last object that was added or updated.
To fix this, we add a custom command to touch the archive after it's
been built so that ninja won't rebuild it unnecessarily the next time
it's run.

Reviewed By: beanz

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62172

llvm-svn: 361280
2019-05-21 17:56:45 +00:00
Chris Bieneman
bd1db07d46 [CMake] Detecting python modules should be cached
Summary: This requres exec-ing python, which in a trace I ran of the CMake re-configure time took ~2% of the reconfigure time.

Reviewers: phosek, smeenai, compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61402

llvm-svn: 360196
2019-05-07 21:46:55 +00:00
Keno Fischer
2abca233ae [CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC
Summary:
This value is derived from the host triple, which on the machine
I'm currently using is `ppc64le-linux-redhat`. This change makes
LLVM compile.

Reviewers: nemanjai
Differential Revision: https://reviews.llvm.org/D57118

llvm-svn: 359242
2019-04-25 21:28:03 +00:00
Nico Weber
217c395e5b Remove HAVE_REALPATH from config.h
Its last use was removed in r352916.
No behavior change.

Differential Revision: https://reviews.llvm.org/D59601

llvm-svn: 356579
2019-03-20 17:26:11 +00:00
Peter Collingbourne
20a57ab952 build: Remove the cmake check for malloc.h.
As far as I can tell, malloc.h is only being used here to provide
a definition of mallinfo (malloc itself is declared in stdlib.h via
cstdlib). We already have a macro for whether mallinfo is available,
so switch to using that instead.

Differential Revision: https://reviews.llvm.org/D57807

llvm-svn: 353329
2019-02-06 19:20:47 +00:00
Serge Guelton
1e000b2c69 Fix llvm::is_trivially_copyable portability issues
llvm::is_trivially_copyable portability is verified at compile time using
std::is_trivially_copyable as the reference implementation.

Unfortunately, the latter is not available on all platforms, so introduce
a proper configure check to detect if it is available on the target platform.

In a similar manner, std::is_copy_assignable is not fully supported for gcc4.9.
Provide a portable (?) implementation instead.

Differential Revision: https://reviews.llvm.org/D57018

llvm-svn: 351820
2019-01-22 13:48:55 +00:00
Dylan McKay
cafb601214 [AVR] Allow AVR to be explicitly set as the default target triple
This extends the CMake cross compilation logic so that AVR can be set as
the default target triple, and thus the generic codegen tests can be
run.

This used to be possible on AVR; the CMake configuration files have
since been changed.

With this patch, 'cmake -DLLVM_DEFAULT_TARGET_TRIPLE=avr-unknown-unknown' can
be passed on the command line, making the `-mcpu` argument redundant to
'llc' and friends.

llvm-svn: 351678
2019-01-20 11:12:39 +00:00
Argyrios Kyrtzidis
27a03b19f4 [Support/FileSystem] Add sub-second precision for atime/mtime of sys::fs::file_status on unix platforms
Summary:
getLastAccessedTime() and getLastModificationTime() provided times in nanoseconds but with only 1 second resolution, even when the underlying file system could provide more precise times than that.
These changes add sub-second precision for unix platforms that support improved precision.

Also add some comments to make sure people are aware that the resolution of times can vary across different file systems.

Reviewers: labath, zturner, aaron.ballman, kristina

Reviewed By: aaron.ballman, kristina

Subscribers: lebedev.ri, mgorny, kristina, llvm-commits

Differential Revision: https://reviews.llvm.org/D54826

llvm-svn: 347530
2018-11-26 00:03:39 +00:00
Kamil Rytarowski
739bcc45e8 Swap order of discovering of -ltinfo and -lterminfo
Summary:
NetBSD ships with native curses(3) and -ltinfo is a part of ncurses.
Set -lterminfo before -ltinfo, as it allows to prioritize native curses
libraries. Mixing curses and ncurses does not work well, especially
in software built on top of llvm.

Original patch by Ryo Onodera (NetBSD) in pkgsrc.

Reviewers: labath, dim, mgorny

Reviewed By: dim, mgorny

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D54650

llvm-svn: 347156
2018-11-18 12:13:51 +00:00
Bruno Cardoso Lopes
11b4351a5f [CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2
On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools
installed, we currently get the include path for libxml2 as
/usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2.

Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when
possible.

rdar://problem/41103601

llvm-svn: 334746
2018-06-14 18:19:54 +00:00
Vassil Vassilev
d9088961cc [cmake] Add a switch to enable/disable bindings.
Differential Revision: https://reviews.llvm.org/D42026

llvm-svn: 332816
2018-05-20 08:37:54 +00:00
Pavel Labath
95b9d71eef [cmake] Improve pthread_[gs]etname_np detection code
Summary:
Due to some android peculiarities, in some build configurations
(statically linked executables targeting older releases) we could detect
the presence of these functions (because they are present in libc.a,
where check_library_exists searches), but then fail to build because the
headers did not include the definition.

This attempts to remedy that by upgrading the check_library_exists to
check_symbol_exists, which will check that the function is declared too.

I am hoping that a more thorough check will make the messy #ifdef we
have accumulated in the code obsolete, so I optimistically try to remove
them.

Reviewers: zturner, kparzysz, danalbert

Subscribers: srhines, mgorny, krytarowski, llvm-commits

Differential Revision: https://reviews.llvm.org/D45359

llvm-svn: 330251
2018-04-18 13:13:27 +00:00
Clement Courbet
512991d3bb [Build][NFC] Split off libpfm detection to a separate module.
llvm-svn: 329783
2018-04-11 07:39:00 +00:00
Clement Courbet
84516bef77 [llvm-exegesis] Add a flag to disable libpfm even if present.
Summary: Fixes PR37053.

Reviewers: uabelho, gchatelet

Subscribers: mgorny, tschuett, llvm-commits

Differential Revision: https://reviews.llvm.org/D45436

llvm-svn: 329781
2018-04-11 07:32:43 +00:00
Clement Courbet
9d7dd3b74c [llvm-exegesis] Check for libpfm headers.
HAVE_LIBPFM is only defined if the libpfm headers are present.

llvm-svn: 329261
2018-04-05 07:35:28 +00:00
Clement Courbet
c7b418ae52 Re-land r329156 "Add llvm-exegesis tool."
Fixed to depend on and initialize the native target instead of X86.

llvm-svn: 329169
2018-04-04 11:37:06 +00:00
Clement Courbet
606b211cef Revert r329156 "Add llvm-exegesis tool."
Breaks a bunch of bots.

llvm-svn: 329157
2018-04-04 08:22:54 +00:00
Clement Courbet
0f5c40aa77 Add llvm-exegesis tool.
Summary:
[llvm-exegesis][RFC] Automatic Measurement of Instruction Latency/Uops

This is the code corresponding to the RFC "llvm-exegesis Automatic Measurement of Instruction Latency/Uops".

The RFC is available on the LLVM mailing lists as well as the following document
for easier reading:
https://docs.google.com/document/d/1QidaJMJUyQdRrFKD66vE1_N55whe0coQ3h1GpFzz27M/edit?usp=sharing

Subscribers: mgorny, gchatelet, orwant, llvm-commits

Differential Revision: https://reviews.llvm.org/D44519

llvm-svn: 329156
2018-04-04 08:13:32 +00:00
Nico Weber
49ae2f4931 Remove some unused cmake standard library includes.
llvm-svn: 328996
2018-04-02 17:52:19 +00:00
Nico Weber
d087f429b9 Remove more feature test macros that became unused after r328989.
llvm-svn: 328995
2018-04-02 17:45:47 +00:00
Nico Weber
b179193e87 Remove HAVE_LIBPSAPI, HAVE_SHELL32.
These used to be set in the old autoconf build, but the cmake build has had a
"TODO: actually check for these" comment since it was checked in, and they
were set to 1 on mingw unconditionally.  It seems safe to say that they always
exist under mingw, so just remove them and assume they're set exactly when on
mingw (with msvc, we use `pragma comment` instead of linking these via flags).

llvm-svn: 328992
2018-04-02 17:32:48 +00:00
Nico Weber
8d1a813ee0 Remove HAVE_DIRENT_H.
The autoconf manual: "This macro is obsolescent, as all current systems with
directory libraries have <dirent.h>. New programs need not use this macro."

llvm-svn: 328989
2018-04-02 17:17:29 +00:00
Nico Weber
a45ed00b65 Remove stro(u?)ll() config checks. Those were needed pre-MSVC2013, but we require 2015 nowadays.
llvm-svn: 328979
2018-04-02 14:36:34 +00:00
Nico Weber
d611db79f1 Remove HAVE_WRITEV that's unused after r255837.
llvm-svn: 328977
2018-04-02 14:18:13 +00:00
Nico Weber
bfbdd1b472 Assume existence of inttypes.h and stdint.h in DataTypes.h.
These should exist in all toolchains LLVM supports nowadays.

Enables making DataTypes.h a regular header instead of a .h.cmake file and
allows deleting a bunch of cmake goop (which should also speed up cmake
configure time a bit).

All the code this removes is 9+ years old.
https://reviews.llvm.org/D45155

llvm-svn: 328970
2018-04-02 13:22:26 +00:00
Nico Weber
f844b10547 Remove a few unreferenced config.h defines.
Found by looking through the output of

  for f in $(grep -o '\bHAVE_[A-Z0-9_]*\b' llvm/cmake/config-ix.cmake); do
    echo $f $(git grep $f '*' | wc -l);
  done

in the monorepo.

llvm-svn: 328957
2018-04-02 01:46:08 +00:00
Azharuddin Mohammed
51acb5c7d3 Build system changes for RISCV
Summary: Build system changes for RISCV. Makes it possible to build just the RISCV target alone.

Reviewers: asb, apazos, mgrang, beanz

Reviewed By: asb

Subscribers: mgorny, kito-cheng, shiva0217, llvm-commits

Differential Revision: https://reviews.llvm.org/D44153

llvm-svn: 327423
2018-03-13 17:04:33 +00:00
Jonas Hahnfeld
1c7e4fbd53 [opt-viewer] Check for pygments.lexer.c_cpp
Some systems still don't have this module which was introduced in
version 2.0 (CentOS 7, sigh).

Differential Revision: https://reviews.llvm.org/D41611

llvm-svn: 321659
2018-01-02 17:53:08 +00:00
Don Hinton
130f9a4a59 [cmake] Always respect existing CMAKE_REQUIRED_FLAGS when adding additional ones.
Summary:
Always respect existing CMAKE_REQUIRED_FLAGS when adding
additional ones.  This is important when cross compiling where
--sysroot and -target were already added.

In particular, this is needed when cross compiling from Darwin to
Linux, since --sysroot is required to find headers and libraries.

Cmake has a similar bug in check_include_file[_cxx] where
CMAKE_REQUIRED_LIBRARIES isn't passed, which causes
try_compile to fail.
(please see https://gitlab.kitware.com/cmake/cmake/merge_requests/1620)

Reviewers: compnerd, silvas, beanz, brad.king

Reviewed By: compnerd

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D41568

llvm-svn: 321434
2017-12-25 01:23:09 +00:00
Pavel Labath
d9438e5fb6 Re-commit "[cmake] Enable zlib support on windows"
This recommits r319533 which was broken llvm-config --system-libs
output.  The reason was that I used find_libraries for searching for the
z library.  This returns absolute paths, and when these paths made it
into llvm-config, it made it produce nonsensical flags.  To fix this, I
hand-roll a search for the library in the same way that we search for
the terminfo library a couple of lines below.

This is a bit less flexible than the find_library option, as it does not
allow the user to specify the path to the library at configure time
(which is important on windows, as zlib is unlikely to be found in any
of the standard places cmake searches), but I was able to guide the
build to find it with appropriate values of LIB and INCLUDE environment
variables.

Reviewers: compnerd, rnk, beanz, rafael

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D40779

llvm-svn: 319751
2017-12-05 10:24:15 +00:00
Pavel Labath
1431200847 Revert "[cmake] Enable zlib support on windows"
This reverts commit r319533 as it broke llvm-config --system-libs output
and everything that depends on it (which is mostly out of tree or
downstream folks, but includes a couple of llvm buildbots as well).

I think I have a fix for this in D40779, but I want someone to look
review it first. In the mean time, I am reverting this change, as it
seems to break a lot of people.

llvm-svn: 319663
2017-12-04 16:46:20 +00:00
Pavel Labath
e4b98ce2bf [cmake] Enable zlib support on windows
Summary:
zlib support was hard-wired to off for (non-cygwin) windows targets.
This disables some features, such as reading debug info from compressed
dwarf sections.

This has been this way since zlib support was added in 2013 (r180083),
but there is no obvious reason for that. Zlib is perfectly capable of
being compiled for windows (it even has a cmake file that works out of
the box).

This enables one to turn on zlib support on windows, if one has zlib
avaliable.

Reviewers: rnk, beanz

Subscribers: mgorny, aprantl, llvm-commits

Differential Revision: https://reviews.llvm.org/D40655

llvm-svn: 319533
2017-12-01 11:41:07 +00:00
Adam Nemet
2885645683 Add opt-viewer testing
Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

Differential Revision: https://reviews.llvm.org/D40202

Fixes since the first commit:
1. Disable syntax highlighting as different versions of pygments generate
different HTML
2. Use llvm-cxxfilt from the build

llvm-svn: 319324
2017-11-29 17:07:41 +00:00
Adam Nemet
a8d567ec8e Revert "Add opt-viewer testing"
This reverts commit r319188.

Breaks when c++filt is not available.

llvm-svn: 319262
2017-11-29 00:10:48 +00:00
Adam Nemet
206e1448f6 Add opt-viewer testing
Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

Differential Revision: https://reviews.llvm.org/D40202

llvm-svn: 319188
2017-11-28 17:26:28 +00:00
Adam Nemet
b6f770f3e1 Revert "Add opt-viewer testing"
This reverts commit r319073.

Bot fails with a mismatch that looks like pygments-generated HTML.

llvm-svn: 319146
2017-11-28 06:22:29 +00:00
Adam Nemet
fed86d9004 Add opt-viewer testing
Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

Differential Revision: https://reviews.llvm.org/D40202

llvm-svn: 319073
2017-11-27 19:00:29 +00:00
Hans Wennborg
da29bc5094 CMake: Turn LLVM_ENABLE_LIBXML2 into a tri-state option
In addition to the current ON and OFF options, this adds the FORCE_ON
option, which causes a configuration error if libxml2 cannot be used.

Differential revision: https://reviews.llvm.org/D40050

llvm-svn: 318209
2017-11-14 22:32:49 +00:00
Hans Wennborg
698effca78 Revert r316064 "Fix the incorrect detection of ICONV_LIBRARY_PATH"
This broke the use of libxml2 on machines where iconv() is provided by libc.
I'll follow up on the mailing list to discuss how to fix this properly.

> This is introduced in rL308711.
> Check for c library is incorrect here just because libc will be found always
> and it does not mean that iconv is presented.
>
> Thank to Andrew Krasny for narrowing down the root cause.
>
> Reviewers: ecbeckmann
> Reviewed By: ecbeckmann
> Subscribers: mgorny, llvm-commits
> Differential Revision: https://reviews.llvm.org/D38875

llvm-svn: 317517
2017-11-06 22:17:23 +00:00
Vassil Vassilev
c8fa84aa94 Revert 316150 which reinstated r316025.
It fails on some bots and now we know how to reproduce it.

llvm-svn: 316153
2017-10-19 08:44:19 +00:00
Vassil Vassilev
831c59ec8a Reinstate r316025, reverted in r316029.
Original commit message:
"[cmake] Use find_package to discover zlib

This allows us to use standard cmake utilities to point to non-system zlib
locations.

Patch by Oksana Shadura and me (D39002)."

The new patch brings back the old behavior in the cases where find_package
cannot find zlib.

llvm-svn: 316150
2017-10-19 08:04:22 +00:00
Serguei Katkov
59357f9a7b Fix the incorrect detection of ICONV_LIBRARY_PATH
This is introduced in rL308711.
Check for c library is incorrect here just because libc will be found always
and it does not mean that iconv is presented.

Thank to Andrew Krasny for narrowing down the root cause.

Reviewers: ecbeckmann
Reviewed By: ecbeckmann
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D38875

llvm-svn: 316064
2017-10-18 06:26:39 +00:00
Vassil Vassilev
86baa0793e Revert "[cmake] Use find_package to discover zlib"
We are investigating what went wrong.

llvm-svn: 316029
2017-10-17 20:51:25 +00:00
Vassil Vassilev
5aa4aefc0e [cmake] Use find_package to discover zlib
This allows us to use standard cmake utilities to point to non-system zlib
locations.

Patch by Oksana Shadura and me (D39002).

llvm-svn: 316025
2017-10-17 20:32:27 +00:00
Nico Weber
4f7bf0e2d0 Search for libxml2 on macOS too.
This allows lld-link to process /manifestinput: flags on macOS too.
Also makes the `REQUIRES: manifesttool` lld tests run on macOS.
Setting LLVM_ENABLE_LIBXML2 to off can suppress this behavior, like on Linux.

llvm-svn: 315873
2017-10-15 19:13:57 +00:00