This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=f3d0fb4bdc0f8fff28fa98122bfd19eea46a9570 commit f3d0fb4bdc0f8fff28fa98122bfd19eea46a9570 Author: Guillem Jover <guil...@debian.org> AuthorDate: Fri Sep 1 00:27:44 2023 +0200 doc: Clarify compiler flag variables are for the host When cross-compiling, these flags should only be passed to the host tools, and not the build tools. --- man/dpkg-buildflags.pod | 30 ++++++++++++++++++++---------- scripts/mk/buildflags.mk | 23 ++++++++++++----------- scripts/t/mk/buildflags.mk | 4 ++-- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/man/dpkg-buildflags.pod b/man/dpkg-buildflags.pod index 9e602fbfa..4cedd0b24 100644 --- a/man/dpkg-buildflags.pod +++ b/man/dpkg-buildflags.pod @@ -259,49 +259,59 @@ Show the version and exit. =item B<ASFLAGS> -Options for the assembler. Default value: empty. Since dpkg 1.21.0. +Options for the host assembler. +Default value: empty. +Since dpkg 1.21.0. =item B<CFLAGS> -Options for the C compiler. The default value set by the vendor +Options for the host C compiler. +The default value set by the vendor includes B<-g> and the default optimization level (B<-O2> usually, or B<-O0> if the B<DEB_BUILD_OPTIONS> environment variable defines I<noopt>). =item B<CPPFLAGS> -Options for the C preprocessor. Default value: empty. +Options for the host C preprocessor. +Default value: empty. =item B<CXXFLAGS> -Options for the C++ compiler. Same as B<CFLAGS>. +Options for the host C++ compiler. +Same as B<CFLAGS>. =item B<OBJCFLAGS> -Options for the Objective C compiler. Same as B<CFLAGS>. +Options for the host Objective C compiler. +Same as B<CFLAGS>. Since dpkg 1.17.7. =item B<OBJCXXFLAGS> -Options for the Objective C++ compiler. Same as B<CXXFLAGS>. +Options for the host Objective C++ compiler. +Same as B<CXXFLAGS>. Since dpkg 1.17.7. =item B<DFLAGS> -Options for the D compiler (ldc or gdc). Since dpkg 1.20.6. +Options for the host D compiler (ldc or gdc). +Since dpkg 1.20.6. =item B<FFLAGS> -Options for the Fortran 77 compiler. A subset of B<CFLAGS>. +Options for the host Fortran 77 compiler. +A subset of B<CFLAGS>. =item B<FCFLAGS> -Options for the Fortran 9x compiler. Same as B<FFLAGS>. +Options for the host Fortran 9x compiler. +Same as B<FFLAGS>. Since dpkg 1.17.7. =item B<LDFLAGS> -Options passed to the compiler when linking executables or shared +Options passed to the host compiler when linking executables or shared objects (if the linker is called directly, then B<-Wl> and diff --git a/scripts/mk/buildflags.mk b/scripts/mk/buildflags.mk index bfb99f94b..28d37765f 100644 --- a/scripts/mk/buildflags.mk +++ b/scripts/mk/buildflags.mk @@ -1,15 +1,16 @@ -# This Makefile fragment (since dpkg 1.16.1) defines the following variables: +# This Makefile fragment (since dpkg 1.16.1) defines the following host +# variables: # -# ASFLAGS: flags for the assembler (since 1.21.0). -# CFLAGS: flags for the C compiler. -# CPPFLAGS: flags for the C preprocessor. -# CXXFLAGS: flags for the C++ compiler. -# OBJCFLAGS: flags for the Objective C compiler. -# OBJCXXFLAGS: flags for the Objective C++ compiler. -# DFLAGS: flags for the D compiler. -# FFLAGS: flags for the Fortran 77 compiler. -# FCFLAGS: flags for the Fortran 9x compiler. -# LDFLAGS: flags for the linker. +# ASFLAGS: flags for the host assembler (since 1.21.0). +# CFLAGS: flags for the host C compiler. +# CPPFLAGS: flags for the host C preprocessor. +# CXXFLAGS: flags for the host C++ compiler. +# OBJCFLAGS: flags for the host Objective C compiler. +# OBJCXXFLAGS: flags for the host Objective C++ compiler. +# DFLAGS: flags for the host D compiler. +# FFLAGS: flags for the host Fortran 77 compiler. +# FCFLAGS: flags for the host Fortran 9x compiler. +# LDFLAGS: flags for the host linker. # # You can also export them in the environment by setting # DPKG_EXPORT_BUILDFLAGS to a non-empty value. diff --git a/scripts/t/mk/buildflags.mk b/scripts/t/mk/buildflags.mk index c5d0abb46..7418cda6e 100644 --- a/scripts/t/mk/buildflags.mk +++ b/scripts/t/mk/buildflags.mk @@ -1,11 +1,11 @@ -DEB_CPPFLAGS_MAINT_APPEND = -DTEST_MK=test +DEB_CPPFLAGS_MAINT_APPEND = -DTEST_MK=test-host include $(srcdir)/mk/buildflags.mk test: test "$(ASFLAGS)" = "$(TEST_ASFLAGS)" test "$(CFLAGS)" = "$(TEST_CFLAGS)" - test "$(CPPFLAGS)" = "$(TEST_CPPFLAGS) -DTEST_MK=test" + test "$(CPPFLAGS)" = "$(TEST_CPPFLAGS) -DTEST_MK=test-host" test "$(CXXFLAGS)" = "$(TEST_CXXFLAGS)" test "$(DFLAGS)" = "$(TEST_DFLAGS)" test "$(FCFLAGS)" = "$(TEST_FCFLAGS)" -- Dpkg.Org's dpkg