Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

What's the Debian Way of building a cross binutils?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
hjalfi
Posts: 2
Joined: 2021-06-29 21:00

What's the Debian Way of building a cross binutils?

#1 Post by hjalfi »

I have a new ARM-based laptop. I want to build a compiler project of mine on it, which was developed on a amd64 machine. The project depends on about half a dozen different cross binutils packages (for as, ld etc).

On the amd64 machine, packages are available for all of these architectures. However, they're not on the ARM machine. Looking at the binutils source package's debian/rules file, it seems that there are different hard-coded lists of which cross platforms to build for depending what the host architecture is.

What's the correct way, these days, of building a cross binutils package? There's some very old documentation which refers to the cross-binutils package for doing this, which doesn't seem to exist any more. I've tried a few of the obvious things, such as editing debian/rules, but that just causes the build to fail obscurely.

(Note: I'm aware that I can build the upstream release myself, but I'd much rather use Debian packages for this, for ease of maintenance.)

(Also, is it worth filing a bug that all the cross packages should be built for all host architectures? I assume this was originally done for efficiency reasons, but is that still a valid argument?)

Thanks!

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: What's the Debian Way of building a cross binutils?

#2 Post by stevepusser »

I'm building armhf packages for MX Linux on my amd64 laptop using pbuilder and if that fails, sbuild, both of which use QEMU emulation in schroots with 10 times emulation speed penalty. Usually I just issue the build commands in my own terminal with the /debian folder already in the source and a customized ~/.pbuilderrc file, so I'm running this at the moment, for example:

Code: Select all

 OS=debian DIST=buster ARCH=armhf pdebuild --debbuildopts "-B -J7"
I also have sbuild schroots set up, and I know that I can log into those as a root user in a terminal and run commands there, like autocleaning the apt cache or editing the sources.list to cut out the deb-src lines and proposed-updates (why are those default?)--but if you can set up a /debian folder ahead of time, I would prefer to use pbuilder or cowbuilder.
MX Linux packager and developer

hjalfi
Posts: 2
Joined: 2021-06-29 21:00

Re: What's the Debian Way of building a cross binutils?

#3 Post by hjalfi »

Thanks, but that's not quite what I want to do --- I want to build a binutils which targets a different architecture than the one it's running on. So, I want to end up with an armhf or aarch64 binary which targets the m68k or MIPS.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: What's the Debian Way of building a cross binutils?

#4 Post by stevepusser »

Oh, I see--well, that's way beyond my pay grade (volunteer :o 0
MX Linux packager and developer

durga09
Posts: 1
Joined: 2021-07-29 03:20

Re: What's the Debian Way of building a cross binutils?

#5 Post by durga09 »

hjalfi wrote: 2021-06-30 08:21 Thanks, but that's not quite what I want https://mcdvoiceonline.xyz/ to do --- I want to build a binutils which targets a different architecture than the one it's running on. So, I want to end up with an armhf or aarch64 binary which targets the m68k or MIPS.
I want to target MIPS, how to do it in a better way?

Post Reply