Skip to content

Commit

Permalink
[LLVM] add 12.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jul 11, 2021
1 parent 89bf46c commit af0aea3
Show file tree
Hide file tree
Showing 24 changed files with 1,672 additions and 1 deletion.
6 changes: 6 additions & 0 deletions L/LLVM/LLVM_full@12.0.1/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version = v"12.0.1"

include("../common.jl")

build_tarballs(ARGS, configure_build(ARGS, version; experimental_platforms=true)...;
preferred_gcc_version=v"7", preferred_llvm_version=v"9", julia_compat="1.7")
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/include/locale b/include/locale
index 2043892fa2d..4af51464208 100644
--- a/include/locale
+++ b/include/locale
@@ -737,7 +737,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
- long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+ long long __ll = strtoll(__a, &__p2, __base);
typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
@@ -777,7 +777,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
- unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+ unsigned long long __ll = strtoull(__a, &__p2, __base);
typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
From 4370214628487ac8495f963ae05960b5ecc31103 Mon Sep 17 00:00:00 2001
From: Jameson Nash <vtjnash@gmail.com>
Date: Thu, 12 Sep 2019 11:45:07 -0400
Subject: [PATCH] Revert "[MC] Always emit relocations for same-section
function references"

This reverts commit 9232972575cafac29c3e4817c8714c9aca0e8585.
---
lib/MC/WinCOFFObjectWriter.cpp | 12 +++++-------
test/MC/COFF/diff.s | 25 ++++++++-----------------
2 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/lib/MC/WinCOFFObjectWriter.cpp b/lib/MC/WinCOFFObjectWriter.cpp
index 9ffecd99df6..0214161e03c 100644
--- a/lib/MC/WinCOFFObjectWriter.cpp
+++ b/lib/MC/WinCOFFObjectWriter.cpp
@@ -690,14 +690,12 @@ void WinCOFFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
bool WinCOFFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(
const MCAssembler &Asm, const MCSymbol &SymA, const MCFragment &FB,
bool InSet, bool IsPCRel) const {
- // Don't drop relocations between functions, even if they are in the same text
- // section. Multiple Visual C++ linker features depend on having the
- // relocations present. The /INCREMENTAL flag will cause these relocations to
- // point to thunks, and the /GUARD:CF flag assumes that it can use relocations
- // to approximate the set of all address taken functions. LLD's implementation
- // of /GUARD:CF also relies on the existance of these relocations.
+ // MS LINK expects to be able to replace all references to a function with a
+ // thunk to implement their /INCREMENTAL feature. Make sure we don't optimize
+ // away any relocations to functions.
uint16_t Type = cast<MCSymbolCOFF>(SymA).getType();
- if ((Type >> COFF::SCT_COMPLEX_TYPE_SHIFT) == COFF::IMAGE_SYM_DTYPE_FUNCTION)
+ if (Asm.isIncrementalLinkerCompatible() &&
+ (Type >> COFF::SCT_COMPLEX_TYPE_SHIFT) == COFF::IMAGE_SYM_DTYPE_FUNCTION)
return false;
return MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(Asm, SymA, FB,
InSet, IsPCRel);
diff --git a/test/MC/COFF/diff.s b/test/MC/COFF/diff.s
index f89e4ed8901..d68e628577b 100644
--- a/test/MC/COFF/diff.s
+++ b/test/MC/COFF/diff.s
@@ -1,14 +1,19 @@
// RUN: llvm-mc -filetype=obj -triple i686-pc-mingw32 %s | llvm-readobj -s -sr -sd | FileCheck %s

-// COFF resolves differences between labels in the same section, unless that
-// label is declared with function type.
-
.section baz, "xr"
+ .def X
+ .scl 2;
+ .type 32;
+ .endef
.globl X
X:
mov Y-X+42, %eax
retl

+ .def Y
+ .scl 2;
+ .type 32;
+ .endef
.globl Y
Y:
retl
@@ -25,11 +30,6 @@ _foobar: # @foobar
# %bb.0:
ret

- .globl _baz
-_baz:
- calll _foobar
- retl
-
.data
.globl _rust_crate # @rust_crate
.align 4
@@ -39,15 +39,6 @@ _rust_crate:
.long _foobar-_rust_crate
.long _foobar-_rust_crate

-// Even though _baz and _foobar are in the same .text section, we keep the
-// relocation for compatibility with the VC linker's /guard:cf and /incremental
-// flags, even on mingw.
-
-// CHECK: Name: .text
-// CHECK: Relocations [
-// CHECK-NEXT: 0x12 IMAGE_REL_I386_REL32 _foobar
-// CHECK-NEXT: ]
-
// CHECK: Name: .data
// CHECK: Relocations [
// CHECK-NEXT: 0x4 IMAGE_REL_I386_DIR32 _foobar
--
2.17.1

Loading

0 comments on commit af0aea3

Please sign in to comment.