-
Notifications
You must be signed in to change notification settings - Fork 175
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
build: update clang-fetcher with libcxx headers and object paths #703
Conversation
Codecov Report
@@ Coverage Diff @@
## master #703 +/- ##
==========================================
- Coverage 69.39% 65.50% -3.90%
==========================================
Files 11 12 +1
Lines 575 629 +54
Branches 118 125 +7
==========================================
+ Hits 399 412 +13
- Misses 135 175 +40
- Partials 41 42 +1
Continue to review full report at Codecov.
|
|
||
const cxxflags = [ | ||
'-nostdinc++', | ||
'-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS', |
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.
FYI: with roll electron/electron#29895 , this macro should be removed in favor of including the __config_site
file from the root of libcxx
header file. electron/electron@797723e
Another FYI: libcxx objects built for testing and release are different in terms of the compiler and linker flags used, specifically on linux ThinLTO is used. If we don't use the lto flags https://source.chromium.org/chromium/chromium/src/+/main:build/config/compiler/BUILD.gn;l=640-727 to build the native module then miscompile can happen. For ex, compile the following program with the compile and linker flags from this PR, the result will be zero due to miscompilation. Originally caught in microsoft/vscode#129360, I would suggest to find a concrete way to export compiler flags from electron build, probably bundle #include <string>
#include <sstream>
int main() {
std::string message = "Hello";
uint32_t count = 0;
std::stringstream final_value;
final_value << count;
final_value.write(message.data(), message.size());
printf("Result : %lu", final_value.str().size());
return 0;
} |
Taking another stab at this in light of #832, may close this PR in favor of a new one. |
The accompanying PR to 29281 in Electron.
Beginning in Electron 13, several nan tests began failing due to an incompatibility between libc++ and libstdc++. This, in turn, could affect any native dependencies built by users using nan. We will now build these native dependencies against libc++ to fix this and prevent future incompatibilities, by copying some of the relevant build arguments from Electron into our nan test runner.
Electron 13 and up now build libc++ and libc++abi as static libraries for Mac and Linux. The relevant zipped headers for these libraries are also checked and uploaded per release - this PR updates
electron-rebuild
with these build changes, and use the zipped headers to apply them.TODO: