Hi Kostya, Can you please review this small patch? Please note it might not be ...
12 years, 8 months ago
(2012-05-21 13:56:12 UTC)
#1
Hi Kostya,
Can you please review this small patch?
Please note it might not be compileable with the upstream trunk version but
works fine for me when compiled with a slightly patches Clang [the patches
pending review & cleanup].
--
Timur
Looks good. On 2012/05/21 13:56:12, timurrrr_at_google_com wrote: > Hi Kostya, > > Can you please ...
12 years, 8 months ago
(2012-05-21 14:01:32 UTC)
#2
Looks good.
On 2012/05/21 13:56:12, timurrrr_at_google_com wrote:
> Hi Kostya,
>
> Can you please review this small patch?
>
> Please note it might not be compileable with the upstream trunk version but
> works fine for me when compiled with a slightly patches Clang [the patches
> pending review & cleanup].
I assume it may not build on Windows, but still builds on Linux/Mac.
>
> --
> Timur
Hi Timur, > -#ifdef _WIN32 > +#if defined(_WIN32) && !defined(__clang__) > #include <intrin.h> > #endif ...
12 years, 8 months ago
(2012-05-21 14:03:56 UTC)
#3
Hi Timur,
> -#ifdef _WIN32
> +#if defined(_WIN32) && !defined(__clang__)
> #include <intrin.h>
> #endif
I think it should check for _MSC_VER here instead. And in many other
places as well.
> #if defined(_WIN32)
> +# if defined(__clang__)
> +typedef int intptr_t;
> +typedef unsigned int uintptr_t;
> +# endif
These should go from stddef.h. What's the problem with it?
> +#if !defined(_WIN32) || defined(__clang__)
So, on Win64 you will provide all this stuff regardless of compiler?
This looks plain wrong.
Same problems in other places.
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
Anton, On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov <anton@korobeynikov.info> wrote: >> -#ifdef ...
12 years, 8 months ago
(2012-05-21 14:07:21 UTC)
#4
Anton,
On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov
<anton@korobeynikov.info> wrote:
>> -#ifdef _WIN32
>> +#if defined(_WIN32) && !defined(__clang__)
>> #include <intrin.h>
>> #endif
> I think it should check for _MSC_VER here instead. And in many other
> places as well.
Clang defines _MSC_VER on Windows:
$ clang++ -dM -E -xc empty | grep MSC
#define _MSC_EXTENSIONS 1
#define _MSC_VER 1300
>> +#if !defined(_WIN32) || defined(__clang__)
> So, on Win64 you will provide all this stuff regardless of compiler?
> This looks plain wrong.
on Win64 both _WIN32 and _WIN64 are defined.
On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov <anton@korobeynikov.info > wrote: > Hi ...
12 years, 8 months ago
(2012-05-21 14:07:45 UTC)
#5
On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov <anton@korobeynikov.info
> wrote:
> Hi Timur,
>
> > -#ifdef _WIN32
> > +#if defined(_WIN32) && !defined(__clang__)
> > #include <intrin.h>
> > #endif
> I think it should check for _MSC_VER here instead. And in many other
> places as well.
>
> > #if defined(_WIN32)
> > +# if defined(__clang__)
> > +typedef int intptr_t;
> > +typedef unsigned int uintptr_t;
> > +# endif
> These should go from stddef.h. What's the problem with it?
>
It doesn't define what's needed. On windows these folks live somewhere
else.
Adding other system headers brings in too much stuff which makes further
porting efforts more complicated.
We've spend quite a bit of time geting rid of things like stdlib.h
>
> > +#if !defined(_WIN32) || defined(__clang__)
> So, on Win64 you will provide all this stuff regardless of compiler?
> This looks plain wrong.
>
> Same problems in other places.
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
Timur, > On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov > <anton@korobeynikov.info> wrote: ...
12 years, 8 months ago
(2012-05-21 14:27:35 UTC)
#7
Timur,
> On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov
> <anton@korobeynikov.info> wrote:
>>> -#ifdef _WIN32
>>> +#if defined(_WIN32) && !defined(__clang__)
>>> #include <intrin.h>
>>> #endif
>> I think it should check for _MSC_VER here instead. And in many other
>> places as well.
> Clang defines _MSC_VER on Windows:
> $ clang++ -dM -E -xc empty | grep MSC
> #define _MSC_EXTENSIONS 1
> #define _MSC_VER 1300
Ok, it seems that the following scenarios are possible:
1. clang on non-windows (or gcc, this should not matter, in theory)
2. clang on windows with ms extensions enabled
3. clang on windows w/o ms extensions enabled
4. MS VC on windows
For me it seems you're trying to "unify" 4 and 2 in MS-way - with
confusing defines (_WIN32 defined in _WIN64 mode as well), etc. The 3
as it seems to me is not supported as well.
It's surely up to you, but maybe there is better way to untangle all
the mess? For example, LLVM itself has portability layer which seems
to contain bunch of stuff you're using in asan.
Maybe you can consider looking there and "steal" some design ideas
from there? Check e.g. Support/DataTypes.h, Support/MathExtras.h,
etc...
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
On Mon, May 21, 2012 at 6:27 PM, Anton Korobeynikov <anton@korobeynikov.info> wrote: > Timur, > ...
12 years, 8 months ago
(2012-05-21 14:29:39 UTC)
#8
On Mon, May 21, 2012 at 6:27 PM, Anton Korobeynikov
<anton@korobeynikov.info> wrote:
> Timur,
>
>> On Mon, May 21, 2012 at 6:03 PM, Anton Korobeynikov
>> <anton@korobeynikov.info> wrote:
>>>> -#ifdef _WIN32
>>>> +#if defined(_WIN32) && !defined(__clang__)
>>>> #include <intrin.h>
>>>> #endif
>>> I think it should check for _MSC_VER here instead. And in many other
>>> places as well.
>> Clang defines _MSC_VER on Windows:
>> $ clang++ -dM -E -xc empty | grep MSC
>> #define _MSC_EXTENSIONS 1
>> #define _MSC_VER 1300
>
> Ok, it seems that the following scenarios are possible:
>
> 1. clang on non-windows (or gcc, this should not matter, in theory)
> 2. clang on windows with ms extensions enabled
> 3. clang on windows w/o ms extensions enabled
> 4. MS VC on windows
>
> For me it seems you're trying to "unify" 4 and 2 in MS-way - with
> confusing defines (_WIN32 defined in _WIN64 mode as well), etc. The 3
> as it seems to me is not supported as well.
Right.
We only want to support 2 and 4 for now.
> It's surely up to you, but maybe there is better way to untangle all
> the mess? For example, LLVM itself has portability layer which seems
> to contain bunch of stuff you're using in asan.
> Maybe you can consider looking there and "steal" some design ideas
> from there? Check e.g. Support/DataTypes.h, Support/MathExtras.h,
> etc...
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
Issue 6214063: [ASan] Make for-Windows RTL compileable using Clang++
Created 12 years, 8 months ago by timurrrr_at_google_com
Modified 12 years, 8 months ago
Reviewers: kcc1, anton_korobeynikov.info
Base URL:
Comments: 0