Skip to content

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Oct 23, 2025

@savannahostrowski
Copy link
Member Author

savannahostrowski commented Oct 23, 2025

Would be good to get a Makefile expert's eyes on this 🙏

The results of my spelunking efforts: #140454 (comment)

@savannahostrowski savannahostrowski changed the title GH-140454: Remove pyconfig.h from JIT_DEPS GH-140454: Remove pyconfig.h from Makefile JIT_DEPS Oct 23, 2025
@hroncok
Copy link
Contributor

hroncok commented Oct 23, 2025

Thanks. I tested this, and it does not seem to solve the problem for me.

[cpython (test-jit-make-install)]$ export LDFLAGS=' '
[cpython (test-jit-make-install)]$ export LDFLAGS_NODIST='-Wl,--as-needed -g '
[cpython (test-jit-make-install)]$ git clean -fdx; ./configure --config-cache --without-ensurepip --enable-experimental-jit=yes-off && make -j...

Different shell:

[cpython (test-jit-make-install)]$ export LDFLAGS='-Wl,--as-needed -g '
[cpython (test-jit-make-install)]$ cp -a build/lib.linux-x86_64-3.15/_sysconfigdata__linux_x86_64-linux-gnu.py make._sysconfigdata__linux_x86_64-linux-gnu.py 
[cpython (test-jit-make-install %)]$ rm /tmp/python/ -rf; make install DESTDIR=/tmp/python 
[cpython (test-jit-make-install %)]$ diff -u make._sysconfigdata__linux_x86_64-linux-gnu.py build/lib.linux-x86_64-3.15/_sysconfigdata__linux_x86_64-linux-gnu.py
--- make._sysconfigdata__linux_x86_64-linux-gnu.py	2025-10-23 11:25:44.805777209 +0200
+++ build/lib.linux-x86_64-3.15/_sysconfigdata__linux_x86_64-linux-gnu.py	2025-10-23 11:25:59.599337788 +0200
@@ -19,7 +19,7 @@
     'BINDIR': '/usr/local/bin',
     'BINLIBDEST': '/usr/local/lib/python3.15',
     'BLDLIBRARY': 'libpython3.15.a',
-    'BLDSHARED': 'gcc -shared',
+    'BLDSHARED': 'gcc -shared -Wl,--as-needed -g',
     'BOOTSTRAP_HEADERS': '\\',
     'BUILDEXE': '',
     'BUILDPYTHON': 'python',
@@ -647,11 +647,12 @@
     'IO_OBJS': '\\',
     'IPHONEOS_DEPLOYMENT_TARGET': '',
     'JIT_DEPS': '\\',
-    'LDCXXSHARED': 'g++ -shared',
-    'LDFLAGS': '',
+    'LDCXXSHARED': 'g++ -shared -Wl,--as-needed -g',
+    'LDFLAGS': '-Wl,--as-needed -g',
+    'LDFLAGS_NODIST': '',
     'LDLIBRARY': 'libpython3.15.a',
     'LDLIBRARYDIR': '',
-    'LDSHARED': 'gcc -shared',
+    'LDSHARED': 'gcc -shared -Wl,--as-needed -g',
     'LDVERSION': '3.15',
     'LIBC': '',
     'LIBDEST': '/usr/local/lib/python3.15',
@@ -987,8 +988,8 @@
     'PY_CPPFLAGS': '-I. -I./Include',
     'PY_ENABLE_SHARED': 0,
     'PY_HAVE_PERF_TRAMPOLINE': 1,
-    'PY_LDFLAGS': '',
-    'PY_LDFLAGS_NODIST': '-Wl,--as-needed -g -Wl,--as-needed -g',
+    'PY_LDFLAGS': '-Wl,--as-needed -g',
+    'PY_LDFLAGS_NODIST': '-Wl,--as-needed -g',
     'PY_LDFLAGS_NOLTO': '-Wl,--as-needed -g',
     'PY_SQLITE_ENABLE_LOAD_EXTENSION': 0,
     'PY_SQLITE_HAVE_SERIALIZE': 0,

@savannahostrowski
Copy link
Member Author

Wow, okay. I cannot reproduce this either locally or in a Fedora Devcontainer with the steps you've outlined above. I'll close this PR for now, and we can take the discussion back into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants