9

I am using clang 3.5 as distributed by them. I'm using the following command lines to install it in my travis vm:

sudo apt-add-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'
sudo apt-add-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'

When I run my test build with optimizations turned on, I get this error:

clang: error: optimization flag '-finline-functions' is not supported
  "clang++" -c -x c++ -std=c++1y -Werror -O3 -finline-functions -Wno-inline -Wall -Werror -pthread -fPIC -std=c++1y -DBOOST_ALL_DYN_LINK -DNDEBUG -I"." -I"gamgee" -I"lib/htslib" -o "test/bin/run.test/clang-linux-3.5.0/release/threading-multi/sam_builder_test.o" "test/sam_builder_test.cpp"

I don't get the same error on my mac which runs the older 3.4 version of clang.

Has clang cut support to -finline-functions in 3.5? Is this something specific about this package build? How should one substitute the -finline-functions option for optimized builds with clang-3.5+?

1 Answer 1

13

See this commit: http://llvm.org/klaus/clang/commit/6590426aeb5275ec33dac2877f9349bbbb2d4b2e/#0-L-571

Previously, that flag was ignored and the user was not notified. Now the user is notified that it is ignored. You shouldn't have seen any difference in the code generation with or without that flag.

It should only be a warning, but you've upgraded it to an error with -Werror.

2
  • Can you share or point in the right direction why is it being ignored? Is it osx only or there must be a precondition for it to not be ignored? Feb 21, 2017 at 16:22
  • I have no idea.
    – Bill Lynch
    Feb 21, 2017 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.