Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sanitizer support on FreeBSD #74576

Merged
merged 2 commits into from
Aug 15, 2020
Merged

Conversation

valpackett
Copy link
Contributor

Restarting #47337. Everything is better now, no more weird llvm problems, well not everything:

Unfortunately, the sanitizers don't have proper support for versioned symbols (google/sanitizers#628), so libc's usage of stat@FBSD_1.0 and so on explodes, e.g. in calling std::fs::metadata.

Building std (now easy thanks to cargo -Zbuild-std) and libc with freebsd12/13 config via the LIBC_CI=1 env variable is a good workaround…

LIBC_CI=1 RUSTFLAGS="-Z sanitizer=address" cargo +san-test -Zbuild-std run --target x86_64-unknown-freebsd --verbose

except std won't build because there's no st_lspare in the ino64 version of the struct, so an std patch is required:

--- i/src/libstd/os/freebsd/fs.rs
+++ w/src/libstd/os/freebsd/fs.rs
@@ -66,8 +66,6 @@ pub trait MetadataExt {
     fn st_flags(&self) -> u32;
     #[stable(feature = "metadata_ext2", since = "1.8.0")]
     fn st_gen(&self) -> u32;
-    #[stable(feature = "metadata_ext2", since = "1.8.0")]
-    fn st_lspare(&self) -> u32;
 }
 
 #[stable(feature = "metadata_ext", since = "1.1.0")]
@@ -136,7 +134,4 @@ impl MetadataExt for Metadata {
     fn st_flags(&self) -> u32 {
         self.as_inner().as_inner().st_flags as u32
     }
-    fn st_lspare(&self) -> u32 {
-        self.as_inner().as_inner().st_lspare as u32
-    }
 }

I guess std could like.. detect that libc isn't built for the old ABI, and replace the implementation of st_lspare with a panic?

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 21, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Jul 21, 2020

That std patch by itself shouldn't be necessary,

pub st_lspare: i32,
is not conditional, so if that is missing on the C-header version of the same struct, it needs to be compiled out here

@valpackett
Copy link
Contributor Author

it needs to be compiled out here

That's what I'm wondering how to do..

I guess std could like.. detect that libc isn't built for the old ABI, and replace the implementation of st_lspare with a panic?

(just excluding the method would be fine too, almost nobody really seems to use that ext thing anyway)

I guess the only way is to repeat what libc's build.rs does with LIBC_CI / freebsd-version..?

@valpackett
Copy link
Contributor Author

is not conditional

Oh — the thing is, the accessor does not use the src/libstd/os/freebsd/raw.rs struct, it goes into the libc struct!

Maybe that should be changed, and then if we detect the libc being built for the newer ABI, either do not compile the ext at all (it won't match) or make another version that matches.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 22, 2020

If the libc crate can figure this out, maybe we can, too? Or is this done in a build script?

@valpackett
Copy link
Contributor Author

@oli-obk
Copy link
Contributor

oli-obk commented Jul 22, 2020

cc @alexcrichton

while implementation wise we can definitely add more things to the libstd build script, I don't know anything about this area and how to proceed best. libc has some libstd special compile-time logic already, so I think we need someone who already knows a bit about this link between the two libs.

@alexcrichton
Copy link
Member

Unfortunately I'm not sure I'll be able to help much here. It sounds like this is tied up in the question of what FreeBSD version is targeted for targets like x86_64-unknown-freebsd, and that's one which I don't think has a great answer in libstd as a precompiled binary or as source. It sounds like what needs to happen is somehow libstd itself needs to have a #[cfg] to switch between implementations but that cfg doesn't exist today easily. While libstd could replicate what libc is doing I'm not sure if that's the best answer.

Overally I don't have a great answer here, sorry :(. I think it would work to duplicate libc's build script into libstd, but that's not exactly a great solution unfortunately.

@valpackett
Copy link
Contributor Author

The great solution would be to have target versions (--target x86_64-unknown-freebsd13), but for now I guess we can only do something like that. Maybe with a less bad variable name than LIBC_CI..

@oli-obk
Copy link
Contributor

oli-obk commented Jul 23, 2020

The great solution would be to have target versions (--target x86_64-unknown-freebsd13), but for now I guess we can only do something like that. Maybe with a less bad variable name than LIBC_CI..

Hmm... I couldn't find any preexisting versioning like this in https://github.com/rust-lang/rust/tree/e59b08e62ea691916d2f063cac5aab4634128022/src/librustc_target/spec so yea, that would be a major undertaking. How about going with something really obvious like FREEBSD_12_13_SANITIZER_SUPPORT_HACK?

@bors
Copy link
Contributor

bors commented Jul 31, 2020

☔ The latest upstream changes (presumably #74844) made this pull request unmergeable. Please resolve the merge conflicts.

library/std/build.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Jul 31, 2020

sorry, I didn't see your force push

@oli-obk
Copy link
Contributor

oli-obk commented Jul 31, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2020

📌 Commit baaf084 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 31, 2020
…-obk

Add sanitizer support on FreeBSD

Restarting rust-lang#47337. Everything is better now, no more weird llvm problems, well not everything:

Unfortunately, the sanitizers don't have proper support for versioned symbols (google/sanitizers#628), so `libc`'s usage of `stat@FBSD_1.0` and so on explodes, e.g. in calling `std::fs::metadata`.

Building std (now easy thanks to cargo `-Zbuild-std`) and libc with `freebsd12/13` config via the `LIBC_CI=1` env variable is a good workaround…

```
LIBC_CI=1 RUSTFLAGS="-Z sanitizer=address" cargo +san-test -Zbuild-std run --target x86_64-unknown-freebsd --verbose
```

…*except* std won't build because there's no `st_lspare` in the ino64 version of the struct, so an std patch is required:

```diff
--- i/src/libstd/os/freebsd/fs.rs
+++ w/src/libstd/os/freebsd/fs.rs
@@ -66,8 +66,6 @@ pub trait MetadataExt {
     fn st_flags(&self) -> u32;
     #[stable(feature = "metadata_ext2", since = "1.8.0")]
     fn st_gen(&self) -> u32;
-    #[stable(feature = "metadata_ext2", since = "1.8.0")]
-    fn st_lspare(&self) -> u32;
 }

 #[stable(feature = "metadata_ext", since = "1.1.0")]
@@ -136,7 +134,4 @@ impl MetadataExt for Metadata {
     fn st_flags(&self) -> u32 {
         self.as_inner().as_inner().st_flags as u32
     }
-    fn st_lspare(&self) -> u32 {
-        self.as_inner().as_inner().st_lspare as u32
-    }
 }
```

I guess std could like.. detect that `libc` isn't built for the old ABI, and replace the implementation of `st_lspare` with a panic?
@Manishearth
Copy link
Member

@bors r-

#74987 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 31, 2020
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 10, 2020
@bors
Copy link
Contributor

bors commented Aug 10, 2020

⌛ Testing commit ddbc456 with merge e9d65c53543dee07c4dd26407716f6083c43c4c1...

@rust-log-analyzer
Copy link
Collaborator

The job dist-various-1 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Aug 10, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 10, 2020
@tmiasko
Copy link
Contributor

tmiasko commented Aug 10, 2020

Spurious network error:

warning: spurious network error (1 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/adler/0.2.3/download`, got 502
error: failed to download from `https://crates.io/api/v1/crates/miniz_oxide/0.4.0/download`

@oli-obk
Copy link
Contributor

oli-obk commented Aug 10, 2020

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2020
@bors
Copy link
Contributor

bors commented Aug 10, 2020

⌛ Testing commit ddbc456 with merge c18def13276b39d8270d559735e824f4167c307b...

@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-freebsd of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
In file included from /checkout/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp:50:
/usr/local/x86_64-unknown-freebsd11/usr/include/sys/timeb.h:42:2: warning: "this file includes <sys/timeb.h> which is deprecated" [-W#warnings]
#warning "this file includes <sys/timeb.h> which is deprecated"
[ 73%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_procmaps_common.cpp.o
1 warning generated.
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
---
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
[ 95%] Building ASM object lib/asan/CMakeFiles/RTAsan.x86_64.dir/asan_interceptors_vfork.S.o
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
/checkout/src/llvm-project/compiler-rt/lib/asan/asan_interceptors_vfork.S:12:1: warning: DWARF2 only supports one section per compilation unit
.section .note.GNU-stack,"",%progbits
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
[ 95%] Built target RTSanitizerCommon.x86_64
---
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_fd.h:36:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
1 error generated.
1 error generated.
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_fd.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:134: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_fd.cpp.o' failed
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_clock.cpp:13:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
1 error generated.
1 error generated.
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_clock.cpp.o] Error 1
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:62: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_clock.cpp.o' failed
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface_java.cpp:14:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_mutexset.cpp:13:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_external.cpp:12:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:110: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_external.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:302: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface_java.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:422: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_mutexset.cpp.o' failed
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
#include <sys/_types.h>
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
1 error generated.
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
1 error generated.
1 error generated.
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
1 error generated.
1 error generated.
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_external.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface_java.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_mutexset.cpp.o] Error 1
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_debugging.cpp:14:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_report.h:15:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_symbolizer.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_vector.h:18:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_vector.h:18:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator_internal.h:16:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
1 error generated.
1 error generated.
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_debugging.cpp.o] Error 1
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:86: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_debugging.cpp.o' failed
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_flags.cpp:17:
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
---
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator_internal.h:16:
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
         ^~~~~~~~~~~~~~
1 error generated.
1 error generated.
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface.cpp:15:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:28:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
         ^~~~~~~~~~~~~~
1 error generated.
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_allocator.h:23:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
#include <sys/_types.h>
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_procmaps.h:23:
         ^~~~~~~~~~~~~~
1 error generated.
1 error generated.
1 error generated.
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
In file included from /checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_linux.h:20:
#include <sys/_types.h>
1 error generated.
1 error generated.
/checkout/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_platform_limits_freebsd.h:30:10: fatal error: 'sys/_types.h' file not found
#include <sys/_types.h>
1 error generated.
1 error generated.
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_flags.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface_ann.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_mman.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface_atomic.cpp.o] Error 1
make[3]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_mutex.cpp.o] Error 1
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:158: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_flags.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:254: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface_ann.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:230: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:374: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_mman.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:278: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_interface_atomic.cpp.o' failed
lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/build.make:398: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_mutex.cpp.o' failed
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
make[2]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/all] Error 2
CMakeFiles/Makefile2:4771: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/all' failed
make[1]: *** [lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rule] Error 2
CMakeFiles/Makefile2:4783: recipe for target 'lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rule' failed
make: *** [clang_rt.tsan-x86_64] Error 2
Makefile:1711: recipe for target 'clang_rt.tsan-x86_64' failed
command did not execute successfully, got: exit code: 2


build script failed, must exit now', /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cmake-0.1.42/src/lib.rs:861:5
 finished in 25.725
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-freebsd --target x86_64-unknown-freebsd
Build completed unsuccessfully in 0:07:40
== clock drift check ==
== clock drift check ==
  local time: Mon Aug 10 15:18:04 UTC 2020
  network time: Mon, 10 Aug 2020 15:18:04 GMT
== end clock drift check ==
##[error]Process completed with exit code 1.
Terminate orphan process: pid (3425) (node)
Terminate orphan process: pid (3453) (python)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Aug 10, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 10, 2020
@rust-log-analyzer
Copy link
Collaborator

The job dist-various-1 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

tmandry added a commit to tmandry/rust that referenced this pull request Aug 15, 2020
…imulacrum

Set CMAKE_SYSTEM_NAME when cross-compiling

Configure CMAKE_SYSTEM_NAME when cross-compiling in `configure_cmake`,
to tell CMake about target system. Previously this was done only for
LLVM step and now applies more generally to steps using cmake.

Helps with rust-lang#74576.
@tmiasko
Copy link
Contributor

tmiasko commented Aug 15, 2020

Can we retry this? The #75376 should address tsan build failure.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 15, 2020

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2020
@bors
Copy link
Contributor

bors commented Aug 15, 2020

⌛ Testing commit ddbc456 with merge 80fb3f3...

@bors
Copy link
Contributor

bors commented Aug 15, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: oli-obk
Pushing 80fb3f3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 15, 2020
@bors bors merged commit 80fb3f3 into rust-lang:master Aug 15, 2020
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants