Are shared library ABI compatible as long as their versions are the same?

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Suppose I have a program compiled that's linked against libc.so.6 on one system (e.g., Ubuntu x64). If I take this binary to another system that has the same libc version 6 (e.g., Fedora x64), it seems to run fine.
My question is, is it more-or-less a contract that the ABI is stable as long as the so versions are identical?
dynamic-linking shared-library
add a comment |Â
up vote
0
down vote
favorite
Suppose I have a program compiled that's linked against libc.so.6 on one system (e.g., Ubuntu x64). If I take this binary to another system that has the same libc version 6 (e.g., Fedora x64), it seems to run fine.
My question is, is it more-or-less a contract that the ABI is stable as long as the so versions are identical?
dynamic-linking shared-library
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Suppose I have a program compiled that's linked against libc.so.6 on one system (e.g., Ubuntu x64). If I take this binary to another system that has the same libc version 6 (e.g., Fedora x64), it seems to run fine.
My question is, is it more-or-less a contract that the ABI is stable as long as the so versions are identical?
dynamic-linking shared-library
Suppose I have a program compiled that's linked against libc.so.6 on one system (e.g., Ubuntu x64). If I take this binary to another system that has the same libc version 6 (e.g., Fedora x64), it seems to run fine.
My question is, is it more-or-less a contract that the ABI is stable as long as the so versions are identical?
dynamic-linking shared-library
asked Apr 12 at 1:31
wbkang
1032
1032
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
No, it's not necessary that shared libraries be ABI compatible cross-distro. I think it's a reasonable expectation, but ABI breaks happen and you can't rely on ABI compatibility blindly.
An example would be libstdc++. On Ubuntu 16.04 (with GCC 5) and CentOS 7 (with GCC 4.8), the respective sos fall on opposite sides of an ABI break. Software compiled on Ubuntu 16.04 with C++ but without _GLIBCXX_USE_CXX11_ABI set would not run on CentOS 7. They're both still libstc++.so.6. ABI breaks may also happen with bug-fix patches applied by distro maintainers, who would not usually bump the so major version numbers for bug fixes.
1
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
1
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
No, it's not necessary that shared libraries be ABI compatible cross-distro. I think it's a reasonable expectation, but ABI breaks happen and you can't rely on ABI compatibility blindly.
An example would be libstdc++. On Ubuntu 16.04 (with GCC 5) and CentOS 7 (with GCC 4.8), the respective sos fall on opposite sides of an ABI break. Software compiled on Ubuntu 16.04 with C++ but without _GLIBCXX_USE_CXX11_ABI set would not run on CentOS 7. They're both still libstc++.so.6. ABI breaks may also happen with bug-fix patches applied by distro maintainers, who would not usually bump the so major version numbers for bug fixes.
1
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
1
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
add a comment |Â
up vote
2
down vote
accepted
No, it's not necessary that shared libraries be ABI compatible cross-distro. I think it's a reasonable expectation, but ABI breaks happen and you can't rely on ABI compatibility blindly.
An example would be libstdc++. On Ubuntu 16.04 (with GCC 5) and CentOS 7 (with GCC 4.8), the respective sos fall on opposite sides of an ABI break. Software compiled on Ubuntu 16.04 with C++ but without _GLIBCXX_USE_CXX11_ABI set would not run on CentOS 7. They're both still libstc++.so.6. ABI breaks may also happen with bug-fix patches applied by distro maintainers, who would not usually bump the so major version numbers for bug fixes.
1
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
1
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
No, it's not necessary that shared libraries be ABI compatible cross-distro. I think it's a reasonable expectation, but ABI breaks happen and you can't rely on ABI compatibility blindly.
An example would be libstdc++. On Ubuntu 16.04 (with GCC 5) and CentOS 7 (with GCC 4.8), the respective sos fall on opposite sides of an ABI break. Software compiled on Ubuntu 16.04 with C++ but without _GLIBCXX_USE_CXX11_ABI set would not run on CentOS 7. They're both still libstc++.so.6. ABI breaks may also happen with bug-fix patches applied by distro maintainers, who would not usually bump the so major version numbers for bug fixes.
No, it's not necessary that shared libraries be ABI compatible cross-distro. I think it's a reasonable expectation, but ABI breaks happen and you can't rely on ABI compatibility blindly.
An example would be libstdc++. On Ubuntu 16.04 (with GCC 5) and CentOS 7 (with GCC 4.8), the respective sos fall on opposite sides of an ABI break. Software compiled on Ubuntu 16.04 with C++ but without _GLIBCXX_USE_CXX11_ABI set would not run on CentOS 7. They're both still libstc++.so.6. ABI breaks may also happen with bug-fix patches applied by distro maintainers, who would not usually bump the so major version numbers for bug fixes.
answered Apr 12 at 2:33
muru
33.3k576140
33.3k576140
1
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
1
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
add a comment |Â
1
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
1
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
1
1
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
Out of interest, would this depend on the compiler alone or on the combination of compiler and Linux distribution? I.e., could this still be a problem within a single Linux distribution?
â Kusalananda
Apr 12 at 5:43
1
1
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@Kusalananda well, the bug-fix breaking ABI would be within the same release of the same distro, but I don't have any good examples of that handy.
â muru
Apr 12 at 7:46
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@muru Thank you. Just out of curiosity, is there a similar ABI rule for libc? I tried googling this but my google-fu is weak :(
â wbkang
Apr 12 at 14:29
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
@wbkang there's the musl vs glibc problem.
â muru
Apr 12 at 17:56
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437174%2fare-shared-library-abi-compatible-as-long-as-their-versions-are-the-same%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password