Hello,
while going through the patches for the openSUSE Python interpreter, I have hit on this gem python-3.3.0b1-fix_date_time_compiler.patch:
---
Makefile.pre.in | 5 +++++
1 file changed, 5 insertions(+)
Index: Python-3.14.0b1/Makefile.pre.in
===================================================================
--- Python-3.14.0b1.orig/Makefile.pre.in 2025-05-12 10:57:03.566724942 +0000
+++ Python-3.14.0b1/Makefile.pre.in 2025-05-12 10:57:41.504010702 +0000
@@ -1874,6 +1874,11 @@
-DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
-o $@ $(srcdir)/Modules/getbuildinfo.c
+Python/getcompiler.o: $(srcdir)/Python/getcompiler.c Makefile
+ $(CC) -c $(PY_CORE_CFLAGS) \
+ -DCOMPILER='"[GCC]"' \
+ -o $@ $(srcdir)/Python/getcompiler.c
+
Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS)
$(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
-DPREFIX='"$(host_prefix)"' \
The point of the patch is to avoid defining COMPILER
symbol as versioned (what happens with the current getcompiler.c
), because we want to be able to produce identical binary for various reasons with even slightly different versions of GCC compiler.
Would it be possible to add a capability of having such non-versioned COMPILER
to the upstream code? Even if it just was a bit environmental variable in the style of SOURCE_DATE_EPOCH
. For example, UNVERSIONED_COMPILER
with value for example GCC
.
What do you think? Should I prepare patch on getcompiler.c
with such variant?