File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,14 @@ cross-compiling you must ensure to use the appropriate `objcopy` for the target
251
251
architecture. The ` BINUTILS_TARGET_PREFIX ` environment variable can be used to
252
252
set the objcopy of choice, for example, ` arm-linux-gnueabihf ` .
253
253
254
+ LTO Support
255
+ -----------
256
+
257
+ In some situations it is desirable to pass certain flags to clang in the step that
258
+ produces the bitcode. This can be fulfilled by setting the
259
+ ` LLVM_BITCODE_GENERATION_FLAGS ` environment variable to the desired
260
+ flags, for example ` "-flto -fwhole-program-vtables" ` .
261
+
254
262
Debugging
255
263
---------
256
264
Original file line number Diff line number Diff line change @@ -74,7 +74,14 @@ Extract the bitcode.
74
74
>ls -la httpd.bc
75
75
-rw-r--r-- 1 vagrant vagrant 1119584 Aug 4 20:02 httpd.bc
76
76
```
77
+ > Note that in httpd-2.4.41, the binary of ` httpd ` is under directory ".libs",
78
+ > in that case, please cd into ".libs" then execute the command.
77
79
80
+ ```
81
+ cd .libs
82
+ ls -la httpd
83
+ extract-bc httpd
84
+ ```
78
85
## Step 6.
79
86
80
87
Turn the bitcode into a second executable binary. (optional -- just for fun and sanity checking)
Original file line number Diff line number Diff line change @@ -202,7 +202,13 @@ def getCommand(self):
202
202
class ClangBuilder (BuilderBase ):
203
203
def getBitcodeCompiler (self ):
204
204
cc = self .getCompiler ()
205
- return cc + ['-emit-llvm' ]
205
+ retval = cc + ['-emit-llvm' ]
206
+ # iam: If the environment variable LLVM_BITCODE_GENERATION_FLAGS is set we will add them to the
207
+ # bitcode generation step
208
+ bitcodeFLAGS = os .getenv ('LLVM_BITCODE_GENERATION_FLAGS' )
209
+ if bitcodeFLAGS :
210
+ retval = retval + bitcodeFLAGS .split ()
211
+ return retval
206
212
207
213
def getCompiler (self ):
208
214
if self .mode == "wllvm++" :
You can’t perform that action at this time.
0 commit comments