[BACK]Return to README CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / compat

File: [cvs.NetBSD.org] / src / compat / README (download)

Revision 1.8, Thu Mar 29 18:35:11 2012 UTC (11 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, khorben-n900, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, agc-symver-base, agc-symver
Branch point for: phil-wifi
Changes since 1.7: +6 -6 lines

Fix typos; wording.

From patch by Bug Hunting.

$NetBSD: README,v 1.8 2012/03/29 18:35:11 wiz Exp $


Building multi-ABI libraries for NetBSD platforms.


src/compat has a framework to (re)build the libraries shipped with
NetBSD for a different ABI than the default for that platform.  This
allows 32-bit libraries for the amd64 and sparc64 ports, and enables
the mips64 port to support all three of old-style 32-bit ("o32"), the
new 32-bit (default, "n32", 64-bit CPU required) or the 64-bit ABI.


The basic premise is to re-set $MAKEOBJDIR to fresh subdirectory
underneath src/compat and rebuild the libraries with a different set
of options.  Each platform wanting support should create their port
subdirectory directly in src/compat, and then one subdirectory in here
for each ABI required, e.g., src/compat/amd64/i386 is where we build
the 32-bit compat libraries for the amd64 port.  In each of these
subdirectories, a small Makefile and makefile fragment should exist.  The
Makefile should set BSD_MK_COMPAT_FILE to equal the fragment, and then
include "../../compatsubdir.mk".  E.g., amd64/i386/Makefile has:

	BSD_MK_COMPAT_FILE=${.CURDIR}/bsd.i386.mk

	.include "../../compatsubdir.mk"

In the makefile fragment any changes to ABI flags are passed here
and the MLIBDIR variable must be set to the subdirectory in /usr/lib
where libraries for the ABI will be installed.  There are a couple of
helper Makefiles around.  amd64/i386/bsd.i386.mk looks like:

	LD+=			-m elf_i386
	MLIBDIR=		i386
	LIBC_MACHINE_ARCH=	${MLIBDIR}
	COMMON_MACHINE_ARCH=	${MLIBDIR}
	KVM_MACHINE_ARCH=	${MLIBDIR}
	PTHREAD_MACHINE_ARCH=	${MLIBDIR}
	BFD_MACHINE_ARCH=	${MLIBDIR}
	CSU_MACHINE_ARCH=	${MLIBDIR}
	CRYPTO_MACHINE_CPU=	${MLIBDIR}
	LDELFSO_MACHINE_CPU=	${MLIBDIR}

	.include "${NETBSDSRCDIR}/compat/m32.mk"

and the referenced m32.mk looks like:

	COPTS+=			-m32
	CPUFLAGS+=		-m32
	LDADD+=			-m32
	LDFLAGS+=		-m32
	MKDEPFLAGS+=		-m32

	.include "Makefile.compat"


compatsubdir.mk holds the list of subdirectories (the libraries and
ld.elf_so) to build with this ABI.

archdirs.mk holds the list of subdirectories for each port.

Makefile.compat has the basic framework to force the right paths for
library and ld.elf_so linkage.  It contains a hack to create subdirectories
in the build that should be fixed.

dirshack/Makefile is a hack to get objdirs created timely, and should
be fixed in a better way.



mrg@eterna.com.au
december 2009