Bug 133400 - Buildfix on Linux, uint64_t and unsigned long conflict
Summary: Buildfix on Linux, uint64_t and unsigned long conflict
Status: RESOLVED DUPLICATE of bug 133430
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-30 01:38 PDT by Zsolt Borbely
Modified: 2014-06-04 03:00 PDT (History)
5 users (show)

See Also:


Attachments
Proposed patch (2.67 KB, patch)
2014-05-30 01:43 PDT, Zsolt Borbely
andersca: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Borbely 2014-05-30 01:38:10 PDT
$ Tools/Scripts/build-webkit --efl --web-replay
...
In file included from /home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.cpp:29:0:
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:159:19: error: redefinition of 'struct JSC::EncodingTraits<long unsigned int>'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:158:19: error: previous definition of 'struct JSC::EncodingTraits<long unsigned int>'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.cpp:93:25: error: redefinition of 'static JSC::EncodedValue JSC::ScalarEncodingTraits<T>::encodeValue(const DecodedType&) [with T = long unsigned int; JSC::ScalarEncodingTraits<T>::DecodedType = long unsigned int]'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.cpp:88:25: error: 'static JSC::EncodedValue JSC::ScalarEncodingTraits<T>::encodeValue(const DecodedType&) [with T = long unsigned int; JSC::ScalarEncodingTraits<T>::DecodedType = long unsigned int]' previously declared here
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.cpp:161:26: error: redefinition of 'T JSC::EncodedValue::convertTo() [with T = long unsigned int]'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.cpp:152:21: error: 'T JSC::EncodedValue::convertTo() [with T = long unsigned int]' previously declared here
In file included from /home/bzsolt/webkit/EflWebKit/WebKitBuild/Release/DerivedSources/JavaScriptCore/JSReplayInputs.h:34:0,
                 from /home/bzsolt/webkit/EflWebKit/WebKitBuild/Release/DerivedSources/JavaScriptCore/JSReplayInputs.cpp:31:
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:159:19: error: redefinition of 'struct JSC::EncodingTraits<long unsigned int>'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:158:19: error: previous definition of 'struct JSC::EncodingTraits<long unsigned int>'
In file included from /home/bzsolt/webkit/EflWebKit/WebKitBuild/Release/DerivedSources/JavaScriptCore/JSReplayInputs.h:34:0,
                 from /home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/runtime/DateConstructor.cpp:40:
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:159:19: error: redefinition of 'struct JSC::EncodingTraits<long unsigned int>'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:158:19: error: previous definition of 'struct JSC::EncodingTraits<long unsigned int>'
In file included from /home/bzsolt/webkit/EflWebKit/WebKitBuild/Release/DerivedSources/JavaScriptCore/JSReplayInputs.h:34:0,
                 from /home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/runtime/JSGlobalObject.cpp:135:
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:159:19: error: redefinition of 'struct JSC::EncodingTraits<long unsigned int>'
/home/bzsolt/webkit/EflWebKit/Source/JavaScriptCore/replay/EncodedValue.h:158:19: error: previous definition of 'struct JSC::EncodingTraits<long unsigned int>'
Comment 1 Zsolt Borbely 2014-05-30 01:43:12 PDT
Created attachment 232284 [details]
Proposed patch
Comment 2 Brian Burg 2014-05-30 07:25:27 PDT
Comment on attachment 232284 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=232284&action=review

> Source/JavaScriptCore/ChangeLog:3
> +        Buildfix on Linux, uint64_t and unsigned long conflict

Generally, I name replay-related bugs like 'Web Replay: [bug title]'
so that they are easier to find later. But that's just my preference.

> Source/JavaScriptCore/ChangeLog:8
> +        The uint64_t and unsigned long do the same typedef

I think the issue is that they are distinct types on Darwin [1], whereas on Linux and maybe other platforms they are typedefed to the same type. So, this guard may end up being #if !OS(LINUX) depending on whatever windows does. I think it's fine for now.

[1] https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man5/types.5.html
Comment 3 Darin Adler 2014-05-30 15:19:42 PDT
Comment on attachment 232284 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=232284&action=review

> Source/JavaScriptCore/replay/EncodedValue.h:161
> +#if OS(DARWIN)
>  template<> struct EncodingTraits<unsigned long> : public ScalarEncodingTraits<unsigned long> { };
> +#endif

I don’t think this is the correct conditional. This is a property of the compiler and compiler configuration, not the OS.

Further, we may be able to find a better way to avoid this. Lets ask Anders what he suggests.
Comment 4 Anders Carlsson 2014-05-31 16:50:42 PDT
Comment on attachment 232284 [details]
Proposed patch

I think it's wrong that there are traits for unsigned long. We should only encode/decode explicitly sized types.

I think the right fix is to remove the unsigned long specialization, see what breaks and then add the necessary casts.
Comment 5 Brian Burg 2014-05-31 16:59:41 PDT
(In reply to comment #4)
> (From update of attachment 232284 [details])
> I think it's wrong that there are traits for unsigned long. We should only encode/decode explicitly sized types.
> 
> I think the right fix is to remove the unsigned long specialization, see what breaks and then add the necessary casts.

Sounds like the right fix to me. IIRC, the only unsigned long is for encode/decode network request identifiers, which haven't landed yet anyway (but have been up for review for a long time).
Comment 6 Csaba Osztrogonác 2014-06-04 03:00:19 PDT

*** This bug has been marked as a duplicate of bug 133430 ***