aboutsummaryrefslogtreecommitdiff
path: root/Makefile.libcompat
Commit message (Collapse)AuthorAgeFilesLines
* build{libcompat}: Pass UNIVERSE_TOOLCHAIN_PATH to the _lc_build-tools submakeJohn Baldwin2023-08-221-0/+1
| | | | | | | This fixes make UNIVERSE_TOOLCHAIN=yes with libcompats. Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D41535
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Makefile.libcompat: Fix DTRACE variableJessica Clarke2023-08-101-1/+1
| | | | | | | | | | | | Back when Makefile.lib32 was turned into Makefile.libcompat, a typo was introduced; it should have been LIBCOMPATDTRACE, but instead gained a dollar sign in it as LIB$COMPATDTRACE (and with COMPATDTRACE not being defined, was equivalent to ${LIB:U${DTRACE}}). This then meant it was not converted to LIB${_LIBCOMPAT}DTRACE in 91d7edd549f5 ("Generalise libcompat to be a list rather than a single option") and instead left broken. Belatedly fix this long-standing seemingly-inconsequential bug. Fixes: dba75e9fa5a9 ("Move Makefile.lib32 to Makefile.libcompat and generalize it.")
* Makefile.inc1: Enable requesting the universe toolchain.John Baldwin2023-08-011-0/+1
| | | | | | | | | | | | | | make universe builds a cross toolchain under HOST_OBJTMP/tmp via the universe-toolchain target. However, doing a plain 'make buildworld' after a universe/tinderbox run (e.g. to reproduce a failure and test the fix for it), will try to build a new cross toolchain under OBJTMP/tmp which can be tedious. This commit adds a make variable (UNIVERSE_TOOLCHAIN) which can be used similar to CROSS_TOOLCHAIN to request an external toolchain. If this variable is set (value doesn't matter), the the universe toolchain is used as an external toolchain. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D40777
* arm64 lib32: enable building of lib32 on arm64Mike Karels2023-07-251-1/+1
| | | | | | | | | | | 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
* Makefile.libcompat: Make quoting for CC/CXX/CPP more future-proofJessica Clarke2023-07-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | bmake's :Q is for quoting outside of double quotes, but here is inside double quotes, and as a result it ends up quoting characters that don't have a special meaning inside double quotes. On the surface this would seem harmless, but POSIX sh has a strange behaviour (differing from outside double quotes) that, inside double quotes, a backslash before a character that never has a special meaning inside double quotes is passed through. As a result, should LIB${_LIBCOMPAT}CFLAGS contain something like -DFOO\(x\)=x, we would form "... -DFOO\\\(x\\\)=x ...", which would be parsed as -DFOO\\(x\\)=x, since the parentheses are never special inside double quotes (but the backslash itself is), not the original -DFOO\(x\)=x as intended. Instead, construct the whole string as a bmake expression and use :Q on that, without the manual double quotes around everything. Note that the :L modifier lets you treat an expression like a variable expansion and apply modifiers to it, i.e. ${expr:L:...} is the same as tmp=expr ${tmp:...} (in essence, ignoring possible differences due to deferred substitution). Improves: 537f945fc89f ("Makefile.libcompat: Quote CFLAGS and CXXFLAGS for sub-make")
* Makefile.libcompat: Be consistent about not installing includesJessica Clarke2023-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | Currently we only pass MK_INCLUDES=no for distribute and install, since it's only in LIB${_LIBCOMPAT}IMAKE, which means that we enable includes during libraries and thus install includes into worldtmp, despite it being shared these days across native and libcompats. This also means we're at risk of having headers needed for building against a libcompat that don't get installed to the system, but do end up being installed to worldtmp. In particular, lib/msun has different fenv.h for aarch64 and arm, so aarch64 will need arm's copy when it grows lib32 support, and this would be installed to worldtmp, but not to the system, meaning any programs that use fenv.h wouldn't be able to be built. Instead, be consistent, and don't install includes at all during any of the libcompat phases, so that we can detect these issues and ensure any needed headers are installed for both worldtmp and the system. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D41030
* Makefile.libcompat: Quote CFLAGS and CXXFLAGS for sub-makeJessica Clarke2023-07-091-3/+3
| | | | | | | | | | | | Currently none of the words in these require quoting, but a future commit will add words that do, thus we should make sure to quote each word so the shell doesn't mangle them before calling the sub-make. (Note that :@var@expr@ is the bmake syntax for map, replacing each word with expr's evaluation, with var containing the input word) Reviewed by: emaste, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40921
* Generalise libcompat to be a list rather than a single optionJessica Clarke2023-06-271-12/+21
| | | | | | | | | | | | | | | | | 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
* Makefile.libcompat: Handle MK_FOO varying for native and compat archesJessica Clarke2023-06-271-23/+33
| | | | | | | | | | | | | | Currently Makefile.libcompat queries a few MK_FOO variables to determine what is being built. However, it is plausible (and indeed, downstream in CheriBSD, this is the case) that these may vary between the native and the compat architecture. In order to correctly determine their values for the compat architecture, we need to defer their evaluation until we are in the compat sub-make where src.opts.mk will give us the right value for the compat MACHINE_ARCH. Reviewed by: brooks, jhb, imp Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D40570
* Makefile.libcompat: Remove unused _LC_INCDIRSJessica Clarke2023-06-271-5/+0
| | | | | | | | This is no longer referenced as of commit 724123b9f4d3 ("libcompat: Use WORLDTMP sysroot"). Reviewed by: brooks, jhb, imp Differential Revision: https://reviews.freebsd.org/D40569
* libcompat: avoid installing include files twiceEd Maste2022-11-171-0/+1
| | | | | | | | | | | | | | Previously some headers were getting installed twice, once as expected and then a second time as part of the compat32 library stage. Makefile.libcompat sets -DLIBRARIES_ONLY for the install make invocation which causes bsd.lib.mk to skip headers. However some headers are handled via bsd.prog.mk, which does not use LIBRARIES_ONLY. Explicitly set MK_INCLUDES=no. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37413
* 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-30/+4
| | | | | | | | | 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
* Makefile.libcompat: SortWarner Losh2022-02-021-3/+2
| | | | | | | | Sort MK_BOOT before MK_CTF and remove now-useless NO_LINT while I'm here. Suggested by: brooks, emaste Sponsored by: Netflix
* stand: Fix kboot issue on powerpc64 with MK_LIB32=yesWarner Losh2022-02-021-1/+2
| | | | | | | | | | | | When MK_LIB32 is true, we descend into stand for make includes, make clean, etc. We shouldn't do this, so set MK_BOOT=no when we're building includes. Fixes: 6497250f6f7f PR: 261497 Sponsored by: Netflix Reviewed by: emaste, brooks (he suggested this) Differential Revision: https://reviews.freebsd.org/D34141
* libcompat: Remove MIPS from list of compat librariesWarner Losh2021-12-091-1/+1
| | | | Sponsored by: Netflix
* ncurses: fix libcompat (lib32 for example) buildingBaptiste Daroussin2021-10-041-2/+2
|
* Prefer MK_SSP=no to SSP_CFLAGS=Mitchell Horne2021-08-041-1/+2
| | | | | | | | | It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when $MK_SSP != "no". Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31401
* mk: format some option listsMitchell Horne2021-08-041-3/+8
| | | | | | | | | Alphabetize and give each option its own line, ahead of making another change to these lists. This makes future diffs easier to read. Reviewed by: imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31399
* 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
* `make buildworld' with time logging for each stageWolfram Schneider2021-08-011-1/+1
| | | | | | | PR: 257141 Reviewed by: sjg,emaste Approved by: emaste Differential Revision: https://reviews.freebsd.org/D31154
* libpmc: always generate libpmc_events.cMitchell Horne2021-05-311-1/+1
| | | | | | | | | | The jevents build tool will create an empty table if it doesn't find any events, so we can remove the extra $MACHINE_CPUARCH checks. Reviewed by: gnn, ray, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30531
* libcompat: remove redundant path for ncursesBaptiste Daroussin2021-01-071-1/+1
| | | | Reported by: kevans
* Rename NO_WERROR -> MK_WERROR=noAlex Richardson2021-01-071-1/+1
| | | | | | | | As suggested in D27598. This also supports MK_WERROR.clang=no and MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D27601
* Stop passing MK_WARNS=no for bootstrap toolsAlex Richardson2021-01-071-1/+1
| | | | | | | | | | | | | | | | | I got annoyed by the number of warnings that the CheriBSD build was emitting. It turns out that we are emitting lots of warnings during bootstrap because bootstrap tools are built with the default compiler flags and ignore the warnings flags that are set in bsd.sys.mk. Looking at git blame, it appears that MK_WARNS=no has been passed since rS112869, replacing the -DNO_WERROR option that was added in rS87775. This commit changes MK_WARNS=no back to -DNO_WERROR. We need to pass -DNO_WERROR, since the system compiler might have new warnings that we don't know about yet, and we shouldn't fail the build in that case. Reviewed By: imp, brooks Differential Revision: https://reviews.freebsd.org/D27598
* ncurses: only keep the version with widechar supportBaptiste Daroussin2021-01-051-2/+2
| | | | | | | | | | | | | | | | Only keep the widechar version of ncurses as libncursesw.so.9 Keep the old name to avoid breaking the ABI compatibility (the non widechar version libncurses.so.9 is not binary compatible with libncursesw.so.9) since all ports and base are already only linking against the widechar version we can simply remove libncurses.so.9 Since the .9 version only lived in the dev branch and never ended in a release, it is simply removed and not added to any binary compat package. Add symlinks to keep build time compatibility for anyone linking against -lncurses
* Race in 32-bit fixedWarner Losh2020-10-081-1/+1
| | | | | | | | | Use install insteald of install.sh for 32-bit builds to fight races there. Reviewed by: markj Notes: svn path=/head/; revision=366541
* Add WITH_/WITHOUT_CLEAN option to replace NO_CLEANEd Maste2020-09-081-2/+2
| | | | | | | | | | | | | | | | | This allows use of the standard src.conf configuration for controlling whether the tree is cleaned before build or not. The default is still to clean. Setting either NOCLEAN or NO_CLEAN will mention the new src.conf option. NOCLEAN remains a .warning, while for now NO_CLEAN is .info. Reviewed by: bdrewery (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22762 Notes: svn path=/head/; revision=365439
* Stop building libl and libyEmmanuel Vadot2020-03-261-1/+0
| | | | | | | | | | | Those libs aren't needed anymore so stop building them for the bootstrap tools or the compat libs. Reviewed by: bapt, emaste X-Differential Revision: D24171 Notes: svn path=/head/; revision=359324
* libcompat: build 32-bit rtld and ldd as part of "everything"Brooks Davis2019-11-071-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+19
| | | | | | | 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-19/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Build compat libraries before "everything".Brooks Davis2019-10-151-1/+1
| | | | | | | | | | | This is required for us to link programs against compat versions of libraries. Reviewed by: bdrewery, jhb Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=353595
* Move the per-ARCH definitions to bsd.compat.mk.Brooks Davis2019-10-151-95/+1
| | | | | | | | | | | 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
* Centralize adding OBJCOPY=${XOBJCOPY} to LIB32WMAKEFLAGS.Brooks Davis2019-10-111-6/+3
| | | | | | | | | Reviewed by: emaste, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21983 Notes: svn path=/head/; revision=353449
* libsysdecode: use the proper include directoryEd Maste2019-07-251-1/+0
| | | | | | | | | | Reported by: cy Reviewed by: lwhsu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21068 Notes: svn path=/head/; revision=350327
* Workaround the build failure on platforms have lib32 after r350301Li-Wen Hsu2019-07-251-0/+1
| | | | | | | | | | | | | Error message: make[5]: make[5]: don't know how to make /usr/obj/usr/src/amd64.amd64/obj-lib32/tmp/sys/netinet/in.h. Stop make[5]: stopped in /usr/src/lib/libsysdecode Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350322
* Build lib32 libl. The library is built from usr.bin/lex/lib. It would beTijl Coosemans2019-06-291-0/+1
| | | | | | | | | | | | better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp MFC after: 3 days Notes: svn path=/head/; revision=349548
* Use ...-freebsd13.0 in -target strings.Brooks Davis2018-11-121-3/+3
| | | | | | | Reported by: Mark Millard Notes: svn path=/head/; revision=340371
* libcompat: disable retpoline when building build toolsEd Maste2018-11-031-1/+2
| | | | | | | | | | | | These are built with the host toolchain which may not support retpoline. While here, move the MK_ overrides to a separate line and sort them alphabetically to support future changes. MFC with: r339511 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=340099
* Fix non-FreeBSD host lib32 build for TARGET=amd64Alex Richardson2018-08-231-0/+5
| | | | | | | | | | | | | | | When building on non-FreeBSD systems we need to pass an explicit target triple to clang otherwise it will attempt to build with the host triple. This also has advantages when building on a FreeBSD host: we now tell clang that we are targeting at least FreeBSD 12.0 instead of an older version so it can enable newer features. Reviewed By: brooks (mentor) Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D16842 Notes: svn path=/head/; revision=338268
* Install the 32-bit compat sanitizer libraries.John Baldwin2018-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The lib32 build was already building the i386 version of the clang sanitizers (libclang_rt) but they were not being installed. This enables the installation. MK_TOOLCHAIN=no was originally added to the install make environment to disable includes so that NO_INCS could be removed. The MK_TOOLCHAIN in bsd.incs.mk was subsequently renamed to MK_INCLUDES, but bsd.lib.mk doesn't even include bsd.incs.mk when LIBRARIES_ONLY is defined which the install make environment for compat libs now defines. However, setting MK_TOOLCHAIN=no forced MK_CLANG=no which disabled libclang_rt during the install32 phase. Remove MK_TOOLCHAIN=no since LIBRARIES_ONLY is now sufficient. Since the libcompat environment overrides both LIBDIR and SHLIBDIR, libclang_rt/Makefile.inc has to set both variables to force the libraries to be installed to the location expected by the compiler. Reviewed by: bdrewery, dim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16574 Notes: svn path=/head/; revision=337270
* Makefile.libcompat: correctly append to make variableEd Maste2018-07-301-1/+1
| | | | | | | | Reported by: hselasky Pointy hat to: emaste Notes: svn path=/head/; revision=336908
* Makefile.libcompat: use one variable assignment per lineEd Maste2018-07-301-1/+2
| | | | | | | | This makes it easier to carry or merge patches that remove gnu/ components. Notes: svn path=/head/; revision=336907
* Don't change directory owner to root when building with -DNO_ROOTAlex Richardson2018-06-291-5/+5
| | | | | | | | | | | | | | | | | | Currently the mtree calls in Makefile.inc1 all change the directory owner to match the spec file. However, we should not be doing this during distributeworld if -DNO_ROOT is passed. Additionally, when creating the WORLDTMP directory hierachy there is no need to change the owner to root so we now always pass the -W flag when populating WORLDTMP. This is also required for building FreeBSD on Linux/Mac since the required groups/users will not exist there which is how I discovered this issue. Reviewed By: emaste, bdrewery, imp Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D14185 Notes: svn path=/head/; revision=335805
* Remove the various build flag hacks for GCC cross-compile.John Baldwin2018-06-281-16/+0
| | | | | | | | | | | | | | The xtoolchain GCC packages have not required these flags since ports commits r465416 and r466701. The in-tree GCC 4.2.1 has also been patched in r335716 and r335717 to correctly honor --sysroot when looking for includes and libraries. Reviewed by: bdrewery Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D16055 Notes: svn path=/head/; revision=335782
* Reduce exec and fstat overhead for non-build targets.Bryan Drewery2018-06-201-5/+6
| | | | | | | | | | This is mostly targetting 'make showconfig' and 'make test-system-*' for the benefit of makeman and universe-one-clang work. Sponsored by: Dell EMC Notes: svn path=/head/; revision=335452
* lib32: Fix lib/libpmc/pmu-events files ending up in source directory.Bryan Drewery2018-06-151-1/+3
| | | | | | | | | | | | | | | | | | | | This could happen with either WITHOUT_AUTO_OBJ=yes or MAKELEVEL>0 for the initial 'make buildworld' command. This now ensures that build-tools targets have 'make obj' ran if needed. This is especially problematic for pmu-events since it is not directly connected in the build. Normally the 'make includes' call right before this implicitly creates the objdir with a 'make obj' already but misses pmu-events because it is disconnected from lib/libpmc. Fixing that would make this new 'make obj' pointless but it is being added to avoid this problem in the future should another tool be connected like this. Reported by: rgrimes, kib, kevans Sponsored by: Dell EMC Notes: svn path=/head/; revision=335225
* libcompat: Only build libmagic build tool if MK_FILE is yes.Bryan Drewery2018-06-151-1/+4
| | | | | | | Sponsored by: Dell EMC Notes: svn path=/head/; revision=335218