タグ

2023年1月26日のブックマーク (2件)

  • Why is statically linking glibc discouraged?

    The reasons given in other answers are correct, but they are not the most important reason. The most important reason why glibc should not be statically linked, is that it makes extensive internal use of dlopen, to load NSS (Name Service Switch) modules and iconv conversions. The modules themselves refer to C library functions. If the main program is dynamically linked with the C library, that's n

    Why is statically linking glibc discouraged?
    todesking
    todesking 2023/01/26
  • Rust でバイナリを配布する

    これは天久保 Advent Calendar 2022 二日目の記事です。明日は休日なのでやすみです。 記事は全部 GNU/Linux においての話で、ELF 実行可能形式のファイルのことを指してバイナリと呼びます。 Rust で書いたプログラムをビルドして配布したいことがあるでしょう。サーバーアプリケーションなどとなればコンテナイメージを配布するのがまっとうに思えますが、コマンドラインアプリケーションとなると実行の手軽さや起動オーバーヘッドへの配慮からやはりバイナリを配布する必要が出てくると思います。一方で Rust でビルドしたバイナリは[1]システムの glibc に動的リンクされており、可搬性が低い可能性があります。つまり、ビルドした環境より glibc のバージョンが低い環境でそのバイナリは動かない可能性があるということです。実例を見てみましょう。下のプログラム[2]は Deb

    Rust でバイナリを配布する
    todesking
    todesking 2023/01/26