Skip to content

Commit 4859a9b

Browse files
committed
Merge branch 'main' into fixup/pythongh-11140
2 parents 5099616 + 2f07786 commit 4859a9b

File tree

6 files changed

+613
-441
lines changed

6 files changed

+613
-441
lines changed

Doc/c-api/long.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,11 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
364364
// A Python exception was set with the reason.
365365
return NULL;
366366
}
367-
else if (bytes > sizeof(bignum)) {
368-
// Overflow occurred, but 'bignum' contains as much as could fit.
367+
else if (bytes <= (Py_ssize_t)sizeof(value)) {
368+
// Success!
369+
}
370+
else {
371+
// Overflow occurred, but 'bignum' contains a truncated value.
369372
}
370373
371374
*endianness* may be passed ``-1`` for the native endian that CPython was
@@ -379,15 +382,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
379382
Unless an exception is raised, all *n_bytes* of the buffer will be written
380383
with as much of the value as can fit. This allows the caller to ignore all
381384
non-negative results if the intent is to match the typical behavior of a
382-
C-style downcast.
385+
C-style downcast. No exception is set for this case.
383386
384-
Values are always copied as twos-complement, and sufficient size will be
385-
requested for a sign bit. For example, this may cause an value that fits into
386-
8 bytes when treated as unsigned to request 9 bytes, even though all eight
387-
bytes were copied into the buffer. What has been omitted is the zero sign
388-
bit, which is redundant when the intention is to treat the value as unsigned.
387+
Values are always copied as two's-complement, and sufficient buffer will be
388+
requested to include a sign bit. For example, this may cause an value that
389+
fits into 8 bytes when treated as unsigned to request 9 bytes, even though
390+
all eight bytes were copied into the buffer. What has been omitted is the
391+
zero sign bit, which is redundant when the intention is to treat the value as
392+
unsigned.
389393
390-
Passing *n_bytes* of zero will always return the requested buffer size.
394+
Passing zero to *n_bytes* will return the requested buffer size.
391395
392396
.. note::
393397

Makefile.pre.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
184184
PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
185185
PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
186186
PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
187+
PYTHONFRAMEWORKINSTALLNAMEPREFIX= @PYTHONFRAMEWORKINSTALLNAMEPREFIX@
188+
RESSRCDIR= @RESSRCDIR@
187189
# Deployment target selected during configure, to be checked
188190
# by distutils. The export statement is needed to ensure that the
189191
# deployment target is active during build.
@@ -866,7 +868,7 @@ libpython3.so: libpython$(LDVERSION).so
866868
$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
867869

868870
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
869-
$(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
871+
$(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
870872

871873

872874
libpython$(VERSION).sl: $(LIBRARY_OBJS)
@@ -891,14 +893,13 @@ $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
891893
# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
892894
# minimal framework (not including the Lib directory and such) in the current
893895
# directory.
894-
RESSRCDIR=Mac/Resources/framework
895896
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
896897
$(LIBRARY) \
897898
$(RESSRCDIR)/Info.plist
898899
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
899900
$(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
900-
-all_load $(LIBRARY) -Wl,-single_module \
901-
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
901+
-all_load $(LIBRARY) \
902+
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \
902903
-compatibility_version $(VERSION) \
903904
-current_version $(VERSION) \
904905
-framework CoreFoundation $(LIBS);
@@ -2000,7 +2001,7 @@ multissltest: all
20002001
# which can lead to two parallel `./python setup.py build` processes that
20012002
# step on each others toes.
20022003
.PHONY: install
2003-
install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKINSTALLLAST@
2004+
install: @FRAMEWORKINSTALLFIRST@ @INSTALLTARGETS@ @FRAMEWORKINSTALLLAST@
20042005
if test "x$(ENSUREPIP)" != "xno" ; then \
20052006
case $(ENSUREPIP) in \
20062007
upgrade) ensurepip="--upgrade" ;; \
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configure and Makefile were refactored to accomodate framework builds on
2+
Apple platforms other than macOS.

0 commit comments

Comments
 (0)