Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
amd64/i386/ | H | - | - | 24 | 16 | |
arm/ | H | - | - | 162 | 122 | |
dirshack/ | H | - | - | 33 | 10 | |
mips64/ | H | - | - | 96 | 64 | |
powerpc64/powerpc/ | H | - | - | 28 | 20 | |
riscv64/rv32/ | H | - | - | 43 | 30 | |
sparc64/sparc/ | H | - | - | 23 | 15 | |
Makefile | H A D | 29-May-2022 | 288 | 20 | 9 | |
Makefile.compat | H A D | 23-Aug-2012 | 852 | 34 | 19 | |
README | H A D | 04-Feb-2024 | 2.3 KiB | 73 | 50 | |
archdirs.mk | H A D | 07-Jun-2021 | 773 | 39 | 28 | |
compatsubdir.mk | H A D | 23-Jul-2015 | 1,002 | 42 | 29 | |
exec.mk | H A D | 13-May-2023 | 1.4 KiB | 45 | 7 | |
m32.mk | H A D | 18-Jun-2011 | 313 | 19 | 9 |
README
1$NetBSD: README,v 1.9 2024/02/04 05:43:05 mrg Exp $ 2 3 4Building multi-ABI libraries for NetBSD platforms. 5 6 7src/compat has a framework to (re)build the libraries shipped with 8NetBSD for a different ABI than the default for that platform. This 9allows 32-bit libraries for the amd64 and sparc64 ports, and enables 10the mips64 port to support all three of old-style 32-bit ("o32"), the 11new 32-bit (default, "n32", 64-bit CPU required) or the 64-bit ABI. 12 13 14The basic premise is to re-set $MAKEOBJDIR to fresh subdirectory 15underneath src/compat and rebuild the libraries with a different set 16of options. Each platform wanting support should create their port 17subdirectory directly in src/compat, and then one subdirectory in here 18for each ABI required, e.g., src/compat/amd64/i386 is where we build 19the 32-bit compat libraries for the amd64 port. In each of these 20subdirectories, a small Makefile and makefile fragment should exist. The 21Makefile should set BSD_MK_COMPAT_FILE to equal the fragment, and then 22include "../../compatsubdir.mk". E.g., amd64/i386/Makefile has: 23 24 BSD_MK_COMPAT_FILE=${.CURDIR}/bsd.i386.mk 25 26 .include "../../compatsubdir.mk" 27 28In the makefile fragment any changes to ABI flags are passed here 29and the MLIBDIR variable must be set to the subdirectory in /usr/lib 30where libraries for the ABI will be installed. There are a couple of 31helper Makefiles around. amd64/i386/bsd.i386.mk looks like: 32 33 LD+= -m elf_i386 34 MLIBDIR= i386 35 LIBC_MACHINE_ARCH= ${MLIBDIR} 36 COMMON_MACHINE_ARCH= ${MLIBDIR} 37 KVM_MACHINE_ARCH= ${MLIBDIR} 38 PTHREAD_MACHINE_ARCH= ${MLIBDIR} 39 BFD_MACHINE_ARCH= ${MLIBDIR} 40 CSU_MACHINE_ARCH= ${MLIBDIR} 41 CRYPTO_MACHINE_CPU= ${MLIBDIR} 42 LDELFSO_MACHINE_CPU= ${MLIBDIR} 43 44 .include "${NETBSDSRCDIR}/compat/m32.mk" 45 46and the referenced m32.mk looks like: 47 48 COPTS+= -m32 49 CPUFLAGS+= -m32 50 LDADD+= -m32 51 LDFLAGS+= -m32 52 MKDEPFLAGS+= -m32 53 54 .include "Makefile.compat" 55 56 57compatsubdir.mk holds the list of subdirectories (the libraries and 58ld.elf_so) to build with this ABI. 59 60archdirs.mk holds the list of subdirectories for each port. 61 62Makefile.compat has the basic framework to force the right paths for 63library and ld.elf_so linkage. It contains a hack to create subdirectories 64in the build that should be fixed. 65 66dirshack/Makefile is a hack to get objdirs created timely, and should 67be fixed in a better way. 68 69 70 71mrg@eterna23.net 72december 2009 73