Skip to content

Commit

Permalink
configure: pull ahead gcc-sysroot processing
Browse files Browse the repository at this point in the history
the sysroot flags need to be established even before setting up the
spec, because as soon as that happens, toolchain.prf will try to
determine the default paths and cache them.

this also fixes sysroot use in toolchain flag support tests, which run
(somewhat) independently from the toolchain setup.

Task-number: QTBUG-63483
Change-Id: I7be1540e766dac58fb16f63176aa8d2879b51ae0
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
ossilator committed Jul 13, 2018
1 parent 7d05144 commit 3303715
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@

"testTypeDependencies": {
"linkerSupportsFlag": [ "use_gold_linker" ],
"verifySpec": [ "shared", "use_gold_linker", "compiler-flags", "gcc-sysroot", "qmakeargs", "commit" ],
"verifySpec": [ "shared", "use_gold_linker", "compiler-flags", "qmakeargs", "commit" ],
"compile": [ "verifyspec" ],
"detectPkgConfig": [ "cross_compile", "machineTuple" ],
"library": [ "pkg-config" ],
Expand Down Expand Up @@ -518,6 +518,7 @@

"features": {
"prepare": {
"condition": "features.gcc-sysroot || true",
"output": [ "prepareSpec", "prepareOptions", "preparePaths", "reloadSpec" ]
},
"machineTuple": {
Expand Down
4 changes: 4 additions & 0 deletions configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,10 @@ defineTest(qtConfOutput_gccSysroot) {
"\"QMAKE_LFLAGS += --sysroot=$$config.input.sysroot\""
export(EXTRA_QMAKE_ARGS)

# This one is for qtConfToolchainSupportsFlag().
QMAKE_CXXFLAGS += --sysroot=$$config.input.sysroot
export(QMAKE_CXXFLAGS)

output = \
"!host_build {" \
" QMAKE_CFLAGS += --sysroot=\$\$[QT_SYSROOT]" \
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/qt_configure.prf
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ defineReplace(qtConfToolchainSupportsFlag) {
conftest = "int main() { return 0; }"
write_file("$$test_out_dir/conftest.cpp", conftest)|error()

qtRunLoggedCommand("$$test_cmd_base $$QMAKE_CXX $${1} -o conftest-out conftest.cpp"): \
qtRunLoggedCommand("$$test_cmd_base $$QMAKE_CXX $$QMAKE_CXXFLAGS $${1} -o conftest-out conftest.cpp"): \
return(true)
return(false)
}
Expand Down

0 comments on commit 3303715

Please sign in to comment.