Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1265438

Bug#1117682: debtoolchainfilegen: include *_FOR_BUILD flags in toolchain file

From Timo Röhling <roehling@debian.org>
Newsgroups linux.debian.bugs.dist
Subject Bug#1117682: debtoolchainfilegen: include *_FOR_BUILD flags in toolchain file
Date 2025-10-09 23:50 +0200
Message-ID <LE6Gl-3Zm2-5@gated-at.bofh.it> (permalink)
References <LE1nj-3VZo-5@gated-at.bofh.it> <LE1nj-3VZo-5@gated-at.bofh.it>
Organization The Debian Project

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Control: tags -1 + moreinfo

Hi Fabian,

On Thu, 09 Oct 2025 17:58:55 +0200 Fabian Greffrath <fabian@debian.org> 
wrote:
> the /usr/share/cmake/debtoolchainfilegen tool comes handy to create a 
> toolchain file for cross-building. However, when cross-building is 
> involved, it is often a good idea to reset the build flags for the 
> compilers and linkers - or at least reduce them to a subset that is 
> known to work on the build architecture.
>
> That's what the *_FOR_BUILD flags are for.
>
> I'd suggest to include these flags in the toolchain file generated by 
> debtoolchainfilegen, in the same form that they are emitted by 
> dpkg-buildflags. Either always, or only if a parameter (say '-f') is 
> additionally given to debtoolchainfilegen.
>
> Example:
> set(CMAKE_C_FLAGS "$ENV{CFLAGS_FOR_BUILD} $ENV{CPPFLAGS_FOR_BUILD}")
> set(CMAKE_EXE_LINKER_FLAGS "$ENV{LDFLAGS_FOR_BUILD}")
>
> Thanks for considering!

[Cc'ing Helmut because he wrote the debtoolchainfilegen tool and can 
probably fill in the blanks in my understanding]

AFAICT, the generated config is supposed to be used for the host 
compiler, so I'm not entirely sure I understand how the *_FOR_BUILD 
flags fit into the picture here. I am open to improvements for the 
cross-build use-case, though.


Cheers
Timo

-- 
⢀⣴⠾⠻⢶⣦⠀   ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁   │ Timo Röhling                                       │
⢿⡄⠘⠷⠚⠋⠀   │ 9B03 EBB9 8300 DF97 C2B1  23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀   ╰────────────────────────────────────────────────────╯

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#1117682: debtoolchainfilegen: include *_FOR_BUILD flags in toolchain file Fabian Greffrath <fabian@debian.org> - 2025-10-09 18:10 +0200
  Bug#1117682: debtoolchainfilegen: include *_FOR_BUILD flags in toolchain file Timo Röhling <roehling@debian.org> - 2025-10-09 23:50 +0200
    Bug#1117682: debtoolchainfilegen: include *_FOR_BUILD flags in toolchain file Helmut Grohne <helmut@subdivi.de> - 2025-10-13 12:50 +0200
      Bug#1117682: debtoolchainfilegen: include *_FOR_BUILD flags in toolchain file Timo Röhling <roehling@debian.org> - 2025-11-11 13:30 +0100

csiph-web