Skip to content

Commit af99477

Browse files
committed
Remove unneeded blank lines
1 parent e15d9d0 commit af99477

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

1.6/ja/book/advanced-linking.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<!-- but supporting the range of linking possibilities made available by other -->
66
<!-- languages is important for Rust to achieve seamless interaction with native -->
77
<!-- libraries. -->
8-
98
Rustにおけるリンクの一般的なケースについては本書の前の方で説明しましたが、他言語から利用できるような幅広いリンクをサポートすることは、ネイティブライブラリーとのシームレスな相互利用を実現するために、Rustにとって重要です。
109

1110
<!-- # Link args -->
@@ -15,7 +14,6 @@ Rustにおけるリンクの一般的なケースについては本書の前の
1514
<!-- the `link_args` attribute. This attribute is applied to `extern` blocks and -->
1615
<!-- specifies raw flags which need to get passed to the linker when producing an -->
1716
<!-- artifact. An example usage would be: -->
18-
1917
どのようにリンクをカスタマイズするかを`rustc`に指示するために、1つの方法があります。それは、`link_args`属性を使うことです。
2018
この属性は`extern`ブロックに適用され、生成物を作るときにリンカーに渡したいフラグをそのまま指定します。
2119
使い方の例は次のようになります。
@@ -36,15 +34,13 @@ extern {}
3634
<!-- LLVM directly to link native libraries, in which case `link_args` will have no -->
3735
<!-- meaning. You can achieve the same effect as the `link_args` attribute with the -->
3836
<!-- `-C link-args` argument to `rustc`. -->
39-
4037
これはリンクを実行するための認められた方法ではないため、この機能は現在`feature(link_args)`ゲートによって隠されているということに注意しましょう。
4138
今は`rustc`がシステムリンカー(多くのシステムでは`gcc`、MSVCでは`link.exe`)に渡すので、追加のコマンドライン引数を提供することには意味がありますが、それが今後もそうだとは限りません。
4239
将来、`rustc`がネイティブライブラリーをリンクするためにLLVMを直接使うようになるかもしれませんし、そのような場合には`link_args`は意味がなくなるでしょう。
4340
`rustc``-C link-args`引数をつけることで、`link_args`属性と同じような効果を得ることができます。
4441

4542
<!-- It is highly recommended to *not* use this attribute, and rather use the more -->
4643
<!-- formal `#[link(...)]` attribute on `extern` blocks instead. -->
47-
4844
この属性は使わ *ない* ことが強く推奨されているので、代わりにもっと正式な`#[link(...)]`属性を`extern`ブロックに使いましょう。
4945

5046
<!-- # Static linking -->
@@ -57,15 +53,13 @@ extern {}
5753
<!-- installing Rust everywhere. By contrast, native libraries -->
5854
<!-- (e.g. `libc` and `libm`) are usually dynamically linked, but it is possible to -->
5955
<!-- change this and statically link them as well. -->
60-
6156
スタティックリンクとは全ての必要なライブラリーを含めた出力を生成する手順のことで、そうすればコンパイルされたプロジェクトを使いたいシステム全てにライブラリーをインストールする必要がなくなります。
6257
Rustのみで構築された依存関係はデフォルトでスタティックリンクされます。そのため、Rustをインストールしなくても、作成されたバイナリーやライブラリーを使うことができます。
6358
対照的に、ネイティブライブラリー(例えば`libc``libm`)はダイナミックリンクされるのが普通です。しかし、これを変更してそれらを同様にスタティックリンクすることも可能です。
6459

6560
<!-- Linking is a very platform-dependent topic, and static linking may not even be -->
6661
<!-- possible on some platforms! This section assumes some basic familiarity with -->
6762
<!-- linking on your platform of choice. -->
68-
6963
リンクは非常にプラットフォームに依存した話題であり、スタティックリンクのできないプラットフォームすらあるかもしれません!
7064
このセクションは選んだプラットフォームにおけるリンクについての基本が理解できていることを前提とします。
7165

@@ -75,7 +69,6 @@ Rustのみで構築された依存関係はデフォルトでスタティック
7569
<!-- By default, all Rust programs on Linux will link to the system `libc` along with -->
7670
<!-- a number of other libraries. Let's look at an example on a 64-bit Linux machine -->
7771
<!-- with GCC and `glibc` (by far the most common `libc` on Linux): -->
78-
7972
デフォルトでは、Linux上の全てのRustのプログラムはシステムの`libc`とその他のいくつかのライブラリーとリンクされます。
8073
GCCと`glibc`(Linuxにおける最も一般的な`libc`)を使った64ビットLinuxマシンでの例を見てみましょう。
8174

@@ -97,13 +90,11 @@ $ ldd example
9790
<!-- Dynamic linking on Linux can be undesirable if you wish to use new library -->
9891
<!-- features on old systems or target systems which do not have the required -->
9992
<!-- dependencies for your program to run. -->
100-
10193
古いシステムで新しいライブラリーの機能を使いたいときや、実行するプログラムに必要な依存関係を満たさないシステムをターゲットにしたいときは、Linuxにおけるダイナミックリンクは望ましくないかもしれません。
10294

10395
<!-- Static linking is supported via an alternative `libc`, [`musl`](http://www.musl-libc.org). You can compile -->
10496
<!-- your own version of Rust with `musl` enabled and install it into a custom -->
10597
<!-- directory with the instructions below: -->
106-
10798
スタティックリンクは代わりの`libc`である[`musl`](http://www.musl-libc.org/)によってサポートされています。
10899
以下の手順に従い、`musl`を有効にした独自バージョンのRustをコンパイルして独自のディレクトリーにインストールすることができます。
109100

@@ -151,7 +142,6 @@ $ du -h musldist/bin/rustc
151142
<!-- You now have a build of a `musl`-enabled Rust! Because we've installed it to a -->
152143
<!-- custom prefix we need to make sure our system can find the binaries and appropriate -->
153144
<!-- libraries when we try and run it: -->
154-
155145
これで`musl`が有効になったRustのビルドが手に入りました!
156146
独自のプレフィックスを付けてインストールしたので、試しに実行するときにはシステムがバイナリーと適切なライブラリーを見付けられることを確かめなければなりません。
157147

@@ -161,7 +151,6 @@ $ export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
161151
```
162152

163153
<!-- Let's try it out! -->
164-
165154
試してみましょう!
166155

167156
```text
@@ -176,13 +165,11 @@ thread '<main>' panicked at 'failed', example.rs:1
176165

177166
<!-- Success! This binary can be copied to almost any Linux machine with the same -->
178167
<!-- machine architecture and run without issues. -->
179-
180168
成功しました!
181169
このバイナリーは同じマシンアーキテクチャーであればほとんど全てのLinuxマシンにコピーして問題なく実行することができます。
182170

183171
<!-- `cargo build` also permits the `--target` option so you should be able to build -->
184172
<!-- your crates as normal. However, you may need to recompile your native libraries -->
185173
<!-- against `musl` before they can be linked against. -->
186-
187174
`cargo build``--target`オプションを受け付けるので、あなたのクレートも普通にビルドできるはずです。
188175
ただし、リンクする前にネイティブライブラリーを`musl`向けにリコンパイルする必要はあるかもしれません。

0 commit comments

Comments
 (0)