Skip to content

Commit 0ac9d1f

Browse files
Merge pull request #50 from Andy-Python-Programmer/rust-nightly
Bump host-rust, rustlibc, host-cargo, llvm ports
2 parents 608d96a + ac739b9 commit 0ac9d1f

File tree

6 files changed

+217
-783
lines changed

6 files changed

+217
-783
lines changed

aero.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
BUILD_DIR = 'build'
5050
BUNDLED_DIR = 'bundled'
5151
SYSROOT_DIR = 'sysroot'
52+
EXTRA_FILES = 'extra-files'
53+
SYSROOT_CARGO_HOME = os.path.join(SYSROOT_DIR, 'cargo-home')
5254
BASE_FILES_DIR = 'base-files'
5355
OVMF_FILES = ['OVMF-pure-efi.fd']
5456

@@ -240,6 +242,26 @@ def build_userland_sysroot(args):
240242
if not os.path.exists(SYSROOT_DIR):
241243
os.mkdir(SYSROOT_DIR)
242244

245+
# FIXME(xbstrap): xbstrap does not copy over the extra-files/rust/config.toml
246+
# file into the cargo home directory.
247+
if not os.path.exists(SYSROOT_CARGO_HOME):
248+
os.mkdir(SYSROOT_CARGO_HOME)
249+
250+
cargo_sys_cfg = os.path.join(SYSROOT_CARGO_HOME, 'config.toml')
251+
if not os.path.exists(cargo_sys_cfg):
252+
cargo_cfg_fd = open(os.path.join(
253+
EXTRA_FILES, 'rust', 'config.toml'), 'r')
254+
cargo_cfg = cargo_cfg_fd.read()
255+
cargo_cfg_fd.close()
256+
257+
cargo_cfg = cargo_cfg.replace("@SOURCE_ROOT@", os.getcwd())
258+
cargo_cfg = cargo_cfg.replace(
259+
"@BUILD_ROOT@", os.path.join(os.getcwd(), SYSROOT_DIR))
260+
261+
cargo_cfg_fd = open(cargo_sys_cfg, "w+")
262+
cargo_cfg_fd.write(cargo_cfg)
263+
cargo_cfg_fd.close()
264+
243265
blink = os.path.join(SYSROOT_DIR, 'bootstrap.link')
244266

245267
if not os.path.islink(blink):
@@ -479,7 +501,7 @@ def get_sysctl(name: str) -> str:
479501
if status != 0:
480502
print("`sysctl` failed: ", end="")
481503
print(stderr.decode())
482-
504+
483505
return stdout.strip().decode()
484506

485507

@@ -493,11 +515,11 @@ def is_kvm_supported() -> bool:
493515
if platform == "darwin":
494516
# Check for VMX support
495517
cpu_features = get_sysctl("machdep.cpu.features")
496-
vmx_support = "VMX" in cpu_features.split(' ')
518+
vmx_support = "VMX" in cpu_features.split(' ')
497519

498520
# Check for HVF support
499521
hv_support = get_sysctl("kern.hv_support") == "1"
500-
522+
501523
return hv_support and vmx_support
502524

503525
if platform == "linux":

bootstrap.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ sources:
5454
- name: rust
5555
subdir: 'bundled'
5656
git: 'https://github.com/rust-lang/rust.git'
57-
tag: '1.51.0'
58-
version: '1.51.0'
57+
branch: 'master'
58+
commit: '22e491ac7ed454d34669151a8b6464cb643c9b41'
5959

6060
- name: rust-libc
6161
subdir: 'bundled'
62-
git: 'https://github.com/rust-lang/libc.git'
63-
tag: '0.2.93'
64-
version: '0.2.93'
62+
git: 'https://github.com/Andy-Python-Programmer/libc.git'
63+
branch: 'master'
64+
commit: '9d6a6ee0c3973be6ea9ff48dac1e8fe3b177cf45'
6565

6666
- name: llvm
6767
subdir: 'bundled'
68-
git: 'https://github.com/llvm/llvm-project'
69-
tag: 'llvmorg-10.0.0'
70-
version: '10.0.0'
68+
git: 'https://github.com/llvm/llvm-project.git'
69+
tag: 'llvmorg-13.0.0'
70+
version: '13.0.0'
7171

7272
# ---------------------------------------------------------------------------
7373
# Rust patched crates start
@@ -186,8 +186,8 @@ tools:
186186
source:
187187
subdir: 'bundled'
188188
git: 'https://github.com/rust-lang/cargo.git'
189-
tag: '0.53.0'
190-
version: '0.53.0'
189+
branch: 'master'
190+
commit: '25fcb135d02ea897ce894b67ae021f48107d522b'
191191
tools_required:
192192
- tool: host-rust
193193
recursive: true

extra-files/rust/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ patch-in-config = true
44
[build]
55
rustc = "@BUILD_ROOT@/tools/host-rust/bin/rustc"
66
target = "x86_64-unknown-aero-system"
7+
rustflags = ["-C", "link-args=-no-pie"]
78

89
[target.x86_64-unknown-aero-system]
910
linker = "@BUILD_ROOT@/tools/host-gcc/bin/x86_64-aero-gcc"

patches/llvm/llvm.patch

Lines changed: 58 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ index 70fac030b..93fc21c3d 100644
6262
@@ -342,6 +342,34 @@ public:
6363
: OSTargetInfo<Target>(Triple, Opts) {}
6464
};
65-
65+
6666
+// Aero Target
6767
+template <typename Target>
6868
+class LLVM_LIBRARY_VISIBILITY AeroTargetInfo : public OSTargetInfo<Target> {
@@ -628,10 +628,10 @@ index 000000000..e9016f4a8
628628
+
629629
+#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MANAGARM_H
630630
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
631-
index da197e476..7ea2887b7 100644
631+
index da39f29e4..b6f6bb439 100644
632632
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
633633
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
634-
@@ -261,6 +261,8 @@ static const char *getLDMOption(const llvm::Triple &T, const ArgList &Args) {
634+
@@ -246,6 +246,8 @@ static const char *getLDMOption(const llvm::Triple &T, const ArgList &Args) {
635635
return "elf_iamcu";
636636
return "elf_i386";
637637
case llvm::Triple::aarch64:
@@ -640,7 +640,7 @@ index da197e476..7ea2887b7 100644
640640
return "aarch64linux";
641641
case llvm::Triple::aarch64_be:
642642
return "aarch64linuxb";
643-
@@ -1997,7 +1999,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
643+
@@ -2077,7 +2079,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
644644
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
645645
static const char *const AArch64Triples[] = {
646646
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
@@ -650,26 +650,26 @@ index da197e476..7ea2887b7 100644
650650
static const char *const AArch64beLibDirs[] = {"/lib"};
651651
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
652652
"aarch64_be-linux-gnu"};
653-
@@ -2025,7 +2028,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
653+
@@ -2105,7 +2108,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
654654
"x86_64-redhat-linux", "x86_64-suse-linux",
655655
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
656656
"x86_64-slackware-linux", "x86_64-unknown-linux",
657657
- "x86_64-amazon-linux", "x86_64-linux-android"};
658658
+ "x86_64-amazon-linux", "x86_64-linux-android",
659659
+ "x86_64-aero", "x86_64-aero-system", "x86_64-aero-kernel"};
660-
static const char *const X32LibDirs[] = {"/libx32"};
661-
static const char *const X86LibDirs[] = {"/lib32", "/lib"};
662-
static const char *const X86Triples[] = {
663-
@@ -2090,7 +2094,10 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
664-
static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu",
660+
static const char *const X32Triples[] = {"x86_64-linux-gnux32",
661+
"x86_64-pc-linux-gnux32"};
662+
static const char *const X32LibDirs[] = {"/libx32", "/lib"};
663+
@@ -2183,7 +2187,10 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
665664
"riscv64-linux-gnu",
666665
"riscv64-unknown-elf",
666+
"riscv64-redhat-linux",
667667
- "riscv64-suse-linux"};
668668
+ "riscv64-suse-linux",
669669
+ "riscv64-aero",
670670
+ "riscv64-aero-kernel",
671671
+ "riscv64-aero-system"};
672-
672+
673673
static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
674674
static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
675675
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
@@ -711,68 +711,72 @@ index 76a754d67..5899b5449 100644
711711
enum ObjectFormatType {
712712
UnknownObjectFormat,
713713
diff --git a/llvm/include/llvm/Support/SwapByteOrder.h b/llvm/include/llvm/Support/SwapByteOrder.h
714-
index 6cec87006..ceefb0673 100644
714+
index e8612ba66..7c4e941bd 100644
715715
--- a/llvm/include/llvm/Support/SwapByteOrder.h
716716
+++ b/llvm/include/llvm/Support/SwapByteOrder.h
717717
@@ -22,7 +22,7 @@
718-
#include <stdlib.h>
719718
#endif
720-
721-
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
722-
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || defined(__aero__)
719+
720+
#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \
721+
- defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
722+
+ defined(__Fuchsia__) || defined(__EMSCRIPTEN__) || defined(__aero__)
723723
#include <endian.h>
724724
#elif defined(_AIX)
725725
#include <sys/machine.h>
726726
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
727-
index 2c480c109..872511977 100644
727+
index 883115463..e27e27ecc 100644
728728
--- a/llvm/lib/Support/Triple.cpp
729729
+++ b/llvm/lib/Support/Triple.cpp
730-
@@ -201,6 +201,7 @@ StringRef Triple::getOSTypeName(OSType Kind) {
731-
case Linux: return "linux";
732-
case Lv2: return "lv2";
733-
case MacOSX: return "macosx";
730+
@@ -189,6 +189,7 @@ StringRef Triple::getOSTypeName(OSType Kind) {
731+
case UnknownOS: return "unknown";
732+
733+
case AIX: return "aix";
734734
+ case Aero: return "aero";
735-
case Mesa3D: return "mesa3d";
736-
case Minix: return "minix";
737-
case NVCL: return "nvcl";
738-
@@ -235,12 +236,14 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
739-
case GNUEABIHF: return "gnueabihf";
735+
case AMDHSA: return "amdhsa";
736+
case AMDPAL: return "amdpal";
737+
case Ananas: return "ananas";
738+
@@ -245,6 +246,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
740739
case GNUX32: return "gnux32";
740+
case GNUILP32: return "gnu_ilp32";
741741
case Itanium: return "itanium";
742742
+ case Kernel: return "kernel";
743743
case MSVC: return "msvc";
744744
case MacABI: return "macabi";
745745
case Musl: return "musl";
746-
case MuslEABI: return "musleabi";
746+
@@ -252,6 +254,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
747747
case MuslEABIHF: return "musleabihf";
748+
case MuslX32: return "muslx32";
748749
case Simulator: return "simulator";
749750
+ case System: return "system";
750751
}
751-
752+
752753
llvm_unreachable("Invalid EnvironmentType!");
753-
@@ -495,6 +498,7 @@ static Triple::OSType parseOS(StringRef OSName) {
754-
.StartsWith("linux", Triple::Linux)
755-
.StartsWith("lv2", Triple::Lv2)
756-
.StartsWith("macos", Triple::MacOSX)
754+
@@ -502,6 +505,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
755+
756+
static Triple::OSType parseOS(StringRef OSName) {
757+
return StringSwitch<Triple::OSType>(OSName)
757758
+ .StartsWith("aero", Triple::Aero)
758-
.StartsWith("netbsd", Triple::NetBSD)
759-
.StartsWith("openbsd", Triple::OpenBSD)
760-
.StartsWith("solaris", Triple::Solaris)
761-
@@ -544,6 +548,8 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
762-
.StartsWith("coreclr", Triple::CoreCLR)
763-
.StartsWith("simulator", Triple::Simulator)
764-
.StartsWith("macabi", Triple::MacABI)
765-
+ .StartsWith("kernel", Triple::Kernel)
766-
+ .StartsWith("system", Triple::System)
767-
.Default(Triple::UnknownEnvironment);
759+
.StartsWith("ananas", Triple::Ananas)
760+
.StartsWith("cloudabi", Triple::CloudABI)
761+
.StartsWith("darwin", Triple::Darwin)
762+
@@ -560,9 +564,11 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
763+
.StartsWith("musl", Triple::Musl)
764+
.StartsWith("msvc", Triple::MSVC)
765+
.StartsWith("itanium", Triple::Itanium)
766+
+ .StartsWith("kernel", Triple::Kernel)
767+
.StartsWith("cygnus", Triple::Cygnus)
768+
.StartsWith("coreclr", Triple::CoreCLR)
769+
.StartsWith("simulator", Triple::Simulator)
770+
+ .StartsWith("system", Triple::System)
771+
.StartsWith("macabi", Triple::MacABI)
772+
.Default(Triple::UnknownEnvironment);
768773
}
769-
770774
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
771775
index 2a03dc682..e75ff461d 100644
772776
--- a/llvm/lib/Support/Unix/Path.inc
773777
+++ b/llvm/lib/Support/Unix/Path.inc
774778
@@ -64,7 +64,7 @@ extern char **environ;
775-
779+
776780
#include <sys/types.h>
777781
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
778782
- !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX)
@@ -791,7 +795,7 @@ index 2a03dc682..e75ff461d 100644
791795
#else
792796
@@ -431,7 +431,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) {
793797
}
794-
798+
795799
static bool is_local_impl(struct STATVFS &Vfs) {
796800
-#if defined(__linux__) || defined(__GNU__)
797801
+#if defined(__linux__) || defined(__GNU__) || defined(__aero__)
@@ -809,15 +813,19 @@ index 520685a0e..e6c2ddf20 100644
809813
+#undef HAVE_POSIX_SPAWN
810814
#ifdef HAVE_POSIX_SPAWN
811815
#include <spawn.h>
812-
816+
813817
diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp
814-
index 5bef4d514..2a237ef59 100644
818+
index 19a971afa..929184bfc 100644
815819
--- a/llvm/tools/llvm-dwarfdump/Statistics.cpp
816820
+++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp
817-
@@ -1,3 +1,4 @@
821+
@@ -6,6 +6,8 @@
822+
//
823+
//===----------------------------------------------------------------------===//
824+
818825
+#include <cmath>
826+
+
827+
#include "llvm-dwarfdump.h"
819828
#include "llvm/ADT/DenseMap.h"
820-
#include "llvm/ADT/StringExtras.h"
821829
#include "llvm/ADT/StringSet.h"
822830
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
823831
index 3eb6db33a..554264a07 100644
@@ -831,18 +839,5 @@ index 3eb6db33a..554264a07 100644
831839
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
832840
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
833841
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
834-
diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h
835-
index 0705e219f..6001fb8e0 100644
836-
--- a/llvm/utils/benchmark/src/benchmark_register.h
837-
+++ b/llvm/utils/benchmark/src/benchmark_register.h
838-
@@ -2,6 +2,7 @@
839-
#define BENCHMARK_REGISTER_H
840-
841-
#include <vector>
842-
+#include <limits>
843-
844-
#include "check.h"
845-
846-
--
842+
--
847843
2.34.1
848-

0 commit comments

Comments
 (0)