-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to pass CC or CFLAGS #1072
Comments
It would be helpful to know what you're trying to do. See |
I tried: CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local and CFLAGS="-flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXXFLAGS="-flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local ..but it didn't seem to use either CC or CFLAGS during the build |
Ah. You can probably do:
|
Hmm, thanks - I should have thought of that... There seems to be a problem with libvpx - with plain "make", the build succeeds. With make CFLAGS='-flto -fuse-linker-plugin -mtune=generic -Os -pipe' CXXFLAGS='-flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti', the build fails with many errors of the form: mkdir -p vpx_ports/ |
I doubt anyone will offer much help with custom compilation options; that's definitely something that you should figure out if you want a custom build. At minimum, I think you should try compiling the latest master branch instead of 1.0.x, which is stated to be replaced with the former very soon. You may want to look at /~https://github.com/HandBrake/HandBrake/blob/master/contrib/libvpx/module.defs and similar to see how HandBrake's build system works. You can see how to override environment variables like CFLAGS ( |
@juanitotc I know this is a 4 year old thread, but just wanted to chime in here that I've just gone through the endeavour and that using CFLAGS and CXXFLAGS are NOT the recommended way of passing compiler flags for HandBrake due to its idiosyncracies. Handbrake is just a front-end to a LOT of "crontrib". To see how each contrib module is built, you can leverage the "make" reports for each contrib in the build or destination directory, before making them. e.g.
On each line, first column above, you'll see each report. you can then access the reports by Where you replace It is important to note, there's a hierarchy and inheritance to the above even within each report. In my case, I chose to configure the build using "speed" previously... Which maps to Another important key in that report is You can override the above by creating a text file configuration called "custom.defs" in the root of the handbrake source folder (if you git cloned it, then the top folder of HandBrake where you basically do your git pull commands).
I do FDO (feedback-directed optimisation aka FDO aka PGO) in mine so I usually build first with
Then run HandBrake transcoding several videos with varying codecs for a couple of days to generate profiles.
on a brand new build directory. You can fine tune the compiler flags and optimisation for each module by using the reporting process I described above for each module and overriding the keys by quoting them in the For all of the above to work, remember not to have exported CFLAGS or CXXFLAGS. You can check what flags you have setup in your bash session by: LTO + FDO:
20% Improvrement with LTO + PGO from above!
|
I edited the above |
I have added the above to unix-stackexchange here: https://unix.stackexchange.com/a/655387/134742 |
Updated the training custom.defs options by adding: That will help ensure no clobbering happens of profile data from multiple threads. |
Added new answer for v1.4.0 in stackexchange... It provides the process for both GCC and LLVM/CLANG/LLD in Linux. |
Is there a way to pass CC or CFLAGS so that they are used to build for the downloaded/built-in libs and ghb/handbrake-cli?
The text was updated successfully, but these errors were encountered: