[Lldb-commits] [PATCH] D47625: [cmake] Detect presence of wide-char libedit at build time
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 28 11:19:54 PST 2019
If I add:
diff --git a/lldb/source/Host/common/MainLoop.cpp
b/lldb/source/Host/common/MainLoop.cpp
index a4803936196..4fee76865ee 100644
--- a/lldb/source/Host/common/MainLoop.cpp
+++ b/lldb/source/Host/common/MainLoop.cpp
@@ -23,6 +23,8 @@
// (ppoll is present but not implemented properly). On windows we use WSApoll
// (which does not support signals).
+#define HAVE_SYS_EVENT_H 1
+
#if HAVE_SYS_EVENT_H
#include <sys/event.h>
#elif defined(_WIN32)
to my checkout it works. It looks like somehow llvm-config.h isn't
propagate properly so `HAVE_SYS_EVENT_H` isn't defined?
This looks like a bug to me, but maybe there's an easy way to work around it.
On Thu, Feb 28, 2019 at 11:04 AM Davide Italiano <dccitaliano at gmail.com> wrote:
>
> On Thu, Feb 28, 2019 at 10:31 AM Davide Italiano <dccitaliano at gmail.com> wrote:
> >
> > On Thu, Feb 28, 2019 at 8:25 AM Raphael Isemann via lldb-commits
> > <lldb-commits at lists.llvm.org> wrote:
> > >
> > > Am Do., 28. Feb. 2019 um 17:11 Uhr schrieb Pavel Labath via
> > > lldb-commits <lldb-commits at lists.llvm.org>:
> > > >
> > > > On 28/02/2019 16:18, Pavel Labath via lldb-commits wrote:
> > > > > On 28/02/2019 02:37, Davide Italiano via Phabricator wrote:
> > > > >> davide added a comment.
> > > > >> Herald added a subscriber: jdoerfert.
> > > > >> Herald added a project: LLVM.
> > > > >>
> > > > >> Pavel, this broke unicode handling for lldb on MacOS. If you type
> > > > >> something in the lldb cmdline, it won't print the right character but
> > > > >> a series of unicode sequences.
> > > > >> The main concern is that this also breaks the Swift REPL (powered by
> > > > >> lldb).
> > > > >>
> > > > >> Looks like something like this:
> > > > >>
> > > > >> $ git diff
> > > > >> diff --git a/lldb/include/lldb/Host/Editline.h
> > > > >> b/lldb/include/lldb/Host/Editline.h
> > > > >> index cb40f1e6917..e53991c450f 100644
> > > > >> --- a/lldb/include/lldb/Host/Editline.h
> > > > >> +++ b/lldb/include/lldb/Host/Editline.h
> > > > >> @@ -51,6 +51,7 @@
> > > > >> #include <string>
> > > > >> #include <vector>
> > > > >> +#include "lldb/Host/Config.h"
> > > > >> #include "lldb/Host/ConnectionFileDescriptor.h"
> > > > >> #include "lldb/Host/Predicate.h"
> > > > >> #include "lldb/Utility/FileSpec.h"
> > > > >>
> > > > >> "fixes" the CMake build. I'm seeing failures if I apply the same patch
> > > > >> to the Xcode project.
> > > > >
> > > > > Have you tried putting the `#include "lldb/Host/Config.h"` at the top of
> > > > > Editline.h, so that LLDB_EDITLINE_USE_WCHAR is defined before the
> > > > > ```
> > > > > #if LLDB_EDITLINE_USE_WCHAR
> > > > > #include <codecvt>
> > > > > #endif
> > > > > ```
> > > > > block ?
> > > >
> > > >
> > > >
> > > > Ok, I've done some more experiments, and I'm pretty sure this will fix
> > > > things. I didn't commit that yet because I found that this breaks the
> > > > modules build. I am not sure why is that, but I suspect this is because
> > > > we don't have a modulemap file for the lldb/Host/Config.h file. I am not
> > > > sure if I'll have time to fix that today.
> > > >
> > > > cheers,
> > > > pavel
> > > > _______________________________________________
> > > > lldb-commits mailing list
> > > > lldb-commits at lists.llvm.org
> > > > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> > >
> > > Can you post the error if you still have the log around? If modules
> > > fail because this simple header is duplicated then that's an
> > > interesting Clang bug.
> > >
> > > - Raphael
> > >
> >
> > I confirm that putting the include at the beginning of the file fixes
> > my issues with Xcodebuild. I'm trying to reproduce with the modules
> > build and attach the log here.
> >
>
> Raphael, this is the error I'm seeing:
>
> [2689/3391] Building CXX object
> tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o
>
> FAILED: tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o
>
> /Applications/Xcode4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
> -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -DLIBXML2_DEFINED
> -DLLDB_CONFIGURATION_RELEASE -DLLDB_USE_OS_LOG
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> -Itools/lldb/source/Host
> -I/Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/source/Host
> -Itools/lldb/include
> -I/Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/include
> -isystem /Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2
> -Iinclude -I/Users/davide/llvm-monorepo/llvm-mono/llvm/include
> -I/Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/python2.7
> -I/Users/davide/llvm-monorepo/llvm-mono/llvm/tools/clang/include
> -Itools/lldb/../clang/include
> -I/Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/source/. -fPIC
> -fvisibility-inlines-hidden -Werror=date-time
> -Werror=unguarded-availability-new -std=c++11 -fmodules
> -fmodules-cache-path=/Users/davide/llvm-monorepo/llvm-mono/build-re/module.cache
> -fcxx-modules -Wall -Wextra -Wno-unused-parameter -Wwrite-strings
> -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long
> -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type
> -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion
> -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas
> -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3
> -DNDEBUG -isysroot
> /Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
> -fno-exceptions -fno-rtti -MD -MT
> tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o
> -MF tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o.d
> -o tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o
> -c /Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/source/Host/common/MainLoop.cpp
> /Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/source/Host/common/MainLoop.cpp:209:7:
> error: use of undeclared identifier 'ppoll'
> if (ppoll(read_fds.data(), read_fds.size(), nullptr, &sigmask) == -1 &&
> ^
> /Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/source/Host/common/MainLoop.cpp:333:25:
> error: use of undeclared identifier 'HAVE_SYS_EVENT_H'
> ret = pthread_sigmask(HAVE_SYS_EVENT_H ? SIG_UNBLOCK : SIG_BLOCK,
>
> ^
> 2 errors generated.
More information about the lldb-commits
mailing list