Message406271
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 |
|
Date |
User |
Action |
Args |
2021-11-13 09:15:19 | christian.heimes | set | recipients:
+ christian.heimes, mark.dickinson, pitrou |
2021-11-13 09:15:19 | christian.heimes | set | messageid: <1636794919.07.0.823304462548.issue45798@roundup.psfhosted.org> |
2021-11-13 09:15:19 | christian.heimes | link | issue45798 messages |
2021-11-13 09:15:18 | christian.heimes | create | |
|