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

Fixes for building with clang. #140

Merged
merged 4 commits into from
Jan 29, 2017
Merged

Conversation

marsupial
Copy link
Contributor

@marsupial marsupial commented Jan 5, 2017

Description of Change(s)

Use constructor/destructor attributes to add to ELF's .init .fini sections.
Enable pause instruction on Intel CPU built with clang.
Only add -Wno-unused-local-typedefs if clang version is > 3.5.

Fixes Issue(s)

ARCH_CONSTRUCTOR/ARCH_DESTRUCTOR not being called when built with clang on Linux.
ArchThreadPause doing nothing built with clang.
Tons of warning related to -Wno-unused-local-typedefs not being understood.

@sunyab
Copy link
Contributor

sunyab commented Jan 6, 2017

Hi @marsupial, we ask that all contributors sign a CLA before we can accept their changes. Once we receive a signed CLA we can have a look at merging your pull requests in. You can find the necessary info at the top of this page:

http://openusd.org/docs/Contributing-to-USD.html

Also, our convention is for the 'master' branch to contain only released changes and to have all new changes to go into the 'dev' branch. Could you change the base branch of your pull requests to the 'dev' branch instead?

https://github.com/blog/2224-change-the-base-branch-of-a-pull-request

Thank you!

@marsupial marsupial changed the base branch from master to dev January 10, 2017 18:12
@marsupial marsupial changed the title Enable pause instruction with clang. Fixes for building with clang. Jan 13, 2017
@@ -42,8 +42,14 @@ endif()
_disable_warning("deprecated")
_disable_warning("deprecated-declarations")

# Suppress unused typedef warnings emanating from boost.
_disable_warning("unused-local-typedefs")
# Suppress unused typedef warnings eminating from boost.
Copy link
Contributor

Choose a reason for hiding this comment

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

@marsupial: Hi, are the version checks here because -no-unused-local-typedefs was introduced in clang 3.6? If so, would this be better expressed as "... OR NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6" (and similar for the AppleClang version check)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, and there's a typo that was introduced here -- it should be "emanating" not "eminating".

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 fixed the typo.
Perhaps I'm not understanding it right, but the other request seems a more confusing logic.

Instead of if (!clang || clang > 3.5), you'd like if (!clang || !(clang < 3.6))?

Copy link
Contributor

Choose a reason for hiding this comment

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

So what I'm really trying to get at is I think the check ought to be if (!clang || clang >= 3.6), since no-unused-local-typedefs was introduced in 3.6. The check for (clang > 3.5) allows 3.5.x to pass, which I don't think is correct.

Unfortunately, cmake doesn't provide a VERSION_GREATER_OR_EQUAL, so "NOT ... VERSION_LESS 3.6" was the most succinct alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@pixar-oss pixar-oss merged commit 37911d7 into PixarAnimationStudios:dev Jan 29, 2017
pixar-oss added a commit that referenced this pull request Jan 29, 2017
Fixes for building with clang.
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Oct 11, 2022
…udios#140)

* Fix warning on glBindTextures
* Fix build break with custom install path
* Fix build break on Linux with clang11
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.

3 participants