<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78883>78883</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Can't build openmp project with python 3.12
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
liam-clink
</td>
</tr>
</table>
<pre>
The build works with Python 3.10, only thing changed to reproduce was using 3.12
```
Linking C shared module projects/openmp/libompd/gdb-plugin/python-module/ompd/ompdModule.so
FAILED: projects/openmp/libompd/gdb-plugin/python-module/ompd/ompdModule.so
: && /usr/bin/cc -fPIC -fPIC -fno-semantic-interposition -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wcast-qual -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -Wno-maybe-uninitialized -O3 -DNDEBUG -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics -shared -o projects/openmp/libompd/gdb-plugin/python-module/ompd/ompdModule.so projects/openmp/libompd/gdb-plugin/CMakeFiles/ompdModule.dir/ompdModule.c.o projects/openmp/libompd/gdb-plugin/CMakeFiles/ompdModule.dir/ompdAPITests.c.o /usr/local/lib/libpython3.12.a -ldl && :
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c.h:40 (./Modules/clinic/_localemodule.c.h:40)
>>> _localemodule.o:(_locale_setlocale) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:50 (./Modules/clinic/_localemodule.c.h:50)
>>> _localemodule.o:(_locale_setlocale.cold) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_RuntimeWarning'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c:172 (./Modules/_localemodule.c:172)
>>> _localemodule.o:(_locale_localeconv) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:478 (./Modules/clinic/_localemodule.c.h:478)
>>> _localemodule.o:(_locale_bindtextdomain) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c:730 (./Modules/_localemodule.c:730)
>>> _localemodule.o:(_locale_bindtextdomain) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_OSError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c:740 (./Modules/_localemodule.c:740)
>>> _localemodule.o:(_locale_bindtextdomain) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c.h:354 (./Modules/clinic/_localemodule.c.h:354)
>>> _localemodule.o:(_locale_dcgettext) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:382 (./Modules/clinic/_localemodule.c.h:382)
>>> _localemodule.o:(_locale_dcgettext) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c.h:289 (./Modules/clinic/_localemodule.c.h:289)
>>> _localemodule.o:(_locale_dgettext) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:299 (./Modules/clinic/_localemodule.c.h:299)
>>> _localemodule.o:(_locale_dgettext) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:317 (./Modules/clinic/_localemodule.c.h:317)
>>> _localemodule.o:(_locale_dgettext) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c.h:528 (./Modules/clinic/_localemodule.c.h:528)
>>> _localemodule.o:(_locale_bind_textdomain_codeset) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:538 (./Modules/clinic/_localemodule.c.h:538)
>>> _localemodule.o:(_locale_bind_textdomain_codeset) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c:770 (./Modules/_localemodule.c:770)
>>> _localemodule.o:(_locale_bind_textdomain_codeset) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol '_Py_NoneStruct'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(object.o)
>>> referenced by _localemodule.c.h:417 (./Modules/clinic/_localemodule.c.h:417)
>>> _localemodule.o:(_locale_textdomain) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:427 (./Modules/clinic/_localemodule.c.h:427)
>>> _localemodule.o:(_locale_textdomain) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_OSError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c:701 (./Modules/_localemodule.c:701)
>>> _localemodule.o:(_locale_textdomain) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c.h:252 (./Modules/clinic/_localemodule.c.h:252)
>>> _localemodule.o:(_locale_gettext) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c:623 (./Modules/_localemodule.c:623)
>>> _localemodule.o:(_locale_nl_langinfo) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'PyExc_ValueError'; recompile with -fPIC
>>> defined in /usr/local/lib/libpython3.12.a(exceptions.o)
>>> referenced by _localemodule.c:405 (./Modules/_localemodule.c:405)
>>> _localemodule.o:(_locale_strxfrm) in archive /usr/local/lib/libpython3.12.a
ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
collect2: error: ld returned 1 exit status
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmt9vo7gTwP8a58VyBAYCechDNmm-Wml_VLv7vdxbZOwJ8dXYnG3aZv_6kyHttnu5U6m6uqSqFEGBYeyZz8zYpmbOyUoDzFD2DmXLEWv9ztiZkqwmXEl9NSqN2M--7QCXrVQC3xh75fCN9Dt8ufc7o3EyjiNEF9hotcd-J3WF-Y7pCgT2BltorBEtB3zDHG5deJyMY4qiJYrmh-MkOvy6yw9SXwWxBXY7ZkHg2ohWAW6s-QO4d4iuTAO6bhBdKVmauhGIripRkka1ldSIrpqua6R_Mcj3MuH0sbs3dqZvbDV__-FiiZL5S6vHB9uSOUZ0gugEI7pqnUV0VXZKOMdke_l-cX_UhjiomfaSE6k92MY46aXRmKzBWmNRshTMA_Gyhl5eyS2EKyIcYLJmSgXZW28ZJmttSKtbB4I0zLIaPFhM1jdWeiDOW6krh8maM-fJny1T_Ru1dIER2UpQgkgtvWRKfgfrMGlAdL3rJZXRVXfAZC3rRkkuPdkypfzOmrba9VLc1DVoj8lWSFZp47zkjnCjjMVku201DxYSB93ZBTnm2YPrg1EPu_kPrYVIDu01zELf-ANPPO57zfYlkFb_sE9g8jnBZPlpefHu___DZK0QXZDviC60EaDAB4-3DogSKFkqJe5EelvIA-swOcQtJubFo2qAvsVHdgUrqcA91iKkfXyDj19Y7_zy_Tdw3nWa78NeGc5Ur7Y_9gaHajBmGBMl1H2qJIfSoMRYBY_P8SED5thCUNTlxZfN78VkM0k3l4uEYs60Nh6XgEPQY1YxqZ3Hbl-XJmjON5f7zSej4au3LfeI5ih5hy2EkJEK-qLWJeNd6l70PyxgKzUILPUTrUG0MGXw59ggOv1ZnYUtWNAcBC73eNNpgvqOxQ4l8zTCiBZjRFe9b4OnQzmWHNHV8ReOtPNY0ASn0uJwc-PA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