Skip to content
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

Upgrade LLVM toolchain to version 13 #1152

Merged
merged 2 commits into from
Dec 17, 2021
Merged

Conversation

senderista
Copy link
Contributor

This is motivated in the long term by new features in clang-format, clang-tidy, and the sanitizers that we would like to use, and in the short term by some TSan bugs I'm dealing with that are fixed post-LLVM 10.

This was more painful than necessary because we don't have centralized definitions for the various toolchain variables. Rather than solve this additional problem in the current PR, I created https://gaiaplatform.atlassian.net/browse/GAIAPLAT-1829 to address it.

Copy link
Contributor

@chuan chuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am already using clang 13 for my local build. I am glad we can all upgrade to the newer version.

Copy link
Contributor

@simone-gaia simone-gaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice stuff! Some minor comments.

@@ -1,6 +1,4 @@
[apt]
clang-format-10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing without updating?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this file is going away (probably today) in another PR.

@@ -7,6 +7,6 @@

gaiac -g hello.ddl -d hello -o .

gaiat hello.ruleset -output hello_ruleset.cpp -- -I /usr/lib/clang/10/include -I /opt/gaia/include
gaiat hello.ruleset -output hello_ruleset.cpp -- -I /usr/include/clang/10 -I /opt/gaia/include
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vDonGlover don't you have some doc that refer the same stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this command line still references clang-10, I just tweaked the intrinsics include dir a bit because I thought this path was friendlier.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simone-gaia In the hello tutorial we have
gaiat hello.ruleset -output hello_ruleset.cpp -- -I /usr/lib/clang/10/include/ -I /opt/gaia/include/ -I hello
Will it still work or does it need to be updated (and when)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't strictly need to be updated, I just thought it was a bit less surprising to have an include path under /usr/include rather than /usr/lib...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customers can still use clang-10; this is only our internal builds, correct? Note also that this doesn't affect gaiat; it's building its own fork of llvm/clang and this is still clang-8, I believe. So, this change should have no affect on customers. @senderista if I'm wrong about this, please let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right; this should have no customer impact at all.

@@ -1,6 +1,4 @@
[apt]
clang-format-10
clang-tidy-10
{enable_if('GaiaRelease')}debhelper
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were moved into third_party/production/cmake/gdev.cfg for consistency with the rest of the LLVM toolchain, and (unfortunately) out of the [apt] section and into the [run] section (because LLVM-13 packages aren't in the default Ubuntu 20.04 repositories).

@senderista
Copy link
Contributor Author

senderista commented Dec 17, 2021

Another thing I plan to do in a later PR: there's no reason we shouldn't be able to use libstdc++ in Debug builds, or libc++ in Release builds. I will introduce a new top-level option, say GAIA_STDLIB, which will default to libc++ in Debug builds and libstdc++ in Release builds, and directly condition on that when choosing a stdlib, rather than conditioning on build type. That way you can just override that option when you want a non-default build type/stdlib configuration.

Edit: created https://gaiaplatform.atlassian.net/browse/GAIAPLAT-1830 to track this.

@@ -29,9 +29,11 @@ install(TARGETS gaia DESTINATION ${CMAKE_INSTALL_LIBDIR})
# a production only (non-gaia release) build.
#
set(SDK_TEST_INCLUDES
${GAIA_INC}
# REVIEW: the first 2 includes shouldn't be necessary because they're exported
# by INTERFACE targets.
${GAIA_PROD_BUILD}/deps/gaia_spdlog/include
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add these when I was trying to get the SDK_TEST building again. If we can remove them, that would be good but for some reason that wasn't working for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When building apps from the SDK, these headers sit under opt/gaia/include/... and so they get picked up just by setting /opt/gaia/include/ as the include path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I briefly tried to get this working, but failed for some reason and I didn't have time to pursue it further, hence the comment.

Copy link
Contributor

@daxhaw daxhaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Might want to ping @fineg74 just to make sure changes to the gaiat make files look okay to him as well. (They seemed fine to me).

@senderista senderista merged commit efb1055 into master Dec 17, 2021
@senderista senderista deleted the tobin/upgrade_llvm_toolchain branch December 17, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants