[NLUUG]   Welcome to ftp.nluug.nl
Current directory: /pub/ftp/os/NetBSD/NetBSD-current/src/compat/
 
Current bandwidth utilization 2056.20 Mbit/s
Bandwidth utilization bar
Contents of README:
$NetBSD: README,v 1.9 2024/02/04 05:43:05 mrg 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@eterna23.net
december 2009

Icon  Name                                   Last modified      Size  
[DIR] Parent Directory - [DIR] CVS/ 01-Nov-2024 04:01 - [DIR] amd64/ 25-Dec-2009 07:25 - [DIR] arm/ 01-Nov-2024 04:01 - [DIR] dirshack/ 14-May-2023 05:00 - [DIR] mips64/ 26-Apr-2021 05:00 - [DIR] powerpc64/ 08-Mar-2014 04:01 - [DIR] riscv64/ 20-Sep-2014 05:03 - [DIR] sparc64/ 25-Dec-2009 07:25 - [   ] Makefile 30-May-2022 05:00 288 [TXT] Makefile.compat 24-Aug-2012 05:01 852 [TXT] README 05-Feb-2024 04:00 2.3K [   ] archdirs.mk 08-Jun-2021 05:00 773 [   ] compatsubdir.mk 25-Jul-2015 05:27 1.0K [TXT] exec.mk 14-May-2023 05:00 1.4K [   ] m32.mk 18-Jun-2011 05:01 313

NLUUG - Open Systems. Open Standards
Become a member and get discounts on conferences and more, see the NLUUG website!