Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1c258036
Kaydet (Commit)
1c258036
authored
Eyl 08, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a brief section on linking Python as an embedded scripting language.
This closes SourceForge bug #110833.
üst
e1c9e855
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
ext.tex
Doc/ext/ext.tex
+37
-0
No files found.
Doc/ext/ext.tex
Dosyayı görüntüle @
1c258036
...
...
@@ -2111,4 +2111,41 @@ will need to write the main program in \Cpp{}, and use the \Cpp{} compiler
to compile and link your program. There is no need to recompile Python
itself using
\Cpp
{}
.
\section
{
Linking Requirements
\label
{
link-reqs
}}
While the
\program
{
configure
}
script shipped with the Python sources
will correctly build Python to export the symbols needed by
dynamically linked extensions, this is not automatically inherited by
applications which embed the Python library statically, at least on
\UNIX
. This is an issue when the application is linked to the static
runtime library (
\file
{
libpython.a
}
) and needs to load dynamic
extensions (implemented as
\file
{
.so
}
files).
The problem is that some entry points are defined by the Python
runtime solely for extension modules to use. If the embedding
application does not use any of these entry points, some linkers will
not include those entries in the symbol table of the finished
executable. Some additional options are needed to inform the linker
not to remove these symbols.
Determining the right options to use for any given platform can be
quite difficult, but fortunately the Python configuration already has
those values. To retrieve them from an installed Python interpreter,
start an interactive interpreter and have a short session like this:
\begin{verbatim}
>>> import distutils.sysconfig
>>> distutils.sysconfig.LINKFORSHARED
'-Xlinker -export-dynamic'
\end{verbatim}
\refstmodindex
{
distutils.sysconfig
}
The contents of the string presented will be the options that should
be used. If the string is empty, there's no need to add any
additional options. The
\constant
{
LINKFORSHARED
}
definition
corresponds to the variable of the same name in Python's top-level
\file
{
Makefile
}
.
\end{document}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment