tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cross-compiling pkgsrc



> On Sep 4, 2023, at 11:53 AM, Taylor R Campbell <campbell+netbsd-tech-pkg%mumble.net@localhost> wrote:
> 
>> Date: Mon, 4 Sep 2023 10:25:06 -0600
>> From: Brook Milligan <brook%nmsu.edu@localhost>
>> 
>> Is this the best reference for how to cross-compile pkgsrc?
>> 
>> https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/HOWTO-use-crosscompile
> 
> Yes, that's right.
> 
>> To test this, I have tried to compile misc/screen on Darwin for
>> ebvarm-earamv7hf.  The NetBSD tools, etc. are all built with
>> build.sh and the release image works fine on the target arm machine.
> 
> Unfortunately, it only supports cross-architecture compilation -- not
> cross-OS compilation.  So you can use it to build packages for
> NetBSD/earmv7hf using, say, NetBSD/amd64, but not using macOS.

Got it.

> Fortunately, I am sitting on some changes to extend this to cross-OS
> compilation, so soon it will be possible.  But I'm busy working on
> getting netbsd-10 out the door, so it won't be until after 2023Q3 is
> out that I'll get back to pkgsrc cross-compilation.

I’m looking forward to that.

In the meantime, I’ll use my NetBSD box to try.  I do have another question, though.

It would seem that the packages made in the process of a cross-compilation will be a mixture of native and cross packages, and that only the cross packages should be installed on the target machine.  Is that true?  Is there a way to tell the difference?

Does it make sense to include something like the following in mk.conf to put packages in two different places, or will USE_CROSS_COMPILE not be defined in the right way?

.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
PACKAGES=/path/to/native/packages
.else
PACKAGES=/path/to/cross/packages
.endif

If that makes any sense, I’ll suggest adding it to your HOWTO at some point (or other information on differentiating the native/cross packages for installation on a target).

Thanks a lot for working on this.

Cheers,
Brook



Home | Main Index | Thread Index | Old Index