Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,15 +16,17 @@
#define _CET_ENDBR
#endif

#ifdef __APPLE__
#define HIDDEN .private_extern
#if defined(__APPLE__)
#define HIDDEN(symbol) .private_extern symbol
#elif defined(__ELF__)
#define HIDDEN(symbol) .hidden symbol
#else
#define HIDDEN .hidden
#define HIDDEN(symbol)
#endif

.intel_syntax noprefix
HIDDEN_blake3_hash_many_avx2
HIDDENblake3_hash_many_avx2
HIDDEN(_blake3_hash_many_avx2)
HIDDEN(blake3_hash_many_avx2)
.global _blake3_hash_many_avx2
.global blake3_hash_many_avx2
#ifdef __APPLE__
Expand Down
24 changes: 13 additions & 11 deletions llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,21 +16,23 @@
#define _CET_ENDBR
#endif

#ifdef __APPLE__
#define HIDDEN .private_extern
#if defined(__APPLE__)
#define HIDDEN(symbol) .private_extern symbol
#elif defined(__ELF__)
#define HIDDEN(symbol) .hidden symbol
#else
#define HIDDEN .hidden
#define HIDDEN(symbol)
#endif

.intel_syntax noprefix
HIDDEN_blake3_hash_many_avx512
HIDDENblake3_hash_many_avx512
HIDDENblake3_compress_in_place_avx512
HIDDEN_blake3_compress_in_place_avx512
HIDDENblake3_compress_xof_avx512
HIDDEN_blake3_compress_xof_avx512
HIDDENblake3_xof_many_avx512
HIDDEN_blake3_xof_many_avx512
HIDDEN(_blake3_hash_many_avx512)
HIDDEN(blake3_hash_many_avx512)
HIDDEN(blake3_compress_in_place_avx512)
HIDDEN(_blake3_compress_in_place_avx512)
HIDDEN(blake3_compress_xof_avx512)
HIDDEN(_blake3_compress_xof_avx512)
HIDDEN(blake3_xof_many_avx512)
HIDDEN(_blake3_xof_many_avx512)
.global _blake3_hash_many_avx512
.global blake3_hash_many_avx512
.global blake3_compress_in_place_avx512
Expand Down
20 changes: 11 additions & 9 deletions llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,19 +16,21 @@
#define _CET_ENDBR
#endif

#ifdef __APPLE__
#define HIDDEN .private_extern
#if defined(__APPLE__)
#define HIDDEN(symbol) .private_extern symbol
#elif defined(__ELF__)
#define HIDDEN(symbol) .hidden symbol
#else
#define HIDDEN .hidden
#define HIDDEN(symbol)
#endif

.intel_syntax noprefix
HIDDENblake3_hash_many_sse2
HIDDEN_blake3_hash_many_sse2
HIDDENblake3_compress_in_place_sse2
HIDDEN_blake3_compress_in_place_sse2
HIDDENblake3_compress_xof_sse2
HIDDEN_blake3_compress_xof_sse2
HIDDEN(blake3_hash_many_sse2)
HIDDEN(_blake3_hash_many_sse2)
HIDDEN(blake3_compress_in_place_sse2)
HIDDEN(_blake3_compress_in_place_sse2)
HIDDEN(blake3_compress_xof_sse2)
HIDDEN(_blake3_compress_xof_sse2)
.global blake3_hash_many_sse2
.global _blake3_hash_many_sse2
.global blake3_compress_in_place_sse2
Expand Down
20 changes: 11 additions & 9 deletions llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,19 +16,21 @@
#define _CET_ENDBR
#endif

#ifdef __APPLE__
#define HIDDEN .private_extern
#if defined(__APPLE__)
#define HIDDEN(symbol) .private_extern symbol
#elif defined(__ELF__)
#define HIDDEN(symbol) .hidden symbol
#else
#define HIDDEN .hidden
#define HIDDEN(symbol)
#endif

.intel_syntax noprefix
HIDDENblake3_hash_many_sse41
HIDDEN_blake3_hash_many_sse41
HIDDENblake3_compress_in_place_sse41
HIDDEN_blake3_compress_in_place_sse41
HIDDENblake3_compress_xof_sse41
HIDDEN_blake3_compress_xof_sse41
HIDDEN(blake3_hash_many_sse41)
HIDDEN(_blake3_hash_many_sse41)
HIDDEN(blake3_compress_in_place_sse41)
HIDDEN(_blake3_compress_in_place_sse41)
HIDDEN(blake3_compress_xof_sse41)
HIDDEN(_blake3_compress_xof_sse41)
.global blake3_hash_many_sse41
.global _blake3_hash_many_sse41
.global blake3_compress_in_place_sse41
Expand Down
54 changes: 30 additions & 24 deletions utils/bazel/llvm-project-overlay/clang/BUILD.bazel
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_python//python:defs.bzl", "py_binary")
load(
Expand DownExpand Up@@ -577,23 +579,18 @@ exports_files(
glob(["include/**/*.td"]),
)

genrule(
write_file(
name = "basic_version_gen",
outs = ["include/clang/Basic/Version.inc"],
cmd = (
"echo '#define CLANG_VERSION{vers}' >> $@\n" +
"echo '#define CLANG_VERSION_MAJOR{major}' >> $@\n" +
"echo '#define CLANG_VERSION_MAJOR_STRING \"{major}\"' >> $@\n" +
"echo '#define CLANG_VERSION_MINOR{minor}' >> $@\n" +
"echo '#define CLANG_VERSION_PATCHLEVEL{patch}' >> $@\n" +
"echo '#define MAX_CLANG_ABI_COMPAT_VERSION{major}' >> $@\n" +
"echo '#define CLANG_VERSION_STRING \"{vers}\"' >> $@\n"
).format(
major = LLVM_VERSION_MAJOR,
minor = LLVM_VERSION_MINOR,
patch = LLVM_VERSION_PATCH,
vers = PACKAGE_VERSION,
),
out = "include/clang/Basic/Version.inc",
content = [
"#define CLANG_VERSION{}".format(PACKAGE_VERSION),
"#define CLANG_VERSION_MAJOR{}".format(LLVM_VERSION_MAJOR),
"#define CLANG_VERSION_MAJOR_STRING \"{}\"".format(LLVM_VERSION_MAJOR),
"#define CLANG_VERSION_MINOR{}".format(LLVM_VERSION_MINOR),
"#define CLANG_VERSION_PATCHLEVEL{}".format(LLVM_VERSION_PATCH),
"#define MAX_CLANG_ABI_COMPAT_VERSION{}".format(LLVM_VERSION_MAJOR),
"#define CLANG_VERSION_STRING \"{}\"".format(PACKAGE_VERSION),
],
)

cc_library(
Expand All@@ -611,13 +608,15 @@ cc_library(

# TODO: This should get replaced with something that actually generates the
# correct version number.
genrule(
write_file(
name = "vcs_version_gen",
# This should be under lib/Basic, but because of how the include paths
# are passed through bazel, it's easier to drop generated files next to
# the other includes.
outs = ["include/VCSVersion.inc"],
cmd = "echo '#undef CLANG_REVISION' > $@",
out = "include/VCSVersion.inc",
content = [
"#undef CLANG_REVISION",
],
)

py_binary(
Expand DownExpand Up@@ -979,16 +978,21 @@ cc_library(
],
)

genrule(
run_binary(
name = "analysis_htmllogger_gen",
srcs = [
"lib/Analysis/FlowSensitive/HTMLLogger.html",
"lib/Analysis/FlowSensitive/HTMLLogger.css",
"lib/Analysis/FlowSensitive/HTMLLogger.html",
"lib/Analysis/FlowSensitive/HTMLLogger.js",
],
outs = ["lib/Analysis/FlowSensitive/HTMLLogger.inc"],
cmd = "$(location :bundle_resources) $@ $(SRCS)",
tools = [":bundle_resources"],
args = [
"$(execpath lib/Analysis/FlowSensitive/HTMLLogger.inc)",
"$(execpath lib/Analysis/FlowSensitive/HTMLLogger.html)",
"$(execpath lib/Analysis/FlowSensitive/HTMLLogger.css)",
"$(execpath lib/Analysis/FlowSensitive/HTMLLogger.js)",
],
tool = ":bundle_resources",
)

cc_library(
Expand DownExpand Up@@ -1549,7 +1553,9 @@ cc_library(
"lib/Driver",
],
linkopts = select({
"@platforms//os:windows": ["version.lib"],
"//llvm:is_windows_clang_mingw": ["-lversion"],
"//llvm:is_windows_clang_cl": ["version.lib"],
"//llvm:is_windows_msvc": ["version.lib"],
"//conditions:default": [],
}),
textual_hdrs = glob([
Expand Down
19 changes: 12 additions & 7 deletions utils/bazel/llvm-project-overlay/lld/BUILD.bazel
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_cc//cc:defs.bzl", "cc_library")
load(
"//:vars.bzl",
Expand All@@ -19,17 +20,21 @@ package(
licenses(["notice"])

# TODO: Actually compute version info
genrule(
write_file(
name = "config_version_gen",
outs = ["include/lld/Common/Version.inc"],
cmd = "echo '#define LLD_VERSION_STRING \"{}\"' > $@".format(LLVM_VERSION),
out = "include/lld/Common/Version.inc",
content = [
"#define LLD_VERSION_STRING \"{}\"".format(LLVM_VERSION),
],
)

genrule(
write_file(
name = "vcs_version_gen",
outs = ["Common/VCSVersion.inc"],
cmd = "echo '#undef LLD_REVISION' >> $@\n" +
"echo '#undef LLD_REPOSITORY' >> $@\n",
out = "Common/VCSVersion.inc",
content = [
"#undef LLD_REVISION",
"#undef LLD_REPOSITORY",
],
)

# See https://github.com/bazelbuild/bazel/issues/13803
Expand Down
55 changes: 46 additions & 9 deletions utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@

load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
Expand DownExpand Up@@ -208,18 +209,40 @@ cc_library(
deps = [":config"],
)

genrule(
write_file(
name = "generate_vcs_revision",
outs = ["include/llvm/Support/VCSRevision.h"],
cmd = "echo '#undef LLVM_REVISION' >> $@\n" +
"echo '#undef LLVM_REPOSITORY' >> $@\n",
out = "include/llvm/Support/VCSRevision.h",
content = [
"#undef LLVM_REVISION",
"#undef LLVM_REPOSITORY",
],
)

genrule(
write_file(
name = "generate_static_extension_registry",
outs = ["include/llvm/Support/Extension.def"],
cmd = "echo -e '// extension handlers' >> $@\n" +
"echo -e '#undef HANDLE_EXTENSION' >> $@\n",
out = "include/llvm/Support/Extension.def",
content = [
"// extension handlers",
"#undef HANDLE_EXTENSION",
],
)

config_setting(
name = "is_windows_clang_mingw",
constraint_values = ["@platforms//os:windows"],
flag_values ={"@rules_cc//cc/compiler:compiler": "clang"},
)

config_setting(
name = "is_windows_clang_cl",
constraint_values = ["@platforms//os:windows"],
flag_values ={"@rules_cc//cc/compiler:compiler": "clang-cl"},
)

config_setting(
name = "is_windows_msvc",
constraint_values = ["@platforms//os:windows"],
flag_values ={"@rules_cc//cc/compiler:compiler": "msvc-cl"},
)

cc_library(
Expand DownExpand Up@@ -297,7 +320,21 @@ cc_library(
}),
includes = ["include"],
linkopts = select({
"@platforms//os:windows": [
":is_windows_clang_mingw": [
"-lole32",
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note ole32 and uuid were missing here but are passed in https://github.com/llvm/llvm-project/blob/fa1dceb67f6fef652c2bf91c070ede64eadc49c6/llvm/lib/Support/CMakeLists.txt#L44C48-L44C53

the other libs are either added by default already or actually unused.

"-luuid",
"-lws2_32",
"-lntdll",
],
":is_windows_clang_cl": [
"ole32.lib",
"uuid.lib",
"ws2_32.lib",
"ntdll.lib",
],
":is_windows_msvc": [
"ole32.lib",
"uuid.lib",
"ws2_32.lib",
"ntdll.lib",
],
Expand Down