上位(前方)互換性・下位(後方)互換性という言葉の意味

GCCのlibstdc++のマニュアルより

https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html

Versioning/Goal (バージョン管理/目標)

Versioning gives subsequent releases of library binaries the ability to add new symbols and add functionality, all the while retaining compatibility with the previous releases in the series. Thus, program binaries linked with the initial release of a library binary will still run correctly if the library binary is replaced by carefully-managed subsequent library binaries. This is called forward compatibility.

(上記引用のGoogle翻訳)
バージョン管理により、ライブラリ バイナリの後続のリリースに、シリーズの前のリリースとの互換性を維持しながら、新しいシンボルを追加したり機能を追加したりできるようになります。したがって、ライブラリ バイナリの最初のリリースにリンクされているプログラム バイナリは、ライブラリ バイナリが慎重に管理された後続のライブラリ バイナリに置き換えられた場合でも、引き続き正しく実行されます。これを前方互換性と呼びます。

The reverse (backwards compatibility) is not true. It is not possible to take program binaries linked with the latest version of a library binary in a release series (with additional symbols added), substitute in the initial release of the library binary, and remain link compatible.

(上記引用のGoogle翻訳)
その逆 (下位互換性) は当てはまりません。リリース シリーズのライブラリ バイナリの最新バージョン (シンボルが追加された) にリンクされたプログラム バイナリを取得し、ライブラリ バイナリの初期リリースで置き換えて、リンク互換性を維持することはできません。

Binaries with equivalent DT_SONAMEs are forward-compatibile: in the table below, releases incompatible with the previous one are explicitly noted.

(上記引用のGoogle翻訳)
同等の DT_SONAME を持つバイナリは上位互換性があります。以下の表では、以前のリリースと互換性のないリリースが明示的に示されています。

Stack Overflow

https://stackoverflow.com/questions/11107263/how-compatible-are-different-versions-of-glibc

In general, running binaries that were compiled for an older glibc version (e.g. 2.13) will run fine on a system with a newer glibc (e.g. 2.14, like your system).

(上記引用のGoogle翻訳)一般に、古い glibc バージョン (例: 2.13) 用にコンパイルされたバイナリを実行すると、新しい glibc を搭載したシステム (例: 2.14、お使いのシステム) で正常に動作します。

Running a binary that was built for a newer glibc (e.g. 2.15, like the one that fails) on a system with an older glibc will probably not work.

(上記引用のGoogle翻訳)
新しい glibc (失敗したものと同様の 2.15 など) 用に構築されたバイナリを、古い glibc を搭載したシステムで実行すると、おそらく機能しません。

In short, glibc is backward-compatible, not forward-compatible.

(上記引用のGoogle翻訳)
つまり、glibc は下位互換性がありますが、前方互換性はありません。

疑問点

上位互換性もしくは前方互換性(forward compatibility)と下位互換性もしくは後方互換性(backward compatibility)という二つの言葉が、最初の例(GCCのマニュアル)と二つ目の例(Stack Overflow)で真逆に使われているように思います。

どちらが正しいでしょうか?




瞬簡PDF 統合版 2024
アンテナハウスPDFソフトの統合製品!


瞬簡PDF 変換 2024
PDFをOffice文書へ高精度変換


瞬簡PDF 作成 2024
ドラッグ&ドロップでPDF作成


瞬簡PDF 変換 2024
PDFをOffice文書へ高精度変換

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です


*