Commit Graph

183 Commits

Author SHA1 Message Date
Bryan Drewery
59f6130d2a Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.
Sponsored by:	EMC / Isilon Storage Division
2016-03-26 03:46:12 +00:00
Bryan Drewery
6a5ac7dc11 Use the new bmake .dinclude feature to make these safe.
At least FAST_DEPEND won't even run 'make depend', so the code was
potentially broken with FAST_DEPEND anyhow.  The .dinclude directive
will ignore missing files rather than make them be fatal.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 04:17:39 +00:00
Bryan Drewery
f51eac06ce DIRDEPS_BUILD: Update clang dependencies after r296417.
Sponsored by:	EMC / Isilon Storage Division
2016-03-08 21:26:44 +00:00
Dimitry Andric
1b9b7a135c Update llvm and clang to 3.8.0 release. 2016-03-03 22:50:52 +00:00
Dimitry Andric
09a17a1e45 Update llvm and clang to release_38 branch r261684. 2016-02-24 22:07:56 +00:00
Dimitry Andric
14e9c9161c Merge ^/head r295902 through r296006. 2016-02-24 21:38:51 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Bryan Drewery
b9cd412e7b FAST_DEPEND: Always run depend via beforebuild which removes many hacks.
This will generate dependencies rather than depending on the previous behavior
of depending on the guessed OBJS: *.h dependecies or a user running
'make depend'.

Experimentation showed that depending only on headers was not enough and
prone to .ORDER errors.  Downstream users may also have added
dependencies into beforedepend or afterdepend targets.  The safest way to
ensure dependencies are generated before build is to run 'make depend'
beforehand rather than just depending on DPSRCS+SRCS.

Note that the OBJS_DEPEND_GUESS mechanism (a.k.a .if !exists(.depend) then
foo.o: *.h) is still useful as it improves incremental builds with missing
.depend.* files and allows 'make foo.o' to usually work, while this
'beforebuild: depend' ensures that the build will always find all dependencies.
The 'make foo.o' case has no means of a 'beforebuild' hook.

This also removes several hacks in the DIRDEPS_BUILD:
- NO_INSTALL_INCLUDES is no longer needed as it mostly was to work around
  .ORDER problems with building the needed headers early.
- DIRDEPS_BUILD: It is no longer necesarry to track "local dependencies" in
  Makefile.depend.

  These were only in Makefile.depend for 'clean builds' since nothing would
  generate the files due to skipping 'make depend' and early dependency
  bugs that have been fixed, such as adding headers into SRCS for the
  OBJS_DEPEND_GUESS mechanism.  Normally if a .depend file does not exist then
  a dependency is added by bsd.lib.mk/bsd.prog.mk from OBJS: *.h.  However,
  meta.autodep.mk creates a .depend file from created meta files and inserts
  that into Makefile.depend.  It also only tracks *.[ch] files though which can
  miss some dependencies that are hooked into 'make depend'.  This .depend
  that is created then breaks incremental builds due to the !exists(.depend)
  checks for OBJS_DEPEND_GUESS.  The goal was to skip 'make depend' yet it only
  really works the first time.  After that files are not generated as expected,
  which r288966 tried to address but was using buildfiles: rather than
  beforebuild: and was reverted in r291725.  As noted previously,
  depending only on headers in beforebuild: would create .ORDER errors
  in some cases.

  meta.autodep.mk is still used to generate Makefile.depend though via:
    gendirdeps: Makefile.depend
    .END: gendirdeps

  This commit allows removing all of the "local dependencies" in
  Makefile.depend which cuts down on churn and removes some of the
  arch-dependent Makefile.depend files.

  The "local dependencies" were also problematic for bootstrapping.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:19:18 +00:00
Dimitry Andric
ce479d84f4 Update llvm and clang to release_38 branch r261369. 2016-02-21 16:23:44 +00:00
Dimitry Andric
9893f787ec Merge ^/head r295601 through r295844. 2016-02-21 13:49:26 +00:00
Bryan Drewery
6b128c1707 DIRDEPS_BUILD: Hookup CLANG_EXTRAS.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 23:11:09 +00:00
Dimitry Andric
a8bcc4d878 Update llvm, clang and lldb to release_38 branch r260756. 2016-02-13 15:58:51 +00:00
Dimitry Andric
21cf1fd41c Update llvm, clang and lldb to release_38 branch r258968. 2016-01-27 22:48:52 +00:00
Dimitry Andric
30d1696c64 Undo r294499 for now (which disabled -mlong-calls), so arm builds can
succeed again.
2016-01-23 14:17:21 +00:00
Dimitry Andric
8c24ff90c4 Update llvm and clang to release_38 branch r258549. 2016-01-22 21:50:08 +00:00
Dimitry Andric
d9b9dae1a9 Merge ^/head r294169 through r294598. 2016-01-22 20:41:56 +00:00
Andrew Turner
9beacb6f22 Disable -mlong-calls for the clang libraries for now, it increases the
size of the clang binary for people with a crt1.o from before r293832.
2016-01-21 12:59:54 +00:00
Dimitry Andric
42d8074a70 Update llvm/clang build glue. 2016-01-16 17:49:29 +00:00
Dimitry Andric
7f38eb34e2 Merge ^/head r293850 through r294089. 2016-01-15 17:55:00 +00:00
Andrew Turner
c455b92483 Set -mlong-calls where needed to get a static clang and lldb 3.8.0
linking. These are too large for a branch instruction to branch from an
earlier point in the code to somewhere later.

This will also allow these to be build with Thumb-2 when we get this
infrastructure.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D4855
2016-01-14 19:00:13 +00:00
Dimitry Andric
444ed5c5eb Update llvm, clang and lldb to trunk r257626, and update build glue. 2016-01-14 17:42:46 +00:00
Dimitry Andric
fdd1590a42 As submitted upstream in a review, avoid using undefined behavior in
llvm's LinkAllPasses.h.  This caused some of the calls not to be
emitted, if the optimization level was -O2 or higher.

Conversely, if you used -O1 or lower, calls to e.g.  RunningOnValgrind()
would be emitted, leading to link failures, because we did not include
Valgrind.cpp into libllvmsupport.  Therefore, add it unconditionally.

Noticed by:	ian
2016-01-08 17:32:42 +00:00
Dimitry Andric
76ba5332fe Update llvm library dependencies. 2016-01-06 21:27:12 +00:00
Dimitry Andric
db3ae65e86 Update llvm/clang svn revision. 2016-01-06 21:26:57 +00:00
Dimitry Andric
f3304b8db5 Add new pkuintrin.h intrinsics header. 2016-01-06 21:26:31 +00:00
Ed Maste
0a97e59728 Update build infrastructure for LLDB 3.8 2016-01-04 00:02:58 +00:00
Ed Maste
1b08e3c074 Build Valgrind.cpp for LLDB, not only CLANG_EXTRAS
It's required as of LLDB 3.8.
2016-01-03 23:36:11 +00:00
Dimitry Andric
ffa548ae3e Next part of updating llvm/clang build glue: getting the
WITH_CLANG_EXTRAS tools built.
2015-12-31 17:37:35 +00:00
Dimitry Andric
34cdd77646 First part of updating llvm/clang build glue: getting llvm-tblgen,
clang-tblgen and clang itself built.
2015-12-31 14:39:45 +00:00
Dimitry Andric
802df53c82 Update various build glue files for the new llvm/clang version number. 2015-12-30 18:52:29 +00:00
Dimitry Andric
250e909a40 Update clang's Version.inc file, and regenerate various generated
configuration headers (these used to be generated by autoconf, but
upstream has deprecated autoconf in favor of CMake).
2015-12-30 18:23:01 +00:00
Dimitry Andric
9a4b31181f Upgrade our copies of clang and llvm to 3.7.1 release. This is a
bugfix-only release, with no new features.

Please note that from 3.5.0 onwards, clang and llvm require C++11
support to build; see UPDATING for more information.
2015-12-25 21:39:45 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
3bed45ab81 META MODE: Rework [bootstrapped] tools PATH support.
- Support more of the toolchain from TOOLSDIR.
- This also improves 'make bootstrap-tools' to pass, for example,
  AS=/usr/bin/as to Makefile.inc1, which will tell cross-tools to use
  external toolchain support and avoid building things we won't be using
  in the build.
- Always set the PATH to contain the staged TOOLSDIR directories when
  not building the bootstrap targets.

  The previous version was only setting this at MAKE.LEVEL==0 and if the
  TOOLSDIR existed.  Both of these prevented using staged tools that were
  built during the build though as DIRDEPS with .host dependencies, such
  as the fix for needing usr.bin/localedef.host in r291311.
  This is not a common tool so we must build and use it during the build,
  and need to be prepared to change PATH as soon as it appears.

  This should also fix the issue of host dependencies disappearing from
  Makefile.depend and then reappearing due to the start of the fresh build not
  having the directory yet, resulting in the tools that were built not actually
  being used.
- Only use LEGACY_TOOLS while building in Makefile.inc1.  After r291317
  and r291546 there is no need to add LEGACY_TOOLS into the PATH for
  the pseudo/targets/toolchain build.
- Because the pseudo/targets/toolchain will now build its own
  [clang-]tblgen, the special logic in clang.build.mk is no longer needed.
- LEGACY_TOOLS is no longer used outside of targets/pseudo/bootstrap-tools
  so is no longer passed into the environment in its build.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:19:02 +00:00
Bryan Drewery
0383be9bae META MODE: Fix rebuilding of lib/clang/include after clang-tblgen.host is
staged.

None of usr.bin/clang/clang-tblgen or its dependencies need
lib/clang/include, so there is no cyclic dependency here to worry about.
The issue came about because of workarounds to dependencies on clang
being optional.

Without this, the clang-tblgen called during the build would change
after it was staged for the host.  This would cause lib/clang/include to
rebuild due to changed build commands.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:59 +00:00
Bryan Drewery
e58834bc29 Only DIRDEPS_BUILD should trigger this logic.
Missed in r290816.

Sponsored by:	EMC / Isilon Storage Division
2015-11-30 22:53:41 +00:00
Bryan Drewery
0314b7e24d libllvmmirparser and libllvmlibdriver are only used in usr.bin/clang/llc and
usr.bin/clang/llvm-ar, respectively, when MK_CLANG_EXTRAS is yes.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-30 19:16:58 +00:00
Bryan Drewery
277fbb92d5 Remove redundant DPSRCS which were already in SRCS.
DPSRCS already contains all of SRCS.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 20:38:07 +00:00
Dimitry Andric
e9ae01703c Switch the default OpenMP runtime for clang to libomp (from the LLVM
project), as libgomp is not supported anyway.  You can use the
devel/llvm-devel port to install a recent copy of the OpenMP runtime.
2015-10-18 17:18:19 +00:00
Bryan Drewery
28a425750a Conditionalize the META_MODE tool handling on MK_META_MODE.
It was not being used outside of META_MODE but this should make it more clear
that it is only for META_MODE.

Sponsored by:	EMC / Isilon Storage Division
2015-10-17 15:50:52 +00:00
Craig Rodrigues
4c92141bda Use -fpermissive if compiling with GCC.
Works around GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67888
when compiling Module.cpp
2015-10-08 00:48:29 +00:00
Dimitry Andric
9a2f5539ec For llvm/clang libraries, skip including tablegen-produced .d files when
the target is "make depend".  This works around errors during
incremental make depend of some clang libraries, for example "don't know
how to make contrib/llvm/include/llvm/IR/IntrinsicsR600.td".

Reported by:	emaste
2015-10-06 19:49:53 +00:00
Dimitry Andric
65dcb5bcb1 Merge ^/head r288197 through r288456. 2015-10-01 19:02:45 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Bryan Drewery
660d1f65bb Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
Dimitry Andric
b1fa820d8b Don't install Intrin.h, as this is an intrinsics header for Windows. 2015-09-20 21:39:55 +00:00
Dimitry Andric
999971f7f7 Minimize the number of files compiled for clang only (e.g. when neither
WITH_CLANG_EXTRAS nor WITH_LLDB is in effect).
2015-09-06 22:02:13 +00:00
Dimitry Andric
b6c25e0ef3 Update llvm, clang and lldb to 3.7.0 release. 2015-09-06 19:58:48 +00:00
Dimitry Andric
b91a7dfcc6 Update lldb to upstream trunk r242221. 2015-09-06 15:21:47 +00:00
Dimitry Andric
875ed54817 Update llvm/clang to r242221. 2015-08-12 18:31:11 +00:00