Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No support to -finline-functions in clang 3.5?

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+?

like image 726
Carneiro Avatar asked Sep 29 '14 20:09

Carneiro


People also ask

Does Clang fully support C ++ 20?

Clang has support for some of the features of the ISO C++ 2020 standard. You can use Clang in C++20 mode with the -std=c++20 option (use -std=c++2a in Clang 9 and earlier).

Is GCC better than Clang?

GCC supports more traditional languages than Clang and LLVM, such as Ada, Fortran, and Go. GCC supports more less-popular architectures, and supported RISC-V earlier than Clang and LLVM. GCC supports more language extensions and more assembly language features than Clang and LLVM.

Is Clang GCC compatible?

The Clang driver is intended to be a production quality compiler driver providing access to the Clang compiler and tools, with a command line interface which is compatible with the gcc driver.

How do I use GCC instead of Clang?

If you want to use clang instead of GCC, you can add -DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++ . You can also use ccmake , which provides a curses interface to configure CMake variables.


1 Answers

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.

like image 174
Bill Lynch Avatar answered Oct 21 '22 06:10

Bill Lynch