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

Document static linking with musl #27193

Merged
merged 5 commits into from Jul 24, 2015

Conversation

Projects
None yet
7 participants
@aidanhs
Member

aidanhs commented Jul 21, 2015

Continuation of #25685.

@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Jul 21, 2015

Collaborator

r? @alexcrichton

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

Collaborator

rust-highfive commented Jul 21, 2015

r? @alexcrichton

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

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
# Link args
There is one other way to tell rustc how to customize linking, and that is via

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

rustc should be in graves

@steveklabnik

steveklabnik Jul 21, 2015

Member

rustc should be in graves

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
(e.g. `libc` and `libm`) usually dynamically linked, but it is possible to
change this and statically link them as well.
Linking is a very platform dependant topic - on some platforms, static linking

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

this should be an em dash rather than a hypen

@steveklabnik

steveklabnik Jul 21, 2015

Member

this should be an em dash rather than a hypen

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
## Linux
By default, all Rust programs on Linux will link to the system libc along with

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

libc should be in graves

@steveklabnik

steveklabnik Jul 21, 2015

Member

libc should be in graves

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
## Linux
By default, all Rust programs on Linux will link to the system libc along with
a number of other libraries. Let's look at an example on a 64-bit linux machine

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

Linux

@steveklabnik
Show outdated Hide outdated src/doc/trpl/advanced-linking.md
By default, all Rust programs on Linux will link to the system libc along with
a number of other libraries. Let's look at an example on a 64-bit linux machine
with GCC and glibc (by far the most common libc on Linux):

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

glibc and libc in graves

@steveklabnik

steveklabnik Jul 21, 2015

Member

glibc and libc in graves

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
```
Dynamic linking on Linux can be undesirable if you wish to use new library
features on old systems or target systems which simply do not have the required

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

s/simply//

@steveklabnik

steveklabnik Jul 21, 2015

Member

s/simply//

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
features on old systems or target systems which simply do not have the required
dependencies for your program to run.
Static linking supported via an alternative libc, musl - this must be enabled

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

libc and musl in graves

@steveklabnik

steveklabnik Jul 21, 2015

Member

libc and musl in graves

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
dependencies for your program to run.
Static linking supported via an alternative libc, musl - this must be enabled
at rust compile-time with some prerequisites available. You can compile your

This comment has been minimized.

@steveklabnik
@steveklabnik
Show outdated Hide outdated src/doc/trpl/advanced-linking.md
Static linking supported via an alternative libc, musl - this must be enabled
at rust compile-time with some prerequisites available. You can compile your
own version of rust with musl enabled and install it into a custom directory

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

Rust, musl in graves

@steveklabnik

steveklabnik Jul 21, 2015

Member

Rust, musl in graves

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
12K musldist/bin/rustc
```
You now have a build of a musl-enabled rust! Because we've installed it to a

This comment has been minimized.

@steveklabnik

steveklabnik Jul 21, 2015

Member

same here

@steveklabnik

steveklabnik Jul 21, 2015

Member

same here

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Jul 21, 2015

Member

I have a bunch of nitpicks, but thanks so much for writing this up!

Member

steveklabnik commented Jul 21, 2015

I have a bunch of nitpicks, but thanks so much for writing this up!

@aidanhs

This comment has been minimized.

Show comment
Hide comment
@aidanhs

aidanhs Jul 21, 2015

Member

Think I got them all.

Member

aidanhs commented Jul 21, 2015

Think I got them all.

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
(e.g. `libc` and `libm`) usually dynamically linked, but it is possible to
change this and statically link them as well.
Linking is a very platform dependant topic — on some platforms, static linking

This comment has been minimized.

@eefriedman

eefriedman Jul 21, 2015

Contributor

*dependent

@eefriedman

eefriedman Jul 21, 2015

Contributor

*dependent

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Jul 21, 2015

Member

@bors: r+ 231438a rollup

Nice!

Member

alexcrichton commented Jul 21, 2015

@bors: r+ 231438a rollup

Nice!

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 21, 2015

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
your own version of Rust with `musl` enabled and install it into a custom
directory with the instructions below:
```

This comment has been minimized.

@apasel422

apasel422 Jul 22, 2015

Member

This code block needs to be annotated so that it isn't compiled as Rust code. CC #27206.

@apasel422

apasel422 Jul 22, 2015

Member

This code block needs to be annotated so that it isn't compiled as Rust code. CC #27206.

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
custom prefix we need to make sure our system can the binaries and appropriate
libraries when we try and run it:
```

This comment has been minimized.

@apasel422

apasel422 Jul 22, 2015

Member

This one too.

@apasel422

apasel422 Jul 22, 2015

Member

This one too.

Show outdated Hide outdated src/doc/trpl/advanced-linking.md
Let's try it out!
```

This comment has been minimized.

@apasel422

apasel422 Jul 22, 2015

Member

This one too.

@apasel422

apasel422 Jul 22, 2015

Member

This one too.

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik
Member

steveklabnik commented Jul 22, 2015

@bors: r-

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Jul 22, 2015

Member

minusing this one until we fix the issues, we'll get it in soon!

Member

steveklabnik commented Jul 22, 2015

minusing this one until we fix the issues, we'll get it in soon!

@aidanhs

This comment has been minimized.

Show comment
Hide comment
@aidanhs

aidanhs Jul 22, 2015

Member

Added 'text' to code blocks.

Member

aidanhs commented Jul 22, 2015

Added 'text' to code blocks.

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Jul 22, 2015

Member

@bors: r+ rollup

Member

steveklabnik commented Jul 22, 2015

@bors: r+ rollup

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Jul 22, 2015

Contributor

📌 Commit b6a0d9e has been approved by steveklabnik

Contributor

bors commented Jul 22, 2015

📌 Commit b6a0d9e has been approved by steveklabnik

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 23, 2015

bors added a commit that referenced this pull request Jul 23, 2015

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 24, 2015

bors added a commit that referenced this pull request Jul 24, 2015

@bors bors merged commit b6a0d9e into rust-lang:master Jul 24, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@aidanhs

This comment has been minimized.

Show comment
Hide comment
@aidanhs

aidanhs Jul 25, 2015

Member

Hooray! Thanks all for the help with this.

Member

aidanhs commented Jul 25, 2015

Hooray! Thanks all for the help with this.

@aidanhs aidanhs deleted the aidanhs:aphs-advanced-linking-doc branch Jul 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment