Remove nocopts attribute that is incompatible with Bazel 0.0 and was purely related to upstream.
Closes #21
PiperOrigin-RevId: 274403067
diff --git a/.bazelrc b/.bazelrc
index c9ade83..ef30272 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -19,31 +19,3 @@
# Enable some default cpu flags for x86 optimization.
build:x86opt --copt=-mavx2
-
-# Experimental config for building on Windows via clang-cl.
-# As an aspiration, it may eventually not be required to manually
-# activate this config, but for now, it is a place to store the
-# set of flags and tweaks needed to get the Windows build working.
-# Note that this is intended to work with clang-cl, not the Visual
-# Studio compiler. The following must be performed prior to invoking
-# Bazel:
-# * Install Visual Studio Build Tools
-# * export USE_CLANG_CL=1
-# * export BAZEL_LLVM=C:/Users/$USER/scoop/apps/llvm/current
-# (or actual LLVM install location)
-# Then one can build with:
-# bazel build --config=windows {targets...}
-
-# Works around __TIME__ __DATE__, etc redefinitions and -std=c++14
-# warnings.
-build:windows --copt=-Wno-builtin-macro-redefined --copt=-Wno-unknown-argument
-
-# Disables windows headers from pulling in GDI, which does a lot of terrible
-# things (such as defining the ERROR macro, which breaks the world).
-build:windows --copt=-DNOGDI
-
-# Enables unix-style runfiles link trees (requires symlink permission).
-# See: https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/
-# Generally: Enable Developer Mode in the Developer Settings page of the
-# system settings.
-build:windows --experimental_enable_runfiles
\ No newline at end of file
diff --git a/build_tools/third_party/glslang/BUILD.overlay b/build_tools/third_party/glslang/BUILD.overlay
index 1ef22dd..9368069 100644
--- a/build_tools/third_party/glslang/BUILD.overlay
+++ b/build_tools/third_party/glslang/BUILD.overlay
@@ -14,31 +14,6 @@
package(default_visibility = ["//visibility:public"])
-OS_SRCS = select({
- "@bazel_tools//src/conditions:windows": [
- "glslang/OSDependent/Windows/ossource.cpp",
- ],
- "//conditions:default": [
- "glslang/OSDependent/Unix/ossource.cpp",
- ],
-})
-
-OS_DEFINES = select({
- "@bazel_tools//src/conditions:windows": [
- ],
- "//conditions:default": [
- "GLSLANG_OSINCLUDE_UNIX",
- ],
-})
-
-OS_LINKOPTS = select({
- "@bazel_tools//src/conditions:windows": [
- ],
- "//conditions:default": [
- "-lpthread",
- ],
-})
-
cc_library(
name = "glslang",
srcs = glob(
@@ -56,7 +31,8 @@
],
) + [
"OGLCompilersDLL/InitializeDll.cpp",
- ] + OS_SRCS,
+ "glslang/OSDependent/Unix/ossource.cpp",
+ ],
hdrs = glob([
"glslang/Include/*.h",
"glslang/MachineIndependent/*.h",
@@ -73,8 +49,9 @@
"AMD_EXTENSIONS",
"ENABLE_HLSL",
"ENABLE_OPT=1",
+ "GLSLANG_OSINCLUDE_UNIX",
"NV_EXTENSIONS",
- ] + OS_DEFINES,
+ ],
linkstatic = 1,
)
@@ -133,5 +110,6 @@
":glslang",
":glslang-default-resource-limits",
],
- linkopts = OS_LINKOPTS,
+ # TODO(laurenzo): Windows?
+ linkopts = ["-pthread"],
)
diff --git a/iree/base/internal/init_internal.cc b/iree/base/internal/init_internal.cc
index 49eff69..434fc96 100644
--- a/iree/base/internal/init_internal.cc
+++ b/iree/base/internal/init_internal.cc
@@ -14,8 +14,6 @@
#include "iree/base/internal/init_internal.h"
-#include <string.h>
-
#include <set>
#include "absl/flags/parse.h"
@@ -94,17 +92,7 @@
}
void InitializeEnvironment(int* argc, char*** argv) {
- auto positional_args = absl::ParseCommandLine(*argc, *argv);
- if (positional_args.size() != *argc) {
- // Edit the passed argument refs to only include positional args.
- *argc = positional_args.size();
- char** new_argv = new char*[*argc + 1];
- for (int i = 0; i < *argc; ++i) {
- new_argv[i] = strdup(positional_args[i]);
- }
- new_argv[*argc + 1] = nullptr;
- *argv = new_argv;
- }
+ absl::ParseCommandLine(*argc, *argv);
IREE_RUN_MODULE_INITIALIZERS();
}
diff --git a/iree/tools/run_lit.sh b/iree/tools/run_lit.sh
index 40a008f..87f6a3f 100755
--- a/iree/tools/run_lit.sh
+++ b/iree/tools/run_lit.sh
@@ -17,9 +17,6 @@
ls -lR ${RUNFILES_DIR}
-# Detect whether cygwin/msys2 paths need to be translated.
-cygpath="$(which cygpath 2>/dev/null)"
-
# Bazel helpfully puts all data deps in the ${RUNFILES_DIR}, but
# it unhelpfully preserves the nesting with no way to reason about
# it generically. run_lit expects that anything passed in the runfiles
@@ -28,11 +25,7 @@
SUBPATH=""
for runfile_path in $(find "${RUNFILES_DIR}" -executable -print); do
# Prepend so that local things override.
- EXEDIR="$(dirname ${runfile_path})"
- if ! [ -z "$cygpath" ]; then
- EXEDIR="$($cygpath -u "$EXEDIR")"
- fi
- SUBPATH="${EXEDIR}:$SUBPATH"
+ SUBPATH="$(dirname ${runfile_path}):$SUBPATH"
done
echo "run_lit.sh: $1"
@@ -40,12 +33,7 @@
# Extract the test first line and assume it starts with:
# // RUN: ...
-firstline="$(egrep "^// RUN: " "$1" | head -n 1)"
-if [ -z "${firstline}" ]; then
- echo "ERROR: Could not find lit '// RUN: ' line"
- exit 1
-fi
-
+read -r firstline < $1
echo "FIRSTLINE: $firstline"
match="${firstline%%// RUN: *}"
command="${firstline##// RUN: }"
@@ -66,7 +54,6 @@
echo "PATH=$PATH"
echo "RUNNING TEST:"
echo "----------------"
-set -x
eval "$full_command"
echo "--- COMPLETE ---"
exit $?
diff --git a/iree/tools/run_mlir_main.cc b/iree/tools/run_mlir_main.cc
index 650800b..8aad9d8 100644
--- a/iree/tools/run_mlir_main.cc
+++ b/iree/tools/run_mlir_main.cc
@@ -344,11 +344,7 @@
LOG(ERROR) << "Must supply an input .mlir file.";
return 1;
}
- auto status = RunFile(argv[1]);
- if (!status.ok()) {
- std::cerr << "ERROR running file (" << argv[1] << "): " << status << "\n";
- }
- QCHECK_OK(status);
+ QCHECK_OK(RunFile(argv[1]));
return 0;
}