Skip to content

Conversation

@amazingfate
Copy link

I'm doing packaging for debian these days, and I find there are missing flags when compiling:
https://salsa.debian.org/amazingfate/moonlight-qt/-/jobs/7624590

I'm using qmake6 as buildsystem supported by debhelper. There are very few qt6 projects that is using qmake6, but there is a package doesn't have this issue: https://codeberg.org/ltworf/explosive-c4/src/branch/master/debian/rules.

Now I find that it is sub dir not supporting QMAKE FLAGS passed from parent project.

debhelper is using the following qmake command:

qmake6 -makefile "QMAKE_CFLAGS_RELEASE=-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=$PWD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "QMAKE_CFLAGS_DEBUG=-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=$PWD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "QMAKE_CXXFLAGS_RELEASE=-g -O2 -ffile-prefix-map=$PWD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "QMAKE_CXXFLAGS_DEBUG=-g -O2 -ffile-prefix-map=$PWD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "QMAKE_LFLAGS_RELEASE=-Wl,-z,relro -Wl,-z,now" "QMAKE_LFLAGS_DEBUG=-Wl,-z,relro -Wl,-z,now" QMAKE_STRIP=: PREFIX=/usr

But at subdir qmake is not setting flags like QMAKE_CFLAGS_RELEASE with debian's default hardening flags like fstack-protector-strong. So I allow accepting QMAKE FLAGS from env so that all subdir projects can receive the flags set by debhelper.

@cgutman
Copy link
Member

cgutman commented Oct 21, 2025

This approach doesn't appear to work for me when I try it. The variables aren't getting propagated to the compiler/linker when I use the example qmake command you've provided.

@amazingfate
Copy link
Author

This approach doesn't appear to work for me when I try it. The variables aren't getting propagated to the compiler/linker when I use the example qmake command you've provided.

It seems that QMAKE_CFLAGS_RELEASE is a env used by dh_build. Passing it to qmake command won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants