87 Commits

Author SHA1 Message Date
gulfemsavrun
36a19c5bfe
[Fuchsia] Add BOOTSTRAP_BOOTSTRAP flags for PGO (#150448) 2025-07-24 19:50:39 +03:00
Petr Hosek
70cf616b33
[Fuchsia] Support PGO (#128680)
Enable 2-stage builds with PGO.
2025-05-07 11:28:57 -07:00
Paul Kirth
3e2afe5f01
Revert "[Fuchsia] Support PGO" (#126293)
Reverts llvm/llvm-project#120323

This breaks some internal Fuchsia builders. We can reland again later,
once that is addresed.
2025-02-07 16:57:11 -08:00
Petr Hosek
1438c8d68d
[Fuchsia] Support PGO (#120323)
Enable 2-stage builds with PGO.
2025-02-07 08:49:18 -08:00
Sirraide
c4a019747c
[Clang] Remove ARCMigrate (#119269)
In the discussion around #116792, @rjmccall mentioned that ARCMigrate
has been obsoleted and that we could go ahead and remove it from Clang,
so this patch does just that.
2025-01-30 05:32:25 +01:00
Petr Hosek
8cffab821c
[Fuchsia] Remove libc from LLVM_ENABLE_PROJECTS (#118704)
This was only needed for old hdrgen which is no longer being used.
2024-12-04 13:58:41 -08:00
Haowei
72d8c2737b
[Fuchsia] Remove linker flags from stage2 pass through (#99722)
This patch removes CMAKE_XXX_LINKER_FLAGS from list of flags that passed
through to stage2 build.
2024-07-19 21:42:57 -07:00
Aaron Siddhartha Mondal
852aaf5407
Reapply "[Support] Remove terminfo dependency (#92865)" (#93889)
This reverts commit fe82a3da36196157c0caa1ef2505186782f750d1.

This broke LLDB on MacOS due to a missing symbol during linking.

The fix has been applied in c6c08eee37bada190bd1aa4593c88a5e2c8cdaac.

Original commit message:

The terminfo dependency introduces a significant nonhermeticity into the
build. It doesn't respect `--no-undefined-version` meaning that it's not
a dependency that can be built with Clang 17+. This forces maintainers
of source-based distributions to implement patches or ignore linker
errors.

Remove it to reduce the closure size and improve portability of
LLVM-based tools. Users can still use command line arguments to toggle
color support expliticly.

Fixes #75490
Closes #53294 #23355
2024-05-31 01:29:00 +02:00
Michael Buch
fe82a3da36 Revert "[Support] Remove terminfo dependency (#92865)"
This reverts commit 6bf450c7a60fa62c642e39836566da94bb9bbc91.

It breaks LLDB CI: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/4762/execution/node/97/log/

```
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -mmacosx-version-min=14.1 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-no_warn_duplicate_libraries tools/lldb/unittests/Editline/CMakeFiles/EditlineTests.dir/EditlineTest.cpp.o -o tools/lldb/unittests/Editline/EditlineTests  lib/libLLVMSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  lib/liblldbHost.a  lib/liblldbUtility.a  lib/libLLVMTestingSupport.a  /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libxml2.tbd  /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libedit.tbd  lib/liblldbHostMacOSXObjCXX.a  lib/liblldbUtility.a  -framework Foundation  -framework CoreFoundation  -framework CoreServices  -framework Security  lib/libLLVMObject.a  lib/libLLVMIRReader.a  lib/libLLVMBitReader.a  lib/libLLVMAsmParser.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMTextAPI.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libllvm_gtest.a  lib/libLLVMSupport.a  -lm  /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libz.tbd  /opt/homebrew/lib/libzstd.dylib  lib/libLLVMDemangle.a  -lpthread && cd /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/Editline && /opt/homebrew/Cellar/cmake/3.28.3/bin/cmake -E make_directory /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/Editline/./Inputs
ld: Undefined symbols:
  _setupterm, referenced from:
      lldb_private::Editline::Editline(char const*, __sFILE*, __sFILE*, __sFILE*, std::__1::recursive_mutex&) in liblldbHost.a[35](Editline.cpp.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2024-05-29 16:20:42 +01:00
Aaron Siddhartha Mondal
6bf450c7a6
[Support] Remove terminfo dependency (#92865)
The terminfo dependency introduces a significant nonhermeticity into the
build. It doesn't respect `--no-undefined-version` meaning that it's not
a dependency that can be built with Clang 17+. This forces maintainers
of source-based distributions to implement patches or ignore linker
errors.

Remove it to reduce the closure size and improve portability of
LLVM-based tools. Users can still use command line arguments to toggle
color support expliticly.

Fixes #75490
Closes #53294 #23355
2024-05-24 20:20:15 +02:00
Jordan Rupprecht
0e5c28d193
[lldb][test] Remove LLDB_TEST_USE_VENDOR_PACKAGES (#89260)
The `LLDB_TEST_USE_VENDOR_PACKAGES` has defaulted to `Off` for a while.
Either installing `pexpect` or skipping those tests with
`-DLLDB_TEST_USER_ARGS=--skip-category=pexpect` seems to be enough that
we can fully remove this option.

This patch removes the `LLDB_TEST_USE_VENDOR_PACKAGES` cmake
configuration as well as the associated code to add
`third_party/Python/module` to the python path. I'll do the actual
deletion of `third_party/Python/module` in a followup PR in the
(unlikely, I hope) event this commit needs to be reverted.
2024-04-18 13:17:39 -05:00
Haowei
68217a52fb
[Fuchsia] Add SWIG flags to Fuchsia Clang stage2 build (#87421)
This patch adds SWIG cmake flags to the stage2 build in Fuchsia
Clang configuration.
2024-04-02 15:11:17 -07:00
Daniel Thornburgh
26bd3d0f9a [Fuchsia] Add LLDB_TEST_USER_ARGS to stage2 passthrough 2024-03-13 13:34:50 -07:00
Daniel Thornburgh
2377beba8d [Fuchsia] Add LLDB_TEST_USE_VENDOR_PACKAGES to boostrap passthrough 2024-03-12 13:33:12 -07:00
Petr Hosek
8d7bba0d5a
[CMake] Include riscv32-unknown-elf runtimes in Fuchsia toolchain (#78323)
This contains compiler-rt builtins and llvm-libc for baremetal use.

Differential Revision: https://reviews.llvm.org/D155337
2024-01-16 10:49:56 -08:00
Daniel Thornburgh
69bc30b91e [Fuchsia] Add stage2 cmake options 2024-01-11 13:31:33 -08:00
Konstantin Varlamov
4a9c71b8c2
[libc++][hardening] Fix references to old names for hardening modes (#71743)
This should fix some builds broken by
https://github.com/llvm/llvm-project/pull/70575
2023-11-08 13:16:01 -10:00
Petr Hosek
c6a198c72a [CMake][Fuchsia] Use unchecked hardening mode for libc++
We set LLVM_ENABLE_ASSERTIONS in some builds which is now translated
to LIBCXX_HARDENING_MODE=safe, but our codebase is not yet clean and
we're getting assertion failures.
2023-11-06 22:37:49 +00:00
Petr Hosek
71a43897d4 [CMake][Fuchsia] Set the runtimes for the second stage
This is a temporary workaround until we figure out the right solution.
2023-11-06 08:32:59 +00:00
Zhang
618e5d2c2d
[CMake] Fully delete the deprecated LLVM_USE_CRT* (#66850)
This has been deprecated in favor of CMake's CMAKE_MSVC_RUNTIME_LIBRARY
in c6bd873403a8ac6538a3fe3b3c2fe39c16b146a6 .
Current release branch still contains it in deprecated status so no
existing end-users will be affected.
2023-09-21 13:25:06 +03:00
Daniel Thornburgh
8456c8fe4e [CMake] Allow enabling Python in Fuchsia LLDB 2023-08-25 16:45:05 -07:00
Petr Hosek
e9fb7d6972 [Fuchsia] Enable libcxx filesystem on Windows for stage 1 build
This is a follow up to D153931 but for the first stage.
2023-06-28 05:43:16 +00:00
Daniel Thornburgh
1b8c7ee424 [Fuchsia] Forward libedit flags to stage2 2023-06-16 16:55:00 -07:00
Daniel Thornburgh
a1d73b773b [Fuchsia] Forward terminfo flags to stage 2 2023-06-16 16:34:42 -07:00
Daniel Thornburgh
518621e90b [Fuchsia] Pass CursesAndPanel_ROOT through to stage2 2023-06-12 15:43:39 -07:00
Daniel Thornburgh
0a21fb3441 [Fuchsia] Reland: Add llvm-debuginfod to toolchain 2023-06-01 11:48:22 -07:00
Petr Hosek
2a9e6363ef Revert "[Fuchsia] Pass through LLVM_ENABLE_HTTPLIB to stage 2"
This reverts commit 80614e162222e857d8767174284701aec69381c4.
2023-06-01 06:04:16 +00:00
Daniel Thornburgh
80614e1622 [Fuchsia] Pass through LLVM_ENABLE_HTTPLIB to stage 2 2023-05-31 15:56:20 -07:00
Alex Brachet
30c57e275e [Fuchsia] Correctly pass lists from STAGE2_ vars
Differential Revision: https://reviews.llvm.org/D150799
2023-05-17 17:24:58 +00:00
Daniel Thornburgh
498e150698 [Fuchsia][CMake] Always use multiple distribution model. 2023-03-28 10:31:22 -07:00
Daniel Thornburgh
0430324289 [Fuchsia] Add FUCHSIA_USE_MULTIPLE_DISTRIBUTIONS.
This flag causes the toolchain distribution to be built using LLVM
CMake's multiple distribution feature. The distribution* family of CMake
targets would be replaced with the toolchain-distribution* family.

This shouldn't otherwise affect the semantics of the build, but it sets
up the ability to split out the LLDB build from the main distribution
used by Fuchsia.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D146665
2023-03-24 16:04:59 -07:00
Daniel Thornburgh
2998a5551e [Fuchsia] Add LLDB to CLANG_BOOTSTRAP_TARGETS.
stage2-check-lldb should be run in a 2-stage build to test the final
LLDB artifact, so it and related targets must be exported to the stage 1
project.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D145818
2023-03-10 11:35:32 -08:00
Daniel Thornburgh
c0e9c55db3 [Fuchsia] Add LLDB options to stage 1 cmake.
LLVM_ENABLE_PROJECTS is automatically forwarded from stage 1 builds to
stage 2 builds, so setting FUCHSIA_ENABLE_LLDB has no effect on
two-stage builds.

Instead, add FUCHSIA_ENABLE_LLDB to the stage one build as well.

This also disables curses and libedit by default for now in both stage1
and stage 2 builds; these should be opt-in.

Reviewed By: haowei

Differential Revision: https://reviews.llvm.org/D145449
2023-03-07 15:04:31 -08:00
Haowei Wu
a7bb9a3639 [Fuchsia] Enable LLVM_USE_RELATIVE_PATHS_IN_FILES in bootstrap
This patch enables LLVM_USE_RELATIVE_PATHS_IN_FILES when building the
bootstrap toolchain for 2 stages build.

Differential Revision: https://reviews.llvm.org/D145010
2023-02-28 15:19:23 -08:00
Haowei Wu
14ca2e68ff Revert "[Fuchsia] Simplify Fuchsia stage2 toolchain setup"
This reverts commit f9ff49882a65ab26ab347f4df8f2a58368d37185.
Accidentally landed a draft patch.
2023-02-06 15:00:59 -08:00
Haowei Wu
5fcdab04c2 [Fuchsia] Build windows runtimes using cross compilation on Linux
This patch provides initial support of building Clang runtimes for
Windows when using Fuchsia Clang toolchains under Linux.

Differential Revision: https://reviews.llvm.org/D141738
2023-02-06 14:58:53 -08:00
Haowei Wu
f9ff49882a [Fuchsia] Simplify Fuchsia stage2 toolchain setup
WIP
2023-02-06 14:58:53 -08:00
Haowei Wu
630266aed3 [Fuchsia] Simplified the stage2 build setup
This patch simplified the BOOTSTRAP_ flags, allowing them to be
pass through from regular flags.

Differential Revision: https://reviews.llvm.org/D143288
2023-02-06 10:46:31 -08:00
Nikita Popov
6ce8727248 [cmake] Remove LLVM_INCLUDE_GO_TESTS variable
As pointed out by thakis in https://reviews.llvm.org/D135436#3858463,
this variable can be dropped now that the Go bindings have been
removed.
2022-10-14 16:34:36 +02:00
Alex Brachet
0df7d8bc35 [CMake][Fuchsia] Enable assertions and backtraces in stage 1 build
Differential Revision: https://reviews.llvm.org/D130514
2022-07-26 06:09:38 +00:00
Louis Dionne
7300a651f5 [libc++] Re-apply "Always build c++experimental.a""
This re-applies bb939931a1ad, which had been reverted by 09cebfb978de
because it broke Chromium. The issues seen by Chromium should be
addressed by 1d0f79558ca4.

Differential Revision: https://reviews.llvm.org/D128927
2022-07-19 10:44:19 -04:00
Hans Wennborg
09cebfb978 Revert "[libc++] Always build c++experimental.a"
This caused build failures when building Clang and libc++ together on Mac:

  fatal error: 'experimental/memory_resource' file not found

See the code review for details. Reverting until the problem and how to
solve it is better understood.

(Updates to some test files were not reverted, since they seemed
unrelated and were later updated by 340b48b267b96.)

> This is the first part of a plan to ship experimental features
> by default while guarding them behind a compiler flag to avoid
> users accidentally depending on them. Subsequent patches will
> also encompass incomplete features (such as <format> and <ranges>)
> in that categorization. Basically, the idea is that we always
> build and ship the c++experimental library, however users can't
> use what's in it unless they pass the `-funstable` flag to Clang.
>
> Note that this patch intentionally does not start guarding
> existing <experimental/FOO> content behind the flag, because
> that would merely break users that might be relying on such
> content being in the headers unconditionally. Instead, we
> should start guarding new TSes behind the flag, and get rid
> of the existing TSes we have by shipping their Standard
> counterpart.
>
> Also, this patch must jump through a few hoops like defining
> _LIBCPP_ENABLE_EXPERIMENTAL because we still support compilers
> that do not implement -funstable yet.
>
> Differential Revision: https://reviews.llvm.org/D128927

This reverts commit bb939931a1adb9a47a2de13c359d6a72aeb277c8.
2022-07-18 16:57:15 +02:00
Petr Hosek
a8e6056e24 [CMake][Fuchsia] Use libunwind as the default unwinder
Fuchsia already uses libunwind, but it does so implicitly via libc++.
This change makes the unwinder choice explicit.

Differential Revision: https://reviews.llvm.org/D127887
2022-07-09 18:15:04 +00:00
Louis Dionne
bb939931a1 [libc++] Always build c++experimental.a
This is the first part of a plan to ship experimental features
by default while guarding them behind a compiler flag to avoid
users accidentally depending on them. Subsequent patches will
also encompass incomplete features (such as <format> and <ranges>)
in that categorization. Basically, the idea is that we always
build and ship the c++experimental library, however users can't
use what's in it unless they pass the `-funstable` flag to Clang.

Note that this patch intentionally does not start guarding
existing <experimental/FOO> content behind the flag, because
that would merely break users that might be relying on such
content being in the headers unconditionally. Instead, we
should start guarding new TSes behind the flag, and get rid
of the existing TSes we have by shipping their Standard
counterpart.

Also, this patch must jump through a few hoops like defining
_LIBCPP_ENABLE_EXPERIMENTAL because we still support compilers
that do not implement -funstable yet.

Differential Revision: https://reviews.llvm.org/D128927
2022-07-08 16:58:22 -04:00
Petr Hosek
68050c2354 Revert "[CMake][Fuchsia] Use libunwind as the default unwinder"
This reverts commit 6213dba19fc0d65ab8b366b6d78c56cbd63c9d7d since
this broke Fuchsia builders.
2022-07-02 04:51:16 +00:00
Petr Hosek
6213dba19f [CMake][Fuchsia] Use libunwind as the default unwinder
Fuchsia already uses libunwind, but it does so implicitly via libc++.
This change makes the unwinder choice explicit.

Differential Revision: https://reviews.llvm.org/D127887
2022-07-01 17:24:00 +00:00
Petr Hosek
e64722f686 [CMake][Fuchsia] Build runtimes as universal libraries on OS X
We want to build libunwind, libc++abi and libc++ as universal libraries
supporting both x86_64 and arm64 architectures.

Differential Revision: https://reviews.llvm.org/D125908
2022-05-18 18:14:42 +00:00
Petr Hosek
534f660420 [CMake] Disable libedit in Fuchsia toolchain
We don't need libedit in our toolchain build.

Differential Revision: https://reviews.llvm.org/D125570
2022-05-13 10:47:12 -07:00
Petr Hosek
ff78d25b8e [CMake][Fuchsia] Include bolt
We would like to use bolt with Fuchsia toolchain.

Differential Revision: https://reviews.llvm.org/D123280
2022-04-06 22:48:17 -07:00
Petr Hosek
abe997bb2d [CMake][Fuchsia] Switch to lld on Apple platforms
lld Mach-O backend supports all our use cases now.

Differential Revision: https://reviews.llvm.org/D122047
2022-03-22 01:06:30 -07:00