Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
4f1966f5
Commit
4f1966f5
authored
5 years ago
by
gnzlbg
Browse files
Options
Downloads
Patches
Plain Diff
Fix FreeBSD build
parent
d7907c00
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.rs
+17
-9
17 additions, 9 deletions
build.rs
with
17 additions
and
9 deletions
build.rs
+
17
−
9
View file @
4f1966f5
...
...
@@ -7,6 +7,8 @@ fn main() {
rustc_minor_version
()
.expect
(
"Failed to get rustc version"
);
let
rustc_dep_of_std
=
env
::
var
(
"CARGO_FEATURE_RUSTC_DEP_OF_STD"
)
.is_ok
();
let
align_cargo_feature
=
env
::
var
(
"CARGO_FEATURE_ALIGN"
)
.is_ok
();
#[allow(unused)]
let
libc_ci
=
env
::
var
(
"LIBC_CI"
)
.is_ok
();
if
env
::
var
(
"CARGO_FEATURE_USE_STD"
)
.is_ok
()
{
println!
(
...
...
@@ -15,15 +17,20 @@ fn main() {
);
}
if
env
::
var
(
"LIBC_CI"
)
.is_ok
()
{
if
let
Some
(
11
)
=
which_freebsd
()
{
println!
(
"cargo:rustc-cfg=freebsd11"
);
}
if
let
Some
(
12
)
=
which_freebsd
()
{
println!
(
"cargo:rustc-cfg=freebsd12"
);
}
if
let
Some
(
13
)
=
which_freebsd
()
{
println!
(
"cargo:rustc-cfg=freebsd13"
);
// The ABI of libc is backward compatible with FreeBSD 11.
//
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
// running tests to ensure that the ABI is correct.
#[cfg(target_os
=
"freebsd"
)]
match
which_freebsd
()
{
Some
(
11
)
if
libc_ci
=>
println!
(
"cargo:rustc-cfg=freebsd11"
),
Some
(
12
)
if
libc_ci
=>
println!
(
"cargo:rustc-cfg=freebsd12"
),
Some
(
13
)
if
libc_ci
=>
println!
(
"cargo:rustc-cfg=freebsd13"
),
Some
(
_
)
=>
println!
(
"cargo:rustc-cfg=freebsd11"
),
None
=>
/* not FreeBSD - nothing to do here */
{
()
}
}
...
...
@@ -87,6 +94,7 @@ fn rustc_minor_version() -> Option<u32> {
otry!
(
pieces
.next
())
.parse
()
.ok
()
}
#[cfg(target_os
=
"freebsd"
)]
fn
which_freebsd
()
->
Option
<
i32
>
{
let
output
=
std
::
process
::
Command
::
new
(
"freebsd-version"
)
.output
()
.ok
();
if
output
.is_none
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment