Re: Why does dpkg-shlibdeps look at the target architecture?

Guillem Jover <[email protected]>
Newsgroups gmane.linux.debian.ports.hurd,gmane.linux.debian.devel.dpkg.general
Message-ID <[email protected]>
Hi!

On Wed, 2025-07-09 at 12:39:12 +0200, Raphael Hertzog wrote:
> On Wed, 09 Jul 2025, Helmut Grohne wrote:
> > In Dpkg/Shlibs.pm in sub setup_library_paths, there is the following 
> > code:
> [...]
> > It is not clear to us, why that first branch exists. It was originally 
> > added by Raphaël in support of cross compilation and later changed a 
> > couple of times.
> 
> So this part was added as part of the discussion in this bug report:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453267

Right, was about to post the same reference. :)

> >From what I remember, that first branch was specifically in support
> of building cross compilers.

I agree that this code does not look correct…

> I don't have recent knowledge of cross-building and cross-compilers
> so I have no idea whether that's still useful in some cases or not.

…and from a quick skim over that report, I think this might have been
needed to support old gcc versions that had not yet been fixed to
use the expected variables (see messages #73 and forward)? (But this
was really a quick skim, so might have read the details wrong, as the
report is quite long.) Will try to recheck later today.

> > I attempted a full architecture cross bootstrap (for m68k as it is 
> > quick) with that first branch deleted and it succeeded. I also attempted 
> > a hurd-amd64 bootstrap on amd64 with it deleted and then 
> > cpp-14-x86-64-gnu become installable.
> 
> The right thing to try to validate whether we can remove the code is
> building a cross-compiler (and not cross-building a compiler).

Yes, I don't see rebootstrap using dpkg-buildpackage --target-arch for
anything except GNU mig?

Ideally, we'd test both a cross-compiler build (build == host != target)
and a canadian cross-compiler build (build != host != target).

Thanks,
Guillem
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.