aboutsummaryrefslogtreecommitdiff
path: root/share/mk/bsd.compat.mk
Commit message (Collapse)AuthorAgeFilesLines
* bsd.compat.mk: Set MACHINE before including bsd.opts.mkAndrew Turner2023-11-101-18/+27
| | | | | | | | | | | | | In bsd.opts.mk we check MACHINE_ARCH and may want to check MACHINE to decide which options to enable. Unfortunately this is included too early via bsd.compiler.mk. Move including bsd.compiler.mk until after we can set MACHINE and MACHINE_ARCH. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42448
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* bsd.compat.mk Extract _ALL_LIBCOMPATS and add related variablesJessica Clarke2023-07-271-1/+1
| | | | | | | | | Adding these to a new bsd.compat.pre.mk will allow other parts of the tree to iterate over the set of possible libcompats (upper and/or lower) rather than having to hard-code the list. Reviewed by: brooks, jhb, emaste Differential Revision: https://reviews.freebsd.org/D41178
* arm64 lib32: enable building of lib32 on arm64Mike Karels2023-07-251-0/+19
| | | | | | | | | | | Enable LIB32 option on aarch64, defaulting to YES; it had defaulted to "broken". Add required variables for how to compile lib32 on arm. Use /usr/include/arm for armv7 (32-bit) headers, analogous to /usr/include/i386 on amd64. Omit libomp from lib32; it is not supported on armv7. Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D40945
* bsd.compat.mk: Remove obsolete COMPAT_32BIT now it's unusedJessica Clarke2023-07-091-2/+0
| | | | | | | | See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make variables") for the context behind this change. Reviewed by: emaste, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40932
* bsd.compat.mk: Provide new CPP and sub-make variablesJessica Clarke2023-07-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the only way to detect for a libcompat build is to consult whether COMPAT_32BIT is defined (or equivalent, for downstreams with other libcompats or past releases with libsoft as COMPAT_SOFTFP). There are two issues with this: 1. COMPAT_32BIT is a new naming scheme that doesn't match the libcompat name, which is unnecessary deviation. 2. When multiple libcompats exist, everywhere that needs to detect a libcompat must check each variable in turn, despite the fact that it normally just wants to know if this is a libcompat build and perhaps what ${LIBCOMPAT} and/or ${libcompat} are for it. As a result, far too many places in the tree need to know about the set of possible libcompats. Instead, introduce two new CPP and sub-make variables, COMPAT_LIBCOMPAT and COMPAT_libcompat, which give the values for ${LIBCOMPAT} and ${libcompat} respectively, so that uses can be made parameterised. For when code really does need to know the specific libcompat, Makefiles can perform a string comparison, but the C preprocessor cannot, so introduce an additional CPP-only COMPAT_LIB${LIBCOMPAT} which is intended to replace the inconsistently-named COMPAT_32BIT (which will be removed in future). Uses of this new variable should still be kept to a minimum, however, given the code duplication needed for new libcompats. Reviewed by: emaste, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40922
* bsd.compat.mk: Fix indentation for alignmentJessica Clarke2023-07-071-2/+2
| | | | Fixes: 91d7edd549f5 ("Generalise libcompat to be a list rather than a single option")
* Generalise libcompat to be a list rather than a single optionJessica Clarke2023-06-271-28/+41
| | | | | | | | | | | | | | | | | Whilst the kernel can support any number of COMPAT_FOO, world can only build a single libfoo. Upstream this isn't such an issue, since the only option is lib32 anyway, but downstreams, such as CheriBSD, may wish to support multiple at the same time. Thus, adjust the top-level Makefiles to turn _LIBCOMPAT into a _LIBCOMPATS list that gets iterated over, and adjust bsd.compat.mk to support this use-case. For the normal NEED_COMPAT/WANT_COMPAT case, LIBCOMPATFOO remain set and refer to the requested compat's, preserving the current interface. For the top-level Makefiles those variables are no longer set (since there is no longer "the" compat) and only the per-compat ones are available. Reviewed by: brooks, jhb, imp Differential Revision: https://reviews.freebsd.org/D40571
* Assemble .s to .o using cc, not asEd Maste2023-06-261-1/+0
| | | | | | | | | | | As of commit fd71da37d478 we no longer have an `as` in the default toolchain. Although we do not make use of this rule in the base system some ports or downstream projects might. Use `cc -x assembler` instead of as. Reviewed by: arichardson Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35859
* bsd.cpu.mk: Introduce MACHINE_ABIBrooks Davis2022-10-051-1/+7
| | | | | | | | | | | | | | | | | | | | | | MACHINE_ABI is a list of properties of the ABI used for MACHINE_ARCH. It should be used in place of long conditionals on MACHINE_ARCH where practical. The following properties are indicated with one of the follow values: Byte order: big-endian, little-endian Floating point ABI: soft-float, hard-float Size of long (size_t, etc): long32, long64 Pointer type: ptr32, ptr64 Size of time_t: time32, time64 For example, i386 targets will be: MACHINE_ABI= big-endian hard-float long32 ptr32 time32 Reviewed by: imp Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D36421
* Install working pkgconfig .pc files for compat librariesAlex Richardson2022-08-111-0/+1
| | | | | | | | | The default ones are install them to /usr/libdata/pkgconfig, and we can't use this path for compat libraries, so we use /usr/lib<suffix>/pkgconfigi here. Test Plan: grep -rn libdir= ./usr/lib32/pkgconfig/*.pc MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34939
* libcompat: Use WORLDTMP sysrootBrooks Davis2022-07-011-7/+7
| | | | | | | | | Now that -m32 is fixed, just install libs in ${WORLDTMP}/lib/lib32 and use the installed headers. Reviewed by: imp, jhb Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D34697
* build target triple variable from sys/conf/newvers.shAlfredo Dal'Ava Junior2022-05-031-2/+2
| | | | | | | | | | | Retrieve FreeBSD revision number directly from sys/conf/newvers.sh when building the compiler target triple value, avoiding manual intervention on other files every new release. Reviewed by: imp MFC after: 2 months Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D34429
* bsd.compat.mk: A few cosmetic fixes.John Baldwin2022-02-041-3/+2
| | | | | | | | | | | | - Add a missing ')' to a warning. - Consistently use {} when expanding variables. - Remove a spurious blank line. Reviewed by: imp, emaste Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D34172
* libsoft: Remove targets to generate libsoftWarner Losh2022-01-071-14/+1
| | | | | | Remove the targets needed to make and install libsoft. Sponsored by: Netflix
* bsd.compat.mk: Remove support for mips64Warner Losh2022-01-031-26/+0
| | | | | | | No longer need to care about mips32 binaries on mips64 for lib32 support. Sponsored by: Netflix
* Add build system support for ASAN+UBSAN instrumentationAlex Richardson2021-08-021-0/+1
| | | | | | | | | | | | This adds two new options WITH_ASAN/WITH_UBSAN that can be set to enable instrumentation of all binaries with AddressSanitizer and/or UndefinedBehaviourSanitizer. This current patch is almost sufficient to get a complete buildworld with sanitizer instrumentation but in order to actually build and boot a system it depends on a few more follow-up commits. Reviewed By: brooks, kib, markj Differential Revision: https://reviews.freebsd.org/D31043
* Bump CURRENT to 14.0Glen Barber2021-01-221-4/+4
| | | | | | | This one goes to 14. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate")
* bsd.compat.mk: Allow finding non-internal librariesBryan Drewery2021-01-081-0/+1
| | | | | | | | | | | | | | | Currently only libexec/rtld-elf32 uses internal LIBC_NOSSP_PIC during the build but it gets it directly from the objdir rather than a sysroot. For example, /usr/obj/usr/src/amd64.amd64/obj-lib32/lib/libc/libc_nossp_pic.a. We don't stage lib32 libraries in WORLDTMP/usr/lib32 and doing so doesn't buy much. If we want to use a staged lib32 library then we need to look in LIBCOMPATTMP where they were staged. For example if LIBC_PIC were wanted then look for /usr/obj/usr/src/amd64.amd64/obj-lib32/tmp/usr/lib32/libc_pic.a. Reported by: rlibby Reviewed by: rlibby Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D27648
* Move -L${LIBCOMPATTMP}/usr/lib${libcompat} from CFLAGS to LDFLAGS.John Baldwin2020-08-171-2/+3
| | | | | | | | | | | | | This is only needed when linking and fixes various "unused command line argument" warnings during the lib32 build. Reviewed by: bdrewery Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26068 Notes: svn path=/head/; revision=364318
* [PowerPC] Fix LIB32WMAKEFLAGS definitionBrandon Bergren2020-03-271-1/+2
| | | | | | | | | | When I modified the LIB32WMAKEFLAGS= definition, I trimmed too much off. -m is meant to be a parameter to LD. Reported by: arichardson Notes: svn path=/head/; revision=359373
* [PowerPC] Switch powerpc and powerpcspe to lldBrandon Bergren2020-03-271-5/+1
| | | | | | | | | | | | | | | Now that LLD 10 is out, and required patches have landed, we are now ready to finally switch away from the ancient in-tree ld.bfd. Special thanks to Fangrui Song for many hours of work on getting the 32-bit powerpc lld ready for prime-time. Reviewed by: emaste (earlier revision), jhibbits Relnotes: yes Differential Revision: https://reviews.freebsd.org/D24111 Notes: svn path=/head/; revision=359347
* compat: Allow explicit overriding of COMPAT_ARCH and COMPAT_CPUTYPEJustin Hibbits2020-03-071-2/+2
| | | | | | | | | | | | | Summary: Allow src.conf to override the inferred COMPAT_ARCH and COMPAT_CPUTYPE variables, such that a different CPU target can be specified explicitly for the general target vs the compat target. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23992 Notes: svn path=/head/; revision=358729
* Build hard-float lib32 for mips64hf/mips64elhfAlex Richardson2020-01-271-2/+1
| | | | | | | | | | | | This should fix linker errors when building with clang+lld. After this change the lib32 compat libraries are now buildt with -mhard-float instead of -msoft-float Reviewed By: brooks, jhb Differential Revision: https://reviews.freebsd.org/D23229 Notes: svn path=/head/; revision=357170
* Set correct lib32 MACHINE_ARCH for mips64el*.John Baldwin2020-01-031-1/+2
| | | | | | | | | | | | | | Use "mipsel" instead of "mips" as the 32-bit MACHINE_ARCH when building lib32 for little-endian 64-bit MIPS targets. This fixes an error where some objects were compiled as LE and others compiled as BE causing a link error for rtld32. Reviewed by: emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23028 Notes: svn path=/head/; revision=356339
* [PowerPC64] Use ld.bfd to build LIB32 and STAND - when using llvmJustin Hibbits2019-12-241-1/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is to support ongoing work for replacing "GCC/BFD" by "CLANG/LLD" on target PowerPC64 [1], by proposing a way to specify and/or locate a secondary ld.bfd linker. This is necessary as LLD currently doesn't support PowerPC 32 bits, so we keep using BFD for the 32 bit stuff on PowePC64(LIB32 compatibility and STAND/slof/loader.) - creates LD_BFD variable pointing to ld.bfd - use LD_BFD as linker for LIB32/compat - Default behavior for other platforms aren't changed. [1] https://wiki.freebsd.org/powerpc/llvm-elfv2 Submitted by: alfredo.junior_eldorado.org.br Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20261 Notes: svn path=/head/; revision=356054
* Turn the error about a lack of LIBCOMPAT into a warning.Brooks Davis2019-11-081-1/+1
| | | | | | | | | | | | Add some diagnostic output. This works around the fact that buildworld calls cleandir in libexec with the wrong MACHINE_ARCH (i386 on amd64) when the OBJ directory is empty. Reported by: bdragon, jkim Notes: svn path=/head/; revision=354523
* libcompat: build 32-bit rtld and ldd as part of "everything"Brooks Davis2019-11-071-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included directly so MD paths in Makefiles work. In the process centralize setting them in LIBCOMPATWMAKEENV. Alter .PATH and CFLAGS settings in work when the Makefile is included. While here only support LIB32 on supported platforms rather than always enabling it and requiring users of MK_LIB32 to filter based TARGET/MACHINE_ARCH. The net effect of this change is to make Makefile.libcompat only build compatability libraries. Changes relative to r354449: Correct detection of the compiler type when bsd.compat.mk is used outside Makefile.libcompat. Previously it always matched the clang case. Set LDFLAGS including the linker emulation for mips where -m32 seems to be insufficent. Reviewed by: imp, kib (origional version in r354449) Obtained from: CheriBSD (conceptually) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22251 Notes: svn path=/head/; revision=354491
* Revert r354449: libcompat: build 32-bit rtld and ldd as part of "everything"Brooks Davis2019-11-071-17/+7
| | | | | | | Additional testing is required.. Notes: svn path=/head/; revision=354465
* libcompat: build 32-bit rtld and ldd as part of "everything"Brooks Davis2019-11-071-7/+17
| | | | | | | | | | | | | | | | | | | | | | | Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included directly so MD paths in Makefiles work. In the process centralize setting them in LIBCOMPATWMAKEENV. Alter .PATH and CFLAGS settings in work when the Makefile is included. While here only support LIB32 on supported platforms rather than always enabling it and requiring users of MK_LIB32 to filter based TARGET/MACHINE_ARCH. The net effect of this change is to make Makefile.libcompat only build compatability libraries. Reviewed by: imp, kib Obtained from: CheriBSD (conceptually) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22251 Notes: svn path=/head/; revision=354449
* Allow bsd.compat.mk to be reliably included outside Makefile.inc1.Brooks Davis2019-10-311-13/+21
| | | | | | | | | | | | | | | | Replace explicit TARGET_* variables with COMPAT_* versions defined based on where the file is being included. Also, require that bsd.compat.mk be included directly. It's not going to be widely used so always loading it in bsd.prog.mk doesn't make sense. Instead users can include it directly. Reviewed by: imp, bdrewery (prior revision) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22059 Notes: svn path=/head/; revision=354227
* Fix including bsd.compat.mk outside Makefile.libcompat on mips64.Brooks Davis2019-10-151-1/+1
| | | | | | | Reported by: jhb, jenkins Notes: svn path=/head/; revision=353601
* Add the ability to link programs against a compat ABI.Brooks Davis2019-10-151-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | Linkage is controlled by two make knobs: WANT_COMPAT - Prefer to link against the compat ABI. NEED_COMPAT - Link against the compat ABI or fail to build. Supported values are "32", "soft", and "any". The latter meaning pick the first[0] supported compat ABI. This can be used to provide test binaries for compat ABIs or to link ABI-specific programs. [0] We currently support only one compat ABI at a time, but this may change in the future and some code in this commit is structured to ease that change. Reviewed by: bdrewery, jhb Obtained from: CheriBSD (in concept) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22023 Notes: svn path=/head/; revision=353597
* Rename top-level LIBCOMPAT to _LIBCOMPAT.Brooks Davis2019-10-151-3/+3
| | | | | | | | | | This avoids a conflict with LIBCOMPAT defined in bsd.libnames.mk. Reviewed by: bdrewery Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=353593
* Move the per-ARCH definitions to bsd.compat.mk.Brooks Davis2019-10-151-0/+106
| | | | | | | | | | | This is the first step if refactoring the definitions to allow programs to be selectively linked against libcompat libraries. Reviewed by: bdrewery Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=353592
* Remove all support for legacy NOFOO and NO_FOO build options.Dag-Erling Smørgrav2013-01-101-41/+0
| | | | Notes: svn path=/head/; revision=245269
* Align the warning message with the one in bsd.own.mk.Ruslan Ermilov2007-10-201-1/+1
| | | | Notes: svn path=/head/; revision=172831
* Tweak the handling of "WITHOUT_LIBPTHREAD". Also remove the accidentalDavid E. O'Brien2007-10-091-1/+0
| | | | | | | | | | treatment of 'LIBKSE' as an "old style" knob. Submitted by: ru Approved by: re(kensmith) Notes: svn path=/head/; revision=172500
* Repo copy libpthreads to libkse.David E. O'Brien2007-10-091-0/+1
| | | | | | | | | This introduces the WITHOUT_LIBKSE nob, and changes WITHOUT_LIBPTHREADS to mean with neither threading libs. Approved by: re(kensmith) Notes: svn path=/head/; revision=172491
* Removed libc_r build support.Ruslan Ermilov2006-09-301-1/+0
| | | | Notes: svn path=/head/; revision=162846
* Wrap BSD r* commands in NO_RCMDS.Tom Rhodes2005-03-021-0/+1
| | | | | | | | | Change NO_RCMDNS to NO_RCMDS and do the switch in bsd.compat.mk. Discussed with: ru, nectar Notes: svn path=/head/; revision=143026
* Accept the old user interface for NO_CLEAN as it is a POLA violation asDavid E. O'Brien2005-02-281-1/+0
| | | | | | | we've eventually changed the user interface of a common command. Notes: svn path=/head/; revision=142766
* NOPAM -> NO_PAMRuslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139126
* NOFORTH -> NO_FORTHRuslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139123
* NOCLEAN -> NO_CLEANRuslan Ermilov2004-12-211-0/+2
| | | | | | | NOCLEANDIR -> NO_CLEANDIR Notes: svn path=/head/; revision=139122
* NOSHARE -> NO_SHARERuslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139120
* NOHTML -> NO_HTMLRuslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139119
* NOINET6 -> NO_INET6Ruslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139115
* NOGAMES -> NO_GAMESRuslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139114
* NOCRYPT -> NO_CRYPTRuslan Ermilov2004-12-211-0/+1
| | | | Notes: svn path=/head/; revision=139113