This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes, mark.dickinson, pitrou
Date 2021-11-13.09:15:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org>
In-reply-to
Content
Compiler and linker flags for _decimal and internal libmpdec are currently handled by a mix of configure checks and if/else chains in setup.py. The split makes it harder to build _decimal correctly from Modules/Setup. The Modules/Setup file also does not handle --with-system-mpdec.

I have a working PR that moves all logic into configure.ac. The new system:

* sets LIBMPDEC_CFLAGS and LIBMPDEC_LDFLAGS based on --with-system-libmpdec value.

* detects libmpdec_machine by looking at ac_sys_system, MACOSX_DEFAULT_ARCH, ac_cv_sizeof_size_t, ac_cv_gcc_asm_for_x64, ac_cv_type___uint128_t, and ac_cv_gcc_asm_for_x87.

* sets libmpdec compiler args based on libmpdec_machine, have_ipa_pure_const_bug, and have_glibc_memmove_bug.

* if --with-system-libmpdec is not given, then our Makefile compiles libmpdec objects and puts them into a libmpdec.a archive.

* finally it either links _decimal with our libmpdec.a or with system's libmpdec shared library.

I went for libmpdec.a because it makes the logic for the internal path look similar to the logic with linking with an external shared library.

Modules/Setup
History
Date User Action Args
2021-11-13 09:15:19christian.heimessetrecipients: + christian.heimes, mark.dickinson, pitrou
2021-11-13 09:15:19christian.heimessetmessageid: <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org>
2021-11-13 09:15:19christian.heimeslinkissue45798 messages
2021-11-13 09:15:18christian.heimescreate