Port-amd64 archive

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

HOWTO: 32-bit pkgsrc on amd64



Hey folks,

I have been playing around with the new multilib support in 5.0 and have managed to setup parallel amd64 and i386 pkgsrc trees. I'm posting instructions on how to get started in case somebody else wants to play.

Note that the following instructions are for amd64, but should work for sparc64 as well.


How to build 32-bit packages on 64-bit platforms with pkgsrc
============================================================

1. Check out a fresh pkgsrc tree from Dec 15 or later:

  $ mkdir ~/pkgsrc32
  $ cd ~/pkgsrc32
  $ export CVSROOT=anoncvs%anoncvs.netbsd.org@localhost:/cvsroot
  $ cvs co -P pkgsrc

2. Build bootstrap:

  $ cd ~/pkgsrc32/pkgsrc/bootstrap
  $ sudo ./bootstrap --prefix /usr/pkg32        \
        --pkgdbdir /var/db/pkg32                \
        --sysconfdir /usr/pkg32/etc             \
        --varbase /usr/pkg32/var                \
        --abi 32

3. Add the following lines to /usr/pkg32/etc/mk.conf after
   the 'ABI=' line:

        _COMPILER_ABI_FLAG.32=  -m32
        MACHINE_ARCH=           i386
        LIBABISUFFIX=           /${MACHINE_ARCH}
        X11_TYPE=               modular

4. Until toolchain/40170 is resolved, the following changes are required for
   m32 ldscripts. For each /usr/libdata/ldscripts/elf_i386.* file, look for
   the line:

        SEARCH_DIR("/usr/x86_64--netbsd/lib");

   and change it to:

        SEARCH_DIR("/usr/x86_64--netbsd/lib"); SEARCH_DIR("/usr/lib/i386");

   The elf_i386.xc file will also require SEARCH_DIR("/usr/pkg32/lib"); in
   addition to the above two paths.

5. Build packages (make sure you use /usr/pkg32/bin/bmake and not
   /usr/bin/make):

  $ cd ~/pkgsrc32/pkgsrc/category/package
  $ /usr/pkg32/bin/bmake install


Cheers,
Jared


Home | Main Index | Thread Index | Old Index