-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MacOS build #7009
base: master
Are you sure you want to change the base?
Fix MacOS build #7009
Conversation
It looks like |
@ppenzin This code snippet exists since the "First Commit" and caused some build issues before (See 11a6851 and 4398657). I don't understand why it exists in the first place because according to this gcc docs:
|
These declarations do look like a kludge, for sure. @ShortDevelopment, do you have an idea why wasm spec test failed with this change? I wonder if there is more to this story, @rhuanjl, do you have any recollection on whether or not it is really needed for debugging? There are better methods to get placement new and delete operators if that is what this was supposed to achieve.. |
It definitely looks like a fudge - I'm afraid I don't know its intent. I may be misunderstanding- but I think the comment is actually saying this is Not Needed for the debugger extension (a different compile target?) but, implicitly, is needed for a normal CC build. The test fail at first glance seems to be a real error of some kind, though would need to dig to understand it. |
Chakracore has never compiled with GCC, it's always needed clang on Linux/macos - I don't know if that's relevant to this issue but could be. (Thought prompted by your ref to the GCC docs) |
If I correctly understand this PR on clang a custom declaration of the inline placement new operator could lead to (slightly) lower build / debug times because the stl |
These macros aid compiler in various ways, in libcxx PR they are defining one that tells compiler placement new has been defined, the one Allocator.h has seems to imply inlining of the operator (though I don't know which compiler that is for). I think deleting custom placement operator and using a standard one is OK as long as the rest of the CI is passing. |
All checks are passing now although I did only add a comment and move the Might this be an existing bug in the codebase? |
Placement of include can have some effect, though this might be just a spurious failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine. @rhuanjl what do you think?
Problem
MacOs builds using latest
icu4c
fail because the "placement new operator" is defined in the standard-library and inAllocator.h
.The use of
__attribute__((visibility("hidden")))
(SeeNO_EXPORT
) used to prevent these linking conflicts but thenew
header is now included through latesticu4c
into the same compilation unit:Potential Solution
As this specific
new
overload is part of the standard-library it might be okay to just remove the custom declaration in CC and always#include <new>
instead.Fixes #7007