Jason Lowe-Power has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/28687 )

Change subject: scons: Update python-config flags for python3.8
......................................................................

scons: Update python-config flags for python3.8

Starting in python 3.8 the python3-config utility requires the --embed
flag to output -lpython3.8. Without this flag, gem5 won't link to the
python library.

More details: https://bugs.python.org/issue36721
https://github.com/python/cpython/pull/13500

Change-Id: Id9c63577dcd2defa7ae62cc32e042c4a245e7082
Signed-off-by: Jason Lowe-Power <ja...@lowepower.com>
---
M SConstruct
1 file changed, 8 insertions(+), 2 deletions(-)



diff --git a/SConstruct b/SConstruct
index ba4affa..31b3503 100755
--- a/SConstruct
+++ b/SConstruct
@@ -683,8 +683,14 @@

     # Read the linker flags and split them into libraries and other link
     # flags. The libraries are added later through the call the CheckLib.
-    py_ld_flags = readCommand([python_config, '--ldflags'],
-        exception='').split()
+    # Note: starting in Python 3.8 the --embed flag is required to get the
+    # -lpython3.8 linker flag
+    py_ld_flags = readCommand([python_config, '--ldflags', '--embed'],
+                              exception='').split()
+    if py_ld_flags[0] == "Usage:":
+        # If --embed isn't detected then we're running python <3.8
+        py_ld_flags = readCommand([python_config, '--ldflags'],
+                                  exception='').split()
     py_libs = []
     for lib in py_ld_flags:
          if not lib.startswith('-l'):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/28687
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v20.0.0.0
Gerrit-Change-Id: Id9c63577dcd2defa7ae62cc32e042c4a245e7082
Gerrit-Change-Number: 28687
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power <power...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to