RESOLVED FIXED 133266
CSS JIT: Fix build error raised when CSS_SELECTOR_JIT_DEBUGGING is 1
https://bugs.webkit.org/show_bug.cgi?id=133266
Summary CSS JIT: Fix build error raised when CSS_SELECTOR_JIT_DEBUGGING is 1
Yusuke Suzuki
Reported 2014-05-25 11:13:39 PDT
Currently, when CSS_SELECTOR_JIT_DEBUGGING is 1, build erros occur on x86_64 environment.
Attachments
Patch (1.67 KB, patch)
2014-05-25 11:15 PDT, Yusuke Suzuki
no flags
Patch (3.66 KB, patch)
2014-05-25 11:16 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2014-05-25 11:15:11 PDT
Yusuke Suzuki
Comment 2 2014-05-25 11:15:49 PDT
Comment on attachment 232040 [details] Patch Oops. upload miss.
Yusuke Suzuki
Comment 3 2014-05-25 11:16:15 PDT
Yusuke Suzuki
Comment 4 2014-05-25 11:18:54 PDT
Comment on attachment 232041 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232041&action=review Added comments > Source/WebCore/cssjit/SelectorCompiler.cpp:181 > + static const Assembler::RegisterID callFrameRegister; These are declaration, not definition (C++). So referencing them with const reference (const T&) causes link error, "undefined reference to XXX". > Source/WebCore/cssjit/SelectorCompiler.cpp:267 > +const Assembler::RegisterID SelectorCodeGenerator::callFrameRegister = JSC::GPRInfo::callFrameRegister; Added definitions. > Source/WebCore/cssjit/SelectorCompiler.cpp:949 > + prologueRegister.append(callFrameRegister); Since Vector::append referencing the argument as const T&, just replacing `GPRInfo::callFrameRegister` to `JSC::GPRInfo::callFrameRegister` causes link errors. http://stackoverflow.com/questions/5391973/undefined-reference-to-static-const-int http://stackoverflow.com/questions/272900/undefined-reference-to-static-class-member http://stackoverflow.com/questions/3025997/c-defining-static-const-integer-members-in-class-definition
Darin Adler
Comment 5 2014-05-25 12:49:46 PDT
Comment on attachment 232041 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232041&action=review >> Source/WebCore/cssjit/SelectorCompiler.cpp:181 >> + static const Assembler::RegisterID callFrameRegister; > > These are declaration, not definition (C++). So referencing them with const reference (const T&) causes link error, "undefined reference to XXX". I would expect to see that problem only when using an old C++ compiler; the status of these has changed in C++11. What compiler were you seeing this with?
Yusuke Suzuki
Comment 6 2014-05-25 18:17:09 PDT
(In reply to comment #5) > (From update of attachment 232041 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=232041&action=review > > >> Source/WebCore/cssjit/SelectorCompiler.cpp:181 > >> + static const Assembler::RegisterID callFrameRegister; > > > > These are declaration, not definition (C++). So referencing them with const reference (const T&) causes link error, "undefined reference to XXX". > > I would expect to see that problem only when using an old C++ compiler; the status of these has changed in C++11. What compiler were you seeing this with? Oh, I didn't know that! I'm using a default compiler on Ubuntu 14.04, the result of `gcc --version` is the following. gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
WebKit Commit Bot
Comment 7 2014-05-26 17:19:49 PDT
Comment on attachment 232041 [details] Patch Clearing flags on attachment: 232041 Committed r169363: <http://trac.webkit.org/changeset/169363>
WebKit Commit Bot
Comment 8 2014-05-26 17:19:52 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.