Closed cristianadam closed 3 years ago
So, if you had a working build using autotools, and but it's failing due to wanting to link python as a DLL, didn't you get a dll and
libpyhon*.dll.a
when you built it? If not, can you try adding--enable-shared
when building python?
No, sorry, the successful build was a cmake build of 3.6.7. It only built the static library (I have never had the autotools work). When I turned on the shared build and added the extensions, everything fell apart again and I was trying to patch source code.
osboxes@osboxes ~/python-cmake-install> ls
bin/ include/ Lib/ libs/ share/
osboxes@osboxes ~/python-cmake-install> find . -type f -iname "*dll*"
osboxes@osboxes ~/python-cmake-install> find . -type f -iname "*.a"
./libs/libpython36.a
./Lib/config/libpython36.a
osboxes@osboxes ~/python-cmake-install>
After my initial difficulty, I decided to look a little a little harder at the MSYS2 patches - great suggestion @longnguyen2004 - and was able to patch 3.8.7 successfully with the following script:
#!/bin/bash
PATCH_DIR=~/git/MINGW-packages
SRC_DIR=~/Python-3.8.7/
BIGPATCHFILE=/tmp/big.patch
cat $PATCH_DIR/mingw-w64-python/* > $BIGPATCHFILE
cd $SRC_DIR
patch -p1 < $BIGPATCHFILE
osboxes@osboxes ~/Python-3.8.7> ../patch-python.sh
patching file Lib/sysconfig.py
patching file Lib/distutils/spawn.py
patching file setup.py
patching file configure.ac
Hunk #1 succeeded at 5651 (offset 27 lines).
Hunk #2 succeeded at 5663 (offset 27 lines).
patching file Makefile.pre.in
Hunk #3 succeeded at 1795 (offset 3 lines).
patching file Modules/Setup.config.in
patching file configure.ac
Hunk #1 succeeded at 1973 (offset 13 lines).
Hunk #2 succeeded at 2131 (offset 13 lines).
Hunk #3 succeeded at 2153 (offset 13 lines).
Hunk #4 succeeded at 2189 (offset 13 lines).
Hunk #5 succeeded at 2204 (offset 13 lines).
Hunk #6 succeeded at 2409 (offset 13 lines).
Hunk #7 succeeded at 2443 (offset 13 lines).
Hunk #8 succeeded at 2886 (offset 13 lines).
Hunk #9 succeeded at 3179 (offset 28 lines).
Hunk #10 succeeded at 3635 (offset 28 lines).
Hunk #11 succeeded at 4568 (offset 28 lines).
Hunk #12 succeeded at 4605 (offset 28 lines).
patching file Modules/_multiprocessing/multiprocessing.h
patching file pyconfig.h.in
patching file Include/pyport.h
patching file configure.ac
patching file Python/getplatform.c
patching file configure.ac
Hunk #1 succeeded at 899 (offset 6 lines).
patching file Misc/config_mingw
patching file Misc/cross_mingw32
patching file configure.ac
Hunk #1 succeeded at 2420 (offset 13 lines).
patching file configure.ac
Hunk #1 succeeded at 5474 (offset 24 lines).
patching file configure.ac
Hunk #1 succeeded at 580 (offset 6 lines).
patching file Modules/posixmodule.c
patching file Modules/Setup
patching file Modules/Setup.config.in
patching file configure.ac
Hunk #1 succeeded at 3209 (offset 28 lines).
patching file Modules/Setup.config.in
patching file PC/winreg.c
patching file configure.ac
Hunk #1 succeeded at 3216 (offset 28 lines).
patching file Modules/Setup
patching file Modules/Setup.config.in
patching file Lib/distutils/sysconfig.py
patching file Lib/distutils/unixccompiler.py
patching file Include/pyport.h
patching file setup.py
patching file configure.ac
Hunk #1 succeeded at 1210 (offset 6 lines).
Hunk #2 succeeded at 1225 (offset 6 lines).
Hunk #3 succeeded at 2784 (offset 13 lines).
Hunk #4 succeeded at 5519 (offset 24 lines).
patching file configure.ac
Hunk #1 succeeded at 2648 (offset 13 lines).
Hunk #2 succeeded at 3708 (offset 28 lines).
Hunk #3 succeeded at 5508 with fuzz 2 (offset 662 lines).
patching file Makefile.pre.in
patching file Python/dynload_win.c
Hunk #2 succeeded at 207 (offset -2 lines).
patching file configure.ac
Hunk #1 succeeded at 5539 (offset 24 lines).
patching file Makefile.pre.in
patching file setup.py
patching file Modules/selectmodule.c
patching file setup.py
patching file setup.py
patching file configure.ac
Hunk #1 succeeded at 4319 (offset 28 lines).
Hunk #2 succeeded at 5444 (offset 18 lines).
patching file Misc/config_mingw
patching file Modules/socketmodule.c
patching file pyconfig.h.in
Hunk #3 succeeded at 1651 (offset 4 lines).
patching file setup.py
patching file setup.py
patching file Modules/_winapi.c
patching file PC/msvcrtmodule.c
patching file Python/dynamic_annotations.c
patching file setup.py
Hunk #1 succeeded at 1507 (offset -33 lines).
patching file Lib/distutils/command/build_ext.py
Hunk #2 succeeded at 711 (offset 8 lines).
patching file Lib/distutils/util.py
patching file Lib/sysconfig.py
Hunk #1 succeeded at 644 (offset 1 line).
patching file Lib/distutils/ccompiler.py
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/cygwinccompiler.py
patching file setup.py
Hunk #1 succeeded at 2260 (offset 3 lines).
patching file Lib/sysconfig.py
Hunk #4 succeeded at 497 (offset 1 line).
Hunk #5 succeeded at 568 (offset 1 line).
Hunk #6 succeeded at 583 (offset 1 line).
patching file Modules/_ctypes/_ctypes.c
Hunk #1 succeeded at 3406 (offset 64 lines).
patching file setup.py
Hunk #1 succeeded at 2437 (offset 3 lines).
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/sysconfig.py
patching file Lib/site.py
patching file Misc/python-config.sh.in
patching file configure.ac
Hunk #5 succeeded at 1649 (offset 6 lines).
Hunk #6 succeeded at 2020 (offset 6 lines).
Hunk #7 succeeded at 2583 (offset 13 lines).
Hunk #8 succeeded at 2608 (offset 13 lines).
Hunk #9 succeeded at 2620 (offset 13 lines).
patching file Include/internal/pycore_condvar.h
patching file Include/pythread.h
patching file setup.py
Hunk #1 succeeded at 2033 (offset 3 lines).
patching file Include/pylifecycle.h
patching file Lib/ntpath.py
Hunk #5 succeeded at 101 (offset 8 lines).
Hunk #6 succeeded at 162 (offset 8 lines).
Hunk #7 succeeded at 218 (offset 8 lines).
Hunk #8 succeeded at 465 (offset 8 lines).
Hunk #9 succeeded at 681 (offset 48 lines).
Hunk #10 succeeded at 692 (offset 33 lines).
Hunk #11 succeeded at 751 (offset 33 lines).
patching file Modules/posixmodule.c
Hunk #1 succeeded at 3476 (offset 38 lines).
Hunk #2 succeeded at 3931 (offset 44 lines).
Hunk #3 succeeded at 4008 (offset 44 lines).
patching file Python/initconfig.c
Hunk #1 succeeded at 130 (offset 32 lines).
Hunk #2 succeeded at 1172 (offset 43 lines).
patching file Python/pathconfig.c
Hunk #1 succeeded at 13 with fuzz 1.
Hunk #2 succeeded at 622 (offset -46 lines).
patching file Python/traceback.c
patching file Include/pylifecycle.h
patching file Modules/getpath.c
patching file Modules/posixmodule.c
Hunk #1 succeeded at 3735 (offset 44 lines).
patching file Python/dynload_win.c
patching file Modules/getpath.c
patching file Modules/Setup.config.in
patching file configure.ac
Hunk #1 succeeded at 604 (offset 6 lines).
patching file Lib/sysconfig.py
patching file Makefile.pre.in
patching file Lib/distutils/command/build_ext.py
patching file Lib/sysconfig.py
Hunk #2 succeeded at 462 with fuzz 2 (offset 1 line).
patching file Lib/distutils/cygwinccompiler.py
patching file Modules/Setup.config.in
patching file setup.py
Hunk #1 succeeded at 1515 (offset -30 lines).
patching file Include/pyport.h
patching file setup.py
patching file Lib/compileall.py
patching file Lib/distutils/command/install.py
patching file Lib/distutils/util.py
patching file Makefile.pre.in
patching file setup.py
Hunk #3 succeeded at 1912 (offset 3 lines).
Hunk #4 succeeded at 1995 (offset 3 lines).
patching file Include/py_curses.h
patching file Python/graminit.c
patching file Modules/parsermodule.c
patching file Makefile.pre.in
Hunk #2 succeeded at 1784 (offset 3 lines).
patching file Programs/_freeze_importlib.c
patching file setup.py
patching file setup.py
Hunk #5 succeeded at 1872 (offset 3 lines).
patching file Lib/distutils/command/install.py
patching file Include/osdefs.h
patching file configure.ac
Hunk #1 succeeded at 3084 (offset 13 lines).
patching file Modules/_localemodule.c
patching file Lib/ctypes/__init__.py
Hunk #1 succeeded at 453 (offset 4 lines).
patching file Modules/_gdbmmodule.c
patching file Include/bytesobject.h
patching file Include/pyerrors.h
patching file Include/sysmodule.h
patching file Lib/ssl.py
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/cygwinccompiler.py
patching file Python/sysmodule.c
Hunk #2 succeeded at 2743 (offset 49 lines).
patching file Lib/distutils/command/build_ext.py
patching file Python/getcompiler.c
patching file configure.ac
Hunk #1 succeeded at 5692 (offset 24 lines).
patching file Makefile.pre.in
patching file configure.ac
Hunk #1 succeeded at 5311 (offset 18 lines).
patching file Modules/Setup
patching file Modules/Setup
patching file Modules/_multiprocessing/multiprocessing.c
patching file Include/iscygpty.h
patching file Makefile.pre.in
patching file Modules/_io/fileio.c
Hunk #1 succeeded at 19 (offset 1 line).
Hunk #2 succeeded at 1126 (offset 6 lines).
patching file Modules/main.c
patching file Modules/posixmodule.c
Hunk #2 succeeded at 9418 (offset 159 lines).
patching file Python/frozenmain.c
patching file Python/iscygpty.c
patching file Python/pylifecycle.c
Hunk #2 succeeded at 2327 (offset -23 lines).
patching file Python/bltinmodule.c
patching file Objects/fileobject.c
patching file Python/fileutils.c
patching file setup.py
Hunk #1 succeeded at 1311 (offset -20 lines).
patching file Makefile.pre.in
patching file setup.py
Hunk #1 succeeded at 2164 (offset -1 lines).
patching file setup.py
patching file Include/fileobject.h
Hunk #1 succeeded at 30 with fuzz 1 (offset 7 lines).
patching file Modules/getpath.c
patching file Modules/_xxsubinterpretersmodule.c
Hunk #1 succeeded at 1751 (offset 2 lines).
patching file configure.ac
Hunk #1 succeeded at 4138 (offset 28 lines).
patching file Lib/distutils/msvc9compiler.py
patching file Lib/venv/scripts/common/activate
patching file Lib/venv/__init__.py
Hunk #3 succeeded at 244 (offset -1 lines).
Hunk #5 succeeded at 291 (offset -1 lines).
patching file Makefile.pre.in
patching file Lib/distutils/cygwinccompiler.py
patching file configure.ac
Hunk #1 succeeded at 5007 (offset 17 lines).
patching file Misc/python.pc.in
patching file Lib/importlib/_bootstrap_external.py
patching file Lib/pathlib.py
patching file Modules/_localemodule.c
patching file Python/fileutils.c
Hunk #1 succeeded at 1976 (offset 1 line).
patching file setup.py
Hunk #1 succeeded at 892 with fuzz 1.
patching file Modules/_winapi.c
patching file Modules/posixmodule.c
Hunk #1 succeeded at 4869 (offset 65 lines).
Hunk #2 succeeded at 12413 (offset 188 lines).
Hunk #3 succeeded at 13683 (offset 192 lines).
Hunk #4 succeeded at 13733 (offset 192 lines).
patching file Modules/socketmodule.h
patching file PC/python_exe.rc
patching file PC/pythonw_exe.rc
patching file PC/winreg.c
Hunk #1 succeeded at 803 (offset 3 lines).
patching file Python/thread_nt.h
But autotools still says no (computer says no):
osboxes@osboxes ~/Python-3.8.7 [1]> ./configure --host=x86_64-w64-mingw32 --build=x86_64-pc-linux
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-w64-mingw32
checking for python3.8... python3.8
checking for python interpreter for cross build... python3.8
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... configure: error: cross build not supported for x86_64-w64-mingw32
If someone can suggest how to get around autotools refusing to cross build then I think we're in good shape? I don't know anything about autotools (on purpose).
Otherwise I can massage the MSYS2 patches into the CMake build and take a shot at building 3.8.7 with cmake? The existing cmake already has a patching mechanism. I don't mind working with the cmake, I just don't like inventing patches to the python code that I will never be testing. I think the MSYS2 patches are a WAY better idea than the wonky patches that I was working with. They were cluegy.
I need to go make lunches... Night!
No, sorry, the successful build was a cmake build of 3.6.7. It only built the static library (I have never had the autotools work). When I turned on the shared build and added the extensions, everything fell apart again and I was trying to patch source code.
Ok, I see, that probably explains it.
So in that case, I'd suggest you hack out the define of Py_ENABLE_SHARED
from your pyconfig.h, and/or define Py_NO_ENABLE_SHARED
when building LLDB - that might work, kinda. Not nice of course.
So if you have that successful build, you could try just defining Py_NO_ENABLE_SHARED
But autotools still says no (computer says no):
osboxes@osboxes ~/Python-3.8.7 [1]> ./configure --host=x86_64-w64-mingw32 --build=x86_64-pc-linux checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-w64-mingw32 checking for python3.8... python3.8 checking for python interpreter for cross build... python3.8 checking for --enable-universalsdk... no checking for --with-universal-archs... no checking MACHDEP... configure: error: cross build not supported for x86_64-w64-mingw32
If someone can suggest how to get around autotools refusing to cross build then I think we're in good shape? I don't know anything about autotools (on purpose).
Looks like they explicitly only support cross compilation in a few setups they do care about: https://github.com/python/cpython/blob/master/configure.ac#L380-L401
I guess it could be possible to just add a pattern for mingw triples there (and either regenerate configure, or manually patch in the same there in the generated file), but dunno if one has to do a lot of similar patching in other places then, too.
Otherwise I can massage the MSYS2 patches into the CMake build and take a shot at building 3.8.7 with cmake?
@RussellHaley Sadly the Python source tree has changed greatly since 3.6.7. Many files are moved around, created and deleted. pgen
, which used to be a C program, is now a Python program, so the pgen
target needs to be removed/modified. This is non-trivial imo.
I'm gonna poke around at the Python source now, I also wanna add support for mingw in vcpkg.
Well this has ended bitterly. I'm back patching python source files.
1) I followed the autotools route. I just patched configure
to let mingw through.
2) configure
then errored when searching for readelf
. It found a native readelf
, gave a warning and then quit with an error. The error message was unintelligible so I just hacked the "readelf error" out of the configure file (HACK).
3) configure
gave some weird message: "configure: error: set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling". I found the solution buried in yet another mingw patch that was never accepted. (seriously?) https://bugs.python.org/issue3754. The solution was to create a config.site file.
osboxes@osboxes ~/Python-3.8.7 [2]> cat config.site
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
osboxes@osboxes ~/Python-3.8.7 [2]> CONFIG_SITE=config.site ./configure --host=x86_64-w64-mingw32 --build=x86_64-pc-linux
I think there were other errors but I don't remember... Oh ya, it wouldn't build a Setup.config file or something.
4) It finally started to build but was missing a basic header file. So I added the "PC" directory to my make call:
osboxes@osboxes ~/Python-3.8.7> make "CFLAGS=-I./PC"
5) Then things started to really fall apart. There are a whole bunch of calls to _MSC_VER that muck up the defines....
At this point I am literally right back where I was with the original Python-3.6.7 cmake... before I started patching! I recognize the CMake structures that were put in place to deal with these errors that I'm seeing. For instance, the cmake has logic to include a custom mingw header file instead of the files in the PC folder. The cmake build already has a a python.h file that has _MSC_VER removed.
SO... ?
Here are some possible routes: 1) I will contact the lilypond team and see if they have something. They had offered mingw patches as I mentioned before. Maybe they have a complete functioning build? 2) I never looked at the patches from MSYS2. Perhaps I did something wrong or there are some other clues that reading the content a little closer might reveal. There may be a build script somewhere in the MSYS2 repository. 3) I have a candidate libpython36.a file we could try using. I will go back and review Martins suggestions and see if I can make that build work. However, it likely won't have the extensions built in and won't work with KDevelop. 4) I could attempt to put the patched 3.8.7 files into the cmake build. 5) We can continue patching with the autotools build. I just don't know. I think the pyconfig.h
Regardless of the route we finally pick we have another concern: we will not be able to trust the python binaries because we don't really know how well they work. We aren't just doing a little tinkering with a couple of lines of patches. This is serious manipulation of the source code with unknown side effects.
What we do know is the hocus pocus to get lldb to at least start a build that includes python. I think it would be wise to pull working DLLs or whatever out of a python installation and build lldb and lldb-mi with those. Obviously our final solution should build from source, but someone could test lldb/python in parallel to shorten our development time? It would also give us a golden image we could compare against, and allow us to work out any kinks. Who knows, maybe 3.8.7 won't work?
Okay, lunches...
@RussellHaley Have you run autoreconf -fi
to regenerate the configure script? Cross-compiling is working for me, aside from missing readelf
. We can use binutils readelf
in the meantime (install binutils-mingw-w64-x86-64
)
(gcc
symlinked to clang
, c++
symlinked to clang++
)
You'll have to remove PC/pyconfig.h
, or else the compiler will use the wrong config header.
@mstorsjo llvm-readelf
for the host is required to build Python, can we build it? For now I'm gonna use binutils readelf
There may be a build script somewhere in the MSYS2 repository.
Take a look at the PKGBUILD
file, that's the build script
but someone could test lldb/python in parallel to shorten our development time
The prebuilt LLVM for Windows includes LLDB compiled with Python, we can use that.
@mstorsjo
llvm-readelf
for the host is required to build Python, can we build it? For now I'm gonna use binutilsreadelf
Sure, it should be trivial to add, should be enough to add it to the existing list of tools to install in build-llvm.sh and the list of tools to keep in strip-llvm.sh. For existing installs, just add a symlink to llvm-readobj - they're the same tool, but taking different options depending on the tool name.
Where is it needed - is
It sounds a bit odd to use an -elf tool for coff
Maybe because binutils doesn't have a generic readobj
like LLVM, so the mingw-w64 folks hacked up readelf
to accept COFF. This is just my speculation, but that's probably the case.
It sounds a bit odd to use an -elf tool for coff
Maybe because binutils doesn't have a generic
readobj
like LLVM, so the mingw-w64 folks hacked upreadelf
to accept COFF. This is just my speculation, but that's probably the case.
Ok, but it's used like
Yeah I figured it would be used like -readelf
Also @RussellHaley I successfully cross-compiled the Python core from WSL, using the MSYS2 patches. I can guide you through the procedure.
I contacted the lilypond team and they gave up trying to cross compile. They are taking a binary from the python project and embedding that in their application. From the response email:
If you succeed in cross-compiling Python 3 for mingw, please let me /
us know, that could be interesting for the future.
@RussellHaley Currently building the extensions fails, because distutils
assumes we're using GCC and ld. I just patched get_versions
to return a fixed version for the time being.
As for the Python core, it builds successfully without any errors. This is what i did.
Clone cpython
git clone --depth 1 https://github.com/python/cpython -b v3.8.7
Get the patches from MSYS2
git init python-patches
cd python-patches
git remote add origin https://github.com/msys2/MINGW-packages
git sparse-checkout init --cone
git sparse-checkout set mingw-w64-python # we only need mingw-w64-python
git pull origin master # TODO: Change this to a specific commit
cd ..
Patch cpython
cd cpython
cat ../python-patches/mingw-w64-python/*.patch | patch -p1
autoreconf -fi # IMPORTANT! This regenerates the configure script
cd ..
configure
and make
cd cpython
rm -f PC/pyconfig.h # We use pyconfig.h from autotools
mkdir build && cd build
export ac_cv_working_tzset=no export ac_cv_header_dlfcn_h=no export ac_cv_lib_dl_dlopen=no export ac_cv_have_decl_RTLD_GLOBAL=no export ac_cv_have_decl_RTLD_LAZY=no export ac_cv_have_decl_RTLD_LOCAL=no export ac_cv_have_decl_RTLD_NOW=no export ac_cv_have_decl_RTLD_DEEPBIND=no export ac_cv_have_decl_RTLD_MEMBER=no export ac_cv_have_decl_RTLD_NODELETE=no export ac_cv_have_decl_RTLD_NOLOAD=no
export CC=x86_64-w64-mingw32-clang export CXX=x86_64-w64-mingw32-clang++ ../configure \ CFLAGS=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601 -DNDEBUG -I../PC -Wno-ignored-attributes" \ CXXFLAGS=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601 -DNDEBUG -I../PC -Wno-ignored-attributes" \ --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 \ --enable-shared --with-nt-threads --without-ensurepip --without-c-locale-coercion
make -j4
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _hashlib
_lzma _sqlite3 _ssl
_tkinter _uuid nis
ossaudiodev readline spwd
zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit time
Failed to build these modules:
_crypt _ctypes _ctypes_test
_multiprocessing _posixsubprocess _socket
_testinternalcapi fcntl grp
mmap pwd resource
select syslog termios
@mstorsjo @RussellHaley @cristianadam Are there any modules in this list that are required by LLDB/Qt Creator/KDevelop?
Thanks @longnguyen2004, @mstorsjo. I appreciate having such patient teachers. :-)
I'm just a high school student, but you get the point :)
Most of the failed modules are Unix modules, so they're not that important. However, _ctypes
, _multiprocessing
and _testinternalcapi
require a closer look.
Some other compiler flags that might be useful:
-Wno-ignored-attributes
: Suppress error about gnu_printf
@RussellHaley If you can add support for clang in distutils
, I'd really appreciate it :)
After some more patching, I managed to get most of the modules built, except for _ctypes
Additional patch to setup.py
:
--- cpython-msys2/setup.py 2021-01-24 12:00:01.170000000 +0700
+++ cpython/setup.py 2021-01-24 10:50:57.710000000 +0700
@@ -51,7 +51,7 @@
CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ)
HOST_PLATFORM = get_platform()
-MS_WINDOWS = (HOST_PLATFORM == 'win32')
+MS_WINDOWS = (HOST_PLATFORM == 'win32' or HOST_PLATFORM == 'mingw')
CYGWIN = (HOST_PLATFORM == 'cygwin')
MACOS = (HOST_PLATFORM == 'darwin')
AIX = (HOST_PLATFORM.startswith('aix'))
Patch to Lib/distutils/cygwinccompiler.py
:
--- cpython-msys2/Lib/distutils/cygwinccompiler.py 2021-01-24 12:00:01.150000000 +0700
+++ cpython/Lib/distutils/cygwinccompiler.py 2021-01-24 10:26:35.300000000 +0700
@@ -426,6 +426,8 @@
If not possible it returns None for it.
"""
gcc = os.environ.get('CC') or 'gcc'
+ if ('clang' in gcc):
+ return ('10.0.0', '3.0.0', '10.0.0') # Return a generic version string
ld = 'ld'
out = Popen(gcc+' --print-prog-name ld', shell=True, stdout=PIPE).stdout
try:
@@ -439,5 +441,6 @@
def is_cygwingcc():
'''Try to determine if the gcc that would be used is from cygwin.'''
- out_string = check_output(['gcc', '-dumpmachine'])
+ gcc = os.environ.get('CC') or 'gcc'
+ out_string = check_output([gcc, '-dumpmachine'])
return out_string.strip().endswith(b'cygwin')
After those patches, the Python build succeed with this message
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _crypt _curses
_curses_panel _dbm _gdbm
_hashlib _lzma _posixsubprocess
_sqlite3 _ssl _tkinter
_uuid fcntl grp
nis ossaudiodev pwd
readline resource spwd
syslog termios zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc atexit msvcrt
time
Failed to build these modules:
_ctypes
I'm just a high school student, but you get the point :)
Yes, I know how old you are you little whipper-snapper! I was trying to accept being whipped by a Vietnamese high school student as graciously as possible.
Most of the failed modules are Unix modules, so they're not that important. However,
_ctypes
,_multiprocessing
and_testinternalcapi
require a closer look.Some other compiler flags that might be useful:
-Wno-ignored-attributes
: Suppress error aboutgnu_printf
@RussellHaley If you can add support for clang in
distutils
, I'd really appreciate it :)
I'm not really sure what that means? Let me get lldb + python +lldm-mi put together with all the patches (I may have additional patches as well). You can school me again later on distutils. Darn kids these days... :-P
cd cpython patch -p1 < ../python-patches/mingw-w64-python/*.patch
osboxes@osboxes:~/Python-3.8.7$ patch -p1 < ../git/MINGW-packages/mingw-w64-python/*.patch
bash: ../git/MINGW-packages/mingw-w64-python/*.patch: ambiguous redirect
This is why I had to use a "bigpatchfile". What am I doing wrong?
Patch to Lib/distutils/cygwinccompiler.py:
@longnguyen2004: Ah, yes, of course. I will also add/patch clang.
What am I doing wrong?
Probably because I'm using zsh
, which is a bit smarter than bash
:)
Patch to Lib/distutils/cygwinccompiler.py:
This is a patch to distutils
, to work around the lack of support for clang.
I'm thinking of a better way to do this, instead of the hardcoded version tuple I put in there.
What am I doing wrong?
Probably because I'm using
zsh
, which is a bit smarter thanbash
:)
That makes sense then because I was sure I had seen that done in a script on FreeBSD!
Patch to Lib/distutils/cygwinccompiler.py:
This is a patch to
distutils
, to work around the lack of support for clang. I'm thinking of a better way to do this, instead of the hardcoded version tuple I put in there.
I finally got python3.8.exe to work by setting the PYTHONHOME envirnoment variable. I now get some errors due to missing readline support:
C:\Users\russh\python-3.8.7-win32\bin> .\python3.8.exe
Python 3.8.7 (default, Jan 26 2021, 01:50:57)
[Clang 11.0.0 (https://github.com/llvm/llvm-project.git 176249bd6732a8044d45709 on win32
Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File "C:\Users\russh\python-3.8.7-win32\lib\python3.8\site.py", line 412, in register_readline
import readline
File "C:\Users\russh\AppData\Roaming\Python\Python38\site-packages\readline.py", line 6, in <module>
from pyreadline.rlmain import Readline
File "C:\Users\russh\AppData\Roaming\Python\Python38\site-packages\pyreadline\__init__.py", line 12, in <module>
from . import logger, clipboard, lineeditor, modes, console
File "C:\Users\russh\AppData\Roaming\Python\Python38\site-packages\pyreadline\modes\__init__.py", line 3, in <module>
from . import emacs, notemacs, vi
File "C:\Users\russh\AppData\Roaming\Python\Python38\site-packages\pyreadline\modes\emacs.py", line 16, in <module>
from . import basemode
File "C:\Users\russh\AppData\Roaming\Python\Python38\site-packages\pyreadline\modes\basemode.py", line 14, in <module>
from pyreadline.keysyms.common import make_KeyPress_from_keydescr
File "C:\Users\russh\AppData\Roaming\Python\Python38\site-packages\pyreadline\keysyms\__init__.py", line 23, in <module>
raise ImportError("Could not import keysym for local pythonversion", x)
NameError: name 'x' is not defined
>>>
That also makes sense. MSYS2 would have readline! I will persist because the error may be irrelevant, but it does indicate there is further patching necessary for python to run properly on windows.
Hmm that's weird, I didn't build Python with readline
and it still runs fine (in WSL that is). I'm gonna get it over to Windows and test it out.
lldb is sooo close:
lld-link: error: /home/osboxes/Python-3.8.7/build/deploy/usr/local/bin/libpython3.8.dll: bad file type. Did you specify a DLL instead of an import library?
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[908/1100] Building CXX object tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/SchedulerStatistics.cpp.obj
ninja: build stopped: subcommand failed.
osboxes@osboxes ~/g/llvm-mingw (master) [1]>
I searched my python build directory and it didn't have a lib file:
osboxes@osboxes ~/P/build> pwd
/home/osboxes/Python-3.8.7/build
osboxes@osboxes ~/P/build> find . -type f -iname "*.lib"
osboxes@osboxes ~/P/build>
Is there a way to generate one, or force one during a build?
I searched my python build directory and it didn't have a lib file:
.lib
is for MSVC, mingw import libraries are .a
and .dll.a
Hmm how can I propagate my environment variables to sudo? I'm having problems with sudo make install because CC and CXX aren't set in root
sudo -E
might work?
Woot woot! LLVM finished building and I saw it install a bunch of lldb python files. Woot woot!
Okay, lunches...
Seems like we have a winner!
I found out about sudo -E
a few minutes after my comment, should have searched for it sooner. Ah well...
Anyway now it's time to write the build scripts.
If you have problems with your Python build, you can ask me for a fresh build
HP@DESKTOP-194TAE9 G:\python-mingw gci
Directory: G:\python-mingw
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 27/1/2021 13:09 bin
d---- 27/1/2021 12:56 include
d---- 27/1/2021 12:56 lib
d---- 27/1/2021 13:09 share
HP@DESKTOP-194TAE9 G:\python-mingw cd bin
HP@DESKTOP-194TAE9 G:\..\bin ./python3.8
Python 3.8.7 (tags/v3.8.7-dirty:6503f05, Jan 27 2021, 12:50:41)
[Clang 11.0.0 (https://github.com/llvm/llvm-project.git 176249bd6732a8044d45709 on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
@mstorsjo Can you do a build containing readelf
? This is the last piece I need to go full LLVM.
@mstorsjo Can you do a build containing
readelf
? This is the last piece I need to go full LLVM.
What kind of build do you want - a docker image, ubuntu x86_64 tar.xz or something else?
Preferably Ubuntu .tar.gz
, and maybe a native Windows build as well.
Preferably Ubuntu
.tar.gz
, and maybe a native Windows build as well.
Ok, I can have them done in 6 hours or so
I have a 32 core FreeBSD server with 78 GB of ram. I can create a "jail" (freebsd container) if anyone needs some horsepower.
Preferably Ubuntu
.tar.gz
, and maybe a native Windows build as well.
https://martin.st/temp/llvm-mingw-11-readelf-ubuntu18.04-x86_64.tar.xz https://martin.st/temp/llvm-mingw-11-readelf-x86_64.zip
@RussellHaley I'm working to get my setup.py
patches to MSYS2 (https://github.com/msys2/MINGW-packages/pull/7819), and I'll also try to get proper Clang support into upstream distutils
(or ask someone to do it), instead of this clutch that I did.
And we're merged! Now we just need to think about adding Clang mingw support to distutils
I already have a crude implementation ready, but we'll also have to write test cases for it, which I have no clues how to do.
To be honest though, most of it was copy-pasted from the current CygwinCCompiler
class, which already have test cases, so it might not be required? I'm gonna try submitting it anyway and see what they will say about it.
Great news! Here is where I am at:
Attempted to build lldb-mi
. The cmake script finds the *.cmake
output files in the install directory but could not find library? I hard coded library path. Received include errors: Added needed directories to target_include_directories. Some of the missing header files are from the source directory, others are "configuration headers" in the build directories. Linking has errors in mingw math.h libraries. Suspicious, and I have no idea where to go from here ...
osboxes@osboxes ~/g/lldb-mi (master)> git diff
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 38bd1b9..52c0287 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -85,8 +85,19 @@ else()
find_library(lib_lldb NAMES lldb liblldb HINTS ${LLVM_LIBRARY_DIRS})
endif()
-find_library(lib_llvm_shared LLVM HINTS ${LLVM_LIBRARY_DIRS})
+set(LLVM_SOURCE_DIR "/home/osboxes/git/llvm-mingw/llvm-project/")
+target_include_directories(lldb-mi PRIVATE
+"${LLVM_SOURCE_DIR}/llvm/include"
+"${LLVM_SOURCE_DIR}/lldb/include"
+"${LLVM_SOURCE_DIR}/llvm/build-x86_64-w64-mingw32/tools/lldb/include"
+"${LLVM_SOURCE_DIR}/llvm/build-x86_64-w64-mingw32/include/"
+)
+
+#~ set(LLVM_LIBRARY_DIRS "~/llvm-mingw-w64-x86_64/bin")
+#~ message(STATUS "WHO DAT: ${LLVM_LIBRARY_DIRS}")
+#~ find_library(lib_llvm_shared LLVM HINTS ${LLVM_LIBRARY_DIRS})
+set(lib_llvm_shared "/home/osboxes/llvm-mingw-w64-x86_64/bin/liblldb.dll")
if (lib_llvm_shared)
set(lib_llvm "${lib_llvm_shared}")
else()
osboxes@osboxes ~/g/lldb-mi (master)>
I used ninja -k 0
, which keeps building files until it exhausts possibilities.
osboxes@osboxes ~/g/l/build-x86_64-w64 (master)> cmake -DCMAKE_TOOLCHAIN_FILE=~/x86_64-w64-mingw32.cmake -DCMAKE_PREFIX_PATH=~/llvm-mingw-w64-x86_64 -GNinja ..
-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/osboxes/llvm-mingw-host/bin/x86_64-w64-mingw32-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/osboxes/llvm-mingw-host/bin/x86_64-w64-mingw32-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LLVM 11.0.0
-- Using LLVMConfig.cmake in: /home/osboxes/llvm-mingw-w64-x86_64/lib/cmake/llvm
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/osboxes/git/lldb-mi/build-x86_64-w64
osboxes@osboxes ~/g/l/build-x86_64-w64 (master)> ninja -k 0
[17/75] Building CXX object src/CMakeFiles/lldb-mi.dir/MICmdCmdData.cpp.obj
FAILED: src/CMakeFiles/lldb-mi.dir/MICmdCmdData.cpp.obj
/home/osboxes/llvm-mingw-host/bin/x86_64-w64-mingw32-g++ -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS="64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/osboxes/llvm-mingw-w64-x86_64/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/include -I/home/osboxes/git/llvm-mingw/llvm-project/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/tools/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/include -Wa,-mbig-obj -Werror=date-time -Werror=unguarded-availability-new -w -fno-exceptions -std=gnu++14 -MD -MT src/CMakeFiles/lldb-mi.dir/MICmdCmdData.cpp.obj -MF src/CMakeFiles/lldb-mi.dir/MICmdCmdData.cpp.obj.d -o src/CMakeFiles/lldb-mi.dir/MICmdCmdData.cpp.obj -c ../src/MICmdCmdData.cpp
In file included from ../src/MICmdCmdData.cpp:26:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace; did you mean '__signbit'?
using ::signbit;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:597:22: note: '__signbit' declared here
extern int __cdecl __signbit (double);
^
In file included from ../src/MICmdCmdData.cpp:26:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
using ::fpclassify;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:399:22: note: '__fpclassify' declared here
extern int __cdecl __fpclassify (double);
^
In file included from ../src/MICmdCmdData.cpp:26:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace; did you mean '_isnan'?
using ::isnan;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:294:23: note: '_isnan' declared here
_CRTIMP int __cdecl _isnan (double);
^
In file included from ../src/MICmdCmdData.cpp:26:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:742:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MICmdCmdData.cpp:26:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:771:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MICmdCmdData.cpp:26:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
[33/75] Building CXX object src/CMakeFiles/lldb-mi.dir/MICmdCmdSymbol.cpp.obj
FAILED: src/CMakeFiles/lldb-mi.dir/MICmdCmdSymbol.cpp.obj
/home/osboxes/llvm-mingw-host/bin/x86_64-w64-mingw32-g++ -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS="64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/osboxes/llvm-mingw-w64-x86_64/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/include -I/home/osboxes/git/llvm-mingw/llvm-project/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/tools/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/include -Wa,-mbig-obj -Werror=date-time -Werror=unguarded-availability-new -w -fno-exceptions -std=gnu++14 -MD -MT src/CMakeFiles/lldb-mi.dir/MICmdCmdSymbol.cpp.obj -MF src/CMakeFiles/lldb-mi.dir/MICmdCmdSymbol.cpp.obj.d -o src/CMakeFiles/lldb-mi.dir/MICmdCmdSymbol.cpp.obj -c ../src/MICmdCmdSymbol.cpp
In file included from ../src/MICmdCmdSymbol.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace; did you mean '__signbit'?
using ::signbit;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:597:22: note: '__signbit' declared here
extern int __cdecl __signbit (double);
^
In file included from ../src/MICmdCmdSymbol.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
using ::fpclassify;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:399:22: note: '__fpclassify' declared here
extern int __cdecl __fpclassify (double);
^
In file included from ../src/MICmdCmdSymbol.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace; did you mean '_isnan'?
using ::isnan;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:294:23: note: '_isnan' declared here
_CRTIMP int __cdecl _isnan (double);
^
In file included from ../src/MICmdCmdSymbol.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:742:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MICmdCmdSymbol.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:771:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MICmdCmdSymbol.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
[66/75] Building CXX object src/CMakeFiles/lldb-mi.dir/MIDriverMain.cpp.obj
FAILED: src/CMakeFiles/lldb-mi.dir/MIDriverMain.cpp.obj
/home/osboxes/llvm-mingw-host/bin/x86_64-w64-mingw32-g++ -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS="64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/osboxes/llvm-mingw-w64-x86_64/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/include -I/home/osboxes/git/llvm-mingw/llvm-project/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/tools/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/include -Wa,-mbig-obj -Werror=date-time -Werror=unguarded-availability-new -w -fno-exceptions -std=gnu++14 -MD -MT src/CMakeFiles/lldb-mi.dir/MIDriverMain.cpp.obj -MF src/CMakeFiles/lldb-mi.dir/MIDriverMain.cpp.obj.d -o src/CMakeFiles/lldb-mi.dir/MIDriverMain.cpp.obj -c ../src/MIDriverMain.cpp
In file included from ../src/MIDriverMain.cpp:31:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/PrettyStackTrace.h:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace; did you mean '__signbit'?
using ::signbit;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:597:22: note: '__signbit' declared here
extern int __cdecl __signbit (double);
^
In file included from ../src/MIDriverMain.cpp:31:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/PrettyStackTrace.h:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
using ::fpclassify;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:399:22: note: '__fpclassify' declared here
extern int __cdecl __fpclassify (double);
^
In file included from ../src/MIDriverMain.cpp:31:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/PrettyStackTrace.h:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace; did you mean '_isnan'?
using ::isnan;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:294:23: note: '_isnan' declared here
_CRTIMP int __cdecl _isnan (double);
^
In file included from ../src/MIDriverMain.cpp:31:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/PrettyStackTrace.h:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:742:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MIDriverMain.cpp:31:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/PrettyStackTrace.h:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:771:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MIDriverMain.cpp:31:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/PrettyStackTrace.h:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
[71/75] Building CXX object src/CMakeFiles/lldb-mi.dir/MIUtilFileStd.cpp.obj
FAILED: src/CMakeFiles/lldb-mi.dir/MIUtilFileStd.cpp.obj
/home/osboxes/llvm-mingw-host/bin/x86_64-w64-mingw32-g++ -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS="64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/osboxes/llvm-mingw-w64-x86_64/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/include -I/home/osboxes/git/llvm-mingw/llvm-project/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/tools/lldb/include -I/home/osboxes/git/llvm-mingw/llvm-project/llvm/build-x86_64-w64-mingw32/include -Wa,-mbig-obj -Werror=date-time -Werror=unguarded-availability-new -w -fno-exceptions -std=gnu++14 -MD -MT src/CMakeFiles/lldb-mi.dir/MIUtilFileStd.cpp.obj -MF src/CMakeFiles/lldb-mi.dir/MIUtilFileStd.cpp.obj.d -o src/CMakeFiles/lldb-mi.dir/MIUtilFileStd.cpp.obj -c ../src/MIUtilFileStd.cpp
In file included from ../src/MIUtilFileStd.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/FileSystem.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/File.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Utility/IOObject.h:16:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private.h:15:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private-enumerations.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/FormatProviders.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace; did you mean '__signbit'?
using ::signbit;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:597:22: note: '__signbit' declared here
extern int __cdecl __signbit (double);
^
In file included from ../src/MIUtilFileStd.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/FileSystem.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/File.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Utility/IOObject.h:16:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private.h:15:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private-enumerations.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/FormatProviders.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
using ::fpclassify;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:399:22: note: '__fpclassify' declared here
extern int __cdecl __fpclassify (double);
^
In file included from ../src/MIUtilFileStd.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/FileSystem.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/File.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Utility/IOObject.h:16:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private.h:15:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private-enumerations.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/FormatProviders.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace; did you mean '_isnan'?
using ::isnan;
~~^
/home/osboxes/llvm-mingw-w64-x86_64/include/math.h:294:23: note: '_isnan' declared here
_CRTIMP int __cdecl _isnan (double);
^
In file included from ../src/MIUtilFileStd.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/FileSystem.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/File.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Utility/IOObject.h:16:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private.h:15:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private-enumerations.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/FormatProviders.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:742:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MIUtilFileStd.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/FileSystem.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/File.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Utility/IOObject.h:16:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private.h:15:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private-enumerations.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/FormatProviders.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/functional:771:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from ../src/MIUtilFileStd.cpp:18:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/FileSystem.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Host/File.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/Utility/IOObject.h:16:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private.h:15:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/lldb/include/lldb/lldb-private-enumerations.h:13:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/FormatProviders.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/Twine.h:12:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/ADT/SmallVector.h:20:
In file included from /home/osboxes/git/llvm-mingw/llvm-project/llvm/include/llvm/Support/MathExtras.h:20:
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/home/osboxes/llvm-mingw-host/x86_64-w64-mingw32/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
[74/75] Building CXX object src/CMakeFiles/lldb-mi.dir/MIUtilString.cpp.obj
ninja: build stopped: cannot make progress due to previous errors.
osboxes@osboxes ~/g/l/build-x86_64-w64 (master) [1]>
Hmmm. I am just trying to get the debugger working in VS code or on the command line. I found a post where somebody had entered "script mode" in lldb so I started it from the command line and tried.Note the hard coded unix path that has been tacked onto the end of everything? ha ha!
C:\Users\russh\lldb-vscode-test> lldb.exe
(lldb) script
Python path configuration:
PYTHONHOME = 'C:\Users\russh\VirtualBox VMs\Ubuntu20\shared\llvm-mingw-x86_64-win32\bin/home/osboxes/python-cmake-install/bin'
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin\\lldb.exe'
sys.base_prefix = 'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin'
sys.base_exec_prefix = 'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin'
sys.executable = 'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin\\lldb.exe'
sys.prefix = 'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin'
sys.exec_prefix = 'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin'
sys.path = [
'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin\\home\\osboxes\\python-cmake-install\\bin\\lib\\python38.zip',
'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin\\lib\\python3.8',
'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin\\lib\\python3.8',
'C:\\Users\\russh\\VirtualBox VMs\\Ubuntu20\\shared\\llvm-mingw-x86_64-win32\\bin/home/osboxes/python-cmake-install/bin\\lib\\python3.8\\lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00004f24 (most recent call first):
<no Python frame>
C:\Users\russh\lldb-vscode-test>
@mstorsjo Are the math functions imported from UCRT or implemented by mingw-w64?
@RussellHaley Let me try building lldb and lldb-mi with my build of Python. For now, can you set PYTHONHOME
to the correct path?
Great news! Here is where I am at:
- python 8.6.7 built
- lldb built with python option enabled. The python installs with lldb/llvm
- removed strip from the llvm-mingw build process to ensure I "get everything"
Attempted to build
lldb-mi
. The cmake script finds the*.cmake
output files in the install directory but could not find library?
FWIW, I tried building lldb-mi earlier, and got it working pretty nicely, see https://github.com/mstorsjo/llvm-mingw/commit/e9a2f7602b02ded3aa959cd0a0143e3a19795e39 (the branch lldb-mi
in this repo), but I didn't merge it, as in the end nobody said that it provided any actual benefit (yet).
Those build errors look quite odd, but I haven't tried to figure out what's going wrong in your setup.
@mstorsjo Are the math functions imported from UCRT or implemented by mingw-w64?
On x86, most math functions are provided by libmingwex.a. UCRT also provides equally functional ones - it's just a historical thing, where the ones provided by msvcrt.dll aren't C99 compliant in all aspects, at least on older versions of windows, so mingw-w64 provides their own - and making them only available for msvcrt.dll but not UCRT makes a pretty big mess in mingw-w64's Makefile.am, so it's not necessarily worth it to clean it up. For arm/aarch64, most math functions are imported from msvcrt.dll or UCRT (as the expectation is that the ones in msvcrt.dll are mostly C99 compliant at the baseline of arm based windows versions), with a small handful being provided in libmingwex.a.
@RussellHaley I would like to borrow some CPU time, I'm too impatient to wait for the entire build :) My computer also doesn't have enough RAM anyway, so it'll most likely crash. 4-8 cores with 16GB of RAM is probably enough.
@longnguyen2004 I sent you an email. 👍
Great news! Here is where I am at:
- python 8.6.7 built
- lldb built with python option enabled. The python installs with lldb/llvm
- removed strip from the llvm-mingw build process to ensure I "get everything"
Attempted to build
lldb-mi
. The cmake script finds the*.cmake
output files in the install directory but could not find library?FWIW, I tried building lldb-mi earlier, and got it working pretty nicely, see e9a2f76 (the branch
lldb-mi
in this repo), but I didn't merge it, as in the end nobody said that it provided any actual benefit (yet).
Thanks Martin. I'll try applying my python switch patch to the commit you provided.
Those build errors look quite odd, but I haven't tried to figure out what's going wrong in your setup.
No need: the error is behind the keyboard. (rolling of eyes)
@mstorsjo Are the math functions imported from UCRT or implemented by mingw-w64?
On x86, most math functions are provided by libmingwex.a. UCRT also provides equally functional ones - it's just a historical thing, where the ones provided by msvcrt.dll aren't C99 compliant in all aspects, at least on older versions of windows, so mingw-w64 provides their own - and making them only available for msvcrt.dll but not UCRT makes a pretty big mess in mingw-w64's Makefile.am, so it's not necessarily worth it to clean it up. For arm/aarch64, most math functions are imported from msvcrt.dll or UCRT (as the expectation is that the ones in msvcrt.dll are mostly C99 compliant at the baseline of arm based windows versions), with a small handful being provided in libmingwex.a.
Polished my distutils
patch up a bit, now it gets the compiler from the CC
and CXX
environment variables. This helps me avoid duplicating code. Currently testing...
@longnguyen2004 I don't write any python. Are you also going to patch the _ctypes? I was able to get libffi to build for 3.6.7.
I haven't tried building libffi yet, but I guess it would also succeed, I'm currently focusing on distutils
though.
@RussellHaley I'm getting weird link errors when building the modules. Have you stumbled across this before? @mstorsjo What could be the cause of this? If you need, I can provide you with the object files from the build.
lld-link: error: unknown file type: abstract.o
lld-link: error: unknown file type: boolobject.o
lld-link: error: unknown file type: call.o
lld-link: error: unknown file type: complexobject.o
lld-link: error: unknown file type: floatobject.o
lld-link: error: unknown file type: listobject.o
lld-link: error: unknown file type: longobject.o
lld-link: error: unknown file type: dictobject.o
lld-link: error: unknown file type: moduleobject.o
lld-link: error: unknown file type: object.o
lld-link: error: unknown file type: obmalloc.o
lld-link: error: unknown file type: tupleobject.o
lld-link: error: unknown file type: typeobject.o
lld-link: error: unknown file type: unicodeobject.o
lld-link: error: unknown file type: unicodectype.o
lld-link: error: unknown file type: context.o
lld-link: error: unknown file type: errors.o
lld-link: error: unknown file type: getargs.o
lld-link: error: unknown file type: import.o
lld-link: error: unknown file type: modsupport.o
I've checked them with llvm-readobj
and they're normal x86_64 COFF object files
File: Objects/abstract.o
Format: COFF-x86-64
Arch: x86_64
AddressSize: 64bit
Command line output from -v
:
"/home/lnguyen/llvm-mingw-build/bin/ld.lld" -s -m i386pep --shared -Bdynamic -e DllMainCRTStartup --enable-auto-image-base -o build/lib.mingw-3.8/_decimal-cpython-38.dll -s /home/lnguyen/llvm-mingw-build/x86_64-w64-mingw32/lib/dllcrt2.o /home/lnguyen/llvm-mingw-build/x86_64-w64-mingw32/lib/crtbegin.o -L/usr/local/lib/python3.8/config-3.8 -L. -L/home/lnguyen/llvm-mingw-build/x86_64-w64-mingw32/lib -L/home/lnguyen/llvm-mingw-build/lib -L/home/lnguyen/llvm-mingw-build/x86_64-w64-mingw32/sys-root/mingw/lib -L/home/lnguyen/llvm-mingw-build/lib/clang/11.0.0/lib/windows --enable-auto-image-base build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/_decimal.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/basearith.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/constants.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/context.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/convolute.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/crt.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/difradix2.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/fnt.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/fourstep.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/io.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/memory.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/mpdecimal.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/numbertheory.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/sixstep.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/libmpdec/transpose.o build/temp.mingw-3.8/usr/home/lnguyen/llvm-mingw/cpython/Modules/_decimal/_decimal-cpython-38.def -lm -lpython3.8 -lm -lversion -lshlwapi -lmingw32 /home/lnguyen/llvm-mingw-build/lib/clang/11.0.0/lib/windows/libclang_rt.builtins-x86_64.a -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 /home/lnguyen/llvm-mingw-build/lib/clang/11.0.0/lib/windows/libclang_rt.builtins-x86_64.a -lmoldname -lmingwex -lmsvcrt -lkernel32 /home/lnguyen/llvm-mingw-build/x86_64-w64-mingw32/lib/crtend.o
Still trying to find out where the /usr/local/lib
path comes from. There was an incorrect libpython3.8.a
in that directory, which messes up the linking.
At last...I found out the culprit. It's related to patch 0920-mingw-add-LIBPL-to-library-dirs.patch, which mistakenly add the system include path to the link options, messing everything up. I'm gonna try reproducing it in WSL.
@mstorsjo Can we defer building LLDB to build-cross-tools.sh
? We have to build a separate Python and libffi for 4 architectures, and the fact that a debugger for the cross toolchain is kinda pointless, so it should be moved to build-cross-tools.sh
@mstorsjo I've seen libtool using linker scripts before, but not version scripts. Do you know how it's used in libtool?
Version scripts are used for setting symbol versions, which is an ELF feature (that allows you to e.g. have multiple copies of the same symbol in a binary, for backwards binary compatibility). For COFF targets, the only thing that version scripts allow you to do is choose what symbols to export using wildcard expressions (instead of in e.g. a def file, where you have to literally list all the symbols to export).
For building libffi, just add --disable-symvers
. The latest git version of libffi supports building for aarch64-w64-mingw32 too, but there's no public release with that included yet. For those build setups, you'll want to cherrypick https://github.com/libffi/libffi/commit/c06468fa6674d3783a0edb1d0fae9afc8bc28513 and https://github.com/libffi/libffi/commit/15d3ea31a53bd0e5b828c90a9f7c4285c58f73e1.
@mstorsjo Can we defer building LLDB to
build-cross-tools.sh
? We have to build a separate Python and libffi for 4 architectures, and the fact that a debugger for the cross toolchain is kinda pointless, so it should be moved tobuild-cross-tools.sh
I agree that there's not very much use for LLDB in the cross toolchain, but there is some (you can inspect crash dumps and binaries, and it's useful when developing LLDB itself).
For building a python-enabled LLDB in the cross setups, I don't see what harm it does to have it included in the native build and what you concretely would gain - you don't need to build python for the host environment anyway. It shoudl be enough to just pass the flags for enabling/locating the newly built python if we're cross building (or building natively on msys2) in build-llvm.sh
. (Since 4b063063f22fdd84bae0c41195f7e96722cd97f8, we don't explicitly disable python, but just let it autodetect things, so it's enabled for the host build if it happens to be available.)
Can you clarify which bit of it that you find problematic, and maybe I can help with a better fix for how to tweak build-llvm.sh
for your purposes?
Hmm..after thinking about it, I realized we can build libffi and Python before we build LLVM (for the cross build), and let CMake auto-detect it. So build-llvm.sh
can stay unmodified, and we only need a build-python.sh
before that.
Qt Creator requires python support from gdb / lldb debugger.
It would be great to have a fully toolchain on Windows 😄