Passing a gcc flag through makefile

前端 未结 3 760
清歌不尽
清歌不尽 2020-12-05 19:44

I am trying to build a pass using llvm and I have finished building llvm and its associated components. However, when I run make after following all the steps to build a pas

3条回答
  •  借酒劲吻你
    2020-12-05 20:08

    If you are moderately convinced that you should use '-fPIC' everywhere (or '-m32' or '-m64', which I need more frequently), then you can use the 'trick':

    CC="gcc -fPIC" ./configure ...
    

    This assumes a Bourne/Korn/POSIX/Bash shell and sets the environment variable CC to 'gcc -fPIC' before running the configure script. This (usually) ensures that all compilations are done with the specified flags. For setting the correct 'bittiness' of the compilation, this sometimes works better than the various other mechanisms you find - it is hard for a compilation to wriggle around it except by completely ignoring the fact you specified the C compiler to use.

提交回复
热议问题