[lldb-dev] Pre-processor definition confusion

Zachary Turner zturner at google.com
Fri Sep 12 10:10:42 PDT 2014


Not a Cygwin person, but Reid might be able to answer that one.

MinGW doesn't use glibc though.

I'm personally ok saying we don't support Cygwin.  The point of my work is
to make it work on actual Windows, not fake Windows anyway :)  And I think
also that like you said it probably doesn't even work right now.

Even if we did want to support Cygwin though, then we already have
LLDB_DISABLE_POSIX which could be used for the same purpose.  Each
additional pre-processor conditional adds to the complexity and maintenance
cost of the code (this thread is a good example :P)  so I'd like to remove
the __GLIBC__ checks if possible and convert them into something more
easily understandable.

On Fri, Sep 12, 2014 at 10:05 AM, Todd Fiala <tfiala at google.com> wrote:

> What does a cygwin or minwing environment look like?  I would guess cygwin
> would have __GLIBC__ defined?  (I'm not sure if we even pretend to build
> there, but that's the glibc case that is not Linux that comes to mind).
>
> On Fri, Sep 12, 2014 at 9:59 AM, Zachary Turner <zturner at google.com>
> wrote:
>
>> The important thing seems to be whether glibc implies linux, not the
>> other way around.  If glibc implies linux, then
>>
>> #if defined(__linux__) || defined(__GLIBC__)
>>
>> can be reduced to
>>
>> #if defined(__linux__)
>>
>> The issue is that all of our CMake decisions are based on OS platform.
>>  If I want to conditionally compile an entire file based on one of these
>> conditions, I need to translate it into something that fits well into the
>> CMake build.
>>
>> On Thu, Sep 11, 2014 at 9:01 PM, Reid Kleckner <rnk at google.com> wrote:
>>
>>> On Thu, Sep 11, 2014 at 7:07 PM, Zachary Turner <zturner at google.com>
>>> wrote:
>>>
>>>> Thanks.  In some places we check __GLIBC__ explicitly.  I guess what
>>>> I'm wondering is: is there some reason this isn't equivalent to some
>>>> combination of OS define checks?
>>>>
>>>
>>> You can use alternative libcs on Linux, like musl:
>>> http://www.musl-libc.org/
>>>
>>> Android, for example, uses a Linux kernel with the Bionic libc
>>> implementation, so it's complicated. =/
>>>
>>
>>
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>>
>
>
> --
> Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140912/e5ecbc8f/attachment.html>


More information about the lldb-dev mailing list