Currently, QtWebEngine will fail to build when security flags (PIE in particular) are enabled. This is this error you will hit:
error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)." _| # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "_ | ^~~~~
If you add -fPIC to the QMake flags (or set linux_fpic=1 in the gyp flags), this error will go away but the build will fail later on with linker errors due to some but not all components being built with -fPIC. I spent a bit of time on this but it will need more time for a real fix.
QtWebEngine bundles in many third-party libraries using gyp, and my best guess is that some of the libraries don't see the -fPIC flags, so you get a mismatch between binaries with and without -fPIC.
Finally, QtWebEngine currently skips the QA check for text relocations, probably do to this issue. Text relocations are going to cause performance degradation and memory more memory usage, so that's another reason to fix the issue besides security. Once the issue is fixed, we should try re-enabling the QA check, and my best guess is it will succeed.
Environment
None
Activity
Walt Miner
December 17, 2018 at 11:49 PM
Re-assign to Juan. Is this still an issue or something we should fix?
Stephane Desneux
April 24, 2017 at 10:21 PM
Re-assigned to @Risto Avila.
Risto, have you heard from such a problem ? I remember some problems with linkers (ld vs. gold) and PIE stuff in older versions of Chromium but I'm not sure if the problem is now on Qt side or Chromium side.
Currently, QtWebEngine will fail to build when security flags (PIE in particular) are enabled. This is this error you will hit:
error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."
_| # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "_
| ^~~~~
If you add -fPIC to the QMake flags (or set linux_fpic=1 in the gyp flags), this error will go away but the build will fail later on with linker errors due to some but not all components being built with -fPIC. I spent a bit of time on this but it will need more time for a real fix.
QtWebEngine bundles in many third-party libraries using gyp, and my best guess is that some of the libraries don't see the -fPIC flags, so you get a mismatch between binaries with and without -fPIC.
Finally, QtWebEngine currently skips the QA check for text relocations, probably do to this issue. Text relocations are going to cause performance degradation and memory more memory usage, so that's another reason to fix the issue besides security. Once the issue is fixed, we should try re-enabling the QA check, and my best guess is it will succeed.