-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
Description
Chances are that my environment is too non-standard... but where can I find a config not to use it? git grep -- -plugin didn't find anything. Is it hard-coded in a pre-built JAR or something? Moreover, my toolkit should accept -plugin. Anything wrong with my CROSSTOOL ?
$ bash compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: compile.sh build /path/to/bazel
� Building Bazel from scratch...........
� Building Bazel with Bazel.
.WARNING: Output base '/home/nodakai/.cache/bazel/_bazel_nodakai/b9f9d0bfe2c30f0de6e9fab9bee6c1a2' is on NFS. This may lead to surprising failures and undetermined behavior.
Extracting Bazel installation...
Sending SIGTERM to previous Bazel server (pid=9423)... done.
......
INFO: Found 1 target...
INFO: From Linking src/main/tools/namespace-sandbox:
/usr/bin/ld: unrecognized option '-plugin'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
ERROR: /home/nodakai/src/bazel-HEAD/src/main/tools/BUILD:14:1: Linking of rule '//src/main/tools:namespace-sandbox' failed: gcc failed: error executing command /opt/rh/devtoolset-3/root/usr/bin/gcc -o bazel-out/local_linux-fastbuild/bin/src/main/tools/namespace-sandbox ... (remaining 10 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.963s, Critical Path: 1.72s
Building output/bazel
$ echo 'int main(void){return 5;}' | strace -f -e execve /opt/rh/devtoolset-3/root/usr/bin/gcc -xc - && ./a.out; echo $? (git)-master
execve("/opt/rh/devtoolset-3/root/usr/bin/gcc", ["/opt/rh/devtoolset-3/root/usr/bi"..., "-xc", "-"], [/* 59 vars */]) = 0
Process 29145 attached
[pid 29145] execve("/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/cc1", ["/opt/rh/devtoolset-3/root/usr/li"..., "-quiet", "-", "-quiet", "-dumpbase", "-", "-mtune=generic", "-march=x86-64", "-auxbase", "-", "-o", "/tmp/ccQuUjFT.s"], [/* 62 vars */]) = 0
[pid 29145] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29145, si_status=0, si_utime=0, si_stime=0} ---
Process 29146 attached
[pid 29146] execve("/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/as", ["/opt/rh/devtoolset-3/root/usr/li"..., "--64", "-o", "/tmp/ccWsjGDv.o", "/tmp/ccQuUjFT.s"], [/* 62 vars */]) = 0
[pid 29146] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29146, si_status=0, si_utime=0, si_stime=0} ---
Process 29147 attached
[pid 29147] execve("/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/collect2", ["/opt/rh/devtoolset-3/root/usr/li"..., "-plugin", "/opt/rh/devtoolset-3/root/usr/li"..., "-plugin-opt=/opt/rh/devtoolset-3"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--build-id", "--no-add-needed", "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", ...], [/* 64 vars */]) = 0
Process 29148 attached
[pid 29148] execve("/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/ld", ["/opt/rh/devtoolset-3/root/usr/li"..., "-plugin", "/opt/rh/devtoolset-3/root/usr/li"..., "-plugin-opt=/opt/rh/devtoolset-3"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--build-id", "--no-add-needed", "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", ...], [/* 64 vars */]) = 0
[pid 29148] +++ exited with 0 +++
[pid 29147] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29148, si_status=0, si_utime=0, si_stime=0} ---
[pid 29147] +++ exited with 0 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29147, si_status=0, si_utime=0, si_stime=0} ---
+++ exited with 0 +++
5
$ git di tools/
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL
index 25368e9..89e6bac 100644
--- a/tools/cpp/CROSSTOOL
+++ b/tools/cpp/CROSSTOOL
@@ -71,12 +71,12 @@ toolchain {
target_system_name: "local"
toolchain_identifier: "local_linux"
- tool_path { name: "ar" path: "/usr/bin/ar" }
- tool_path { name: "compat-ld" path: "/usr/bin/ld" }
- tool_path { name: "cpp" path: "/usr/bin/cpp" }
+ tool_path { name: "ar" path: "/opt/rh/devtoolset-3/root/usr/bin/ar" }
+ tool_path { name: "compat-ld" path: "/opt/rh/devtoolset-3/root/usr/bin/ld" }
+ tool_path { name: "cpp" path: "/opt/rh/devtoolset-3/root/usr/bin/cpp" }
tool_path { name: "dwp" path: "/usr/bin/dwp" }
- tool_path { name: "gcc" path: "/usr/bin/gcc" }
- cxx_flag: "-std=c++0x"
+ tool_path { name: "gcc" path: "/opt/rh/devtoolset-3/root/usr/bin/gcc" }
+ cxx_flag: "-std=c++14"
linker_flag: "-lstdc++"
linker_flag: "-B/usr/bin/"
@@ -84,21 +84,21 @@ toolchain {
# used by gcc. That works because bazel currently doesn't track files at
# absolute locations and has no remote execution, yet. However, this will need
# to be fixed, maybe with auto-detection?
- cxx_builtin_include_directory: "/usr/lib/gcc/"
+ cxx_builtin_include_directory: "/opt/rh/devtoolset-3/root/usr/include"
cxx_builtin_include_directory: "/usr/local/include"
cxx_builtin_include_directory: "/usr/include"
tool_path { name: "gcov" path: "/usr/bin/gcov" }
# C(++) compiles invoke the compiler (as that is the one knowing where
# to find libraries), but we provide LD so other rules can invoke the linker.
- tool_path { name: "ld" path: "/usr/bin/ld" }
+ tool_path { name: "ld" path: "/opt/rh/devtoolset-3/root/usr/bin/ld" }
- tool_path { name: "nm" path: "/usr/bin/nm" }
- tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
+ tool_path { name: "nm" path: "/opt/rh/devtoolset-3/root/usr/bin/nm" }
+ tool_path { name: "objcopy" path: "/opt/rh/devtoolset-3/root/usr/bin/objcopy" }
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
- tool_path { name: "objdump" path: "/usr/bin/objdump" }
- tool_path { name: "strip" path: "/usr/bin/strip" }
+ tool_path { name: "objdump" path: "/opt/rh/devtoolset-3/root/usr/bin/objdump" }
+ tool_path { name: "strip" path: "/opt/rh/devtoolset-3/root/usr/bin/strip" }
# Anticipated future default.
unfiltered_cxx_flag: "-no-canonical-prefixes"