bpo-37690: Simplify linking of shared libraries on the AIX OS#14965
Closed
ericvw wants to merge 2 commits intopython:masterfrom
ericvw:aix-extension-simplify
Closed
bpo-37690: Simplify linking of shared libraries on the AIX OS#14965ericvw wants to merge 2 commits intopython:masterfrom ericvw:aix-extension-simplify
ericvw wants to merge 2 commits intopython:masterfrom
ericvw:aix-extension-simplify
Conversation
Have the approach of building shared libraries on the AIX operating
system be similar to that of a System V system. The primary benefit of
this change is the elimination of custom AIX paths and reducing the
changes at `./configure` to affect just the `LDSHARED` environment
variable.
For background context, AIX sees shared libraries as fully linked and
resolved, where symbol references are resolved at link-time and cannot
be rebound at load-time. System V resolves all global symbols by the
run-time linker. Thus, conventional shared libraries in AIX cannot have
undefined symbols, while System V can.
However, AIX does allow for run-time linking in allowing symbols to be
undefined until load-time.
Therefore, this change affects how linking of shared libraries are
performed on AIX to behave similarly to that of System V.
Given that symbols are now going to be allowed to be undefined for AIX,
all the code paths for generating exported symbols and the related
wrapper scripts go away.
The real magic is in the `-G` flag for `LDSHARED`. Effectively, `-G`
is equivalent to specifying the following:
* -berok: Suppress errors even if there are unresolved symbols
* -brtl: Enable run-time linking
* -bnortllib: Do not include a reference to the run-time linker
* -bnosymbolic: Assigns 'nosymbolic' attribute to most symbols (i.e.,
can be rebound)
* -bnoautoexp: Prevent auto exportation of any symbols
* -bM:SRE: Set the module type to reusable (i.e., require a private copy
of the data area for each process).
Ensure that the summary of the change will be rendered in release notes.
ericvw
commented
Jul 26, 2019
Contributor
Author
ericvw
left a comment
There was a problem hiding this comment.
The two lines highlighted are the important ones which allow for the removal of other AIX related code or files entirely.
| AIX*) | ||
| BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp" | ||
| LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp" | ||
| LDSHARED='$(CC) -G' |
Contributor
Author
There was a problem hiding this comment.
This line is one of the important changes.
| AIX*) | ||
| BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp" | ||
| LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp" | ||
| LDSHARED='$(CC) -G' |
Contributor
Author
There was a problem hiding this comment.
This line is the other important changes.
Contributor
Author
|
Abandoning this change due to feedback provided in https://bugs.python.org/issue37690. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Have the approach of building shared libraries on the AIX operating
system be similar to that of a System V system. The primary benefit of
this change is the elimination of custom AIX paths and reducing the
changes at
./configureto affect just theLDSHAREDenvironmentvariable.
For background context, AIX sees shared libraries as fully linked and
resolved, where symbol references are resolved at link-time and cannot
be rebound at load-time. System V resolves all global symbols by the
run-time linker. Thus, conventional shared libraries in AIX cannot have
undefined symbols, while System V can.
However, AIX does allow for run-time linking in allowing symbols to be
undefined until load-time.
Therefore, this change affects how linking of shared libraries are
performed on AIX to behave similarly to that of System V.
Given that symbols are now going to be allowed to be undefined for AIX,
all the code paths for generating exported symbols and the related
wrapper scripts go away.
The real magic is in the
-Gflag forLDSHARED. Effectively,-Gis equivalent to specifying the following:
can be rebound)
of the data area for each process).
https://bugs.python.org/issue37690