aboutsummaryrefslogtreecommitdiff
path: root/Makefile.libcompat
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Only build jevents if MK_PMC is yes and only for amd64 in libcompat.Bryan Drewery2018-06-151-1/+6
| | | | | | | Sponsored by: Dell EMC Notes: svn path=/head/; revision=335216
* libpmc/pmu: enable for i386 as wellMatt Macy2018-05-311-1/+1
| | | | Notes: svn path=/head/; revision=334455
* X_COMPILER_* may not be defined.Bryan Drewery2018-01-241-1/+2
| | | | | | | Sponsored by: Dell EMC Notes: svn path=/head/; revision=328347
* Check for GCC first rather than clang in the MIPS lib32 rules.John Baldwin2018-01-161-8/+8
| | | | | | | | | | This works around a bug with X_COMPILER_TYPE and permits mips64 to build again with in-tree gcc as well as clang and external gcc. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=328036
* Allow MIPS lib32 to build with clang.John Baldwin2018-01-111-0/+9
| | | | | | | | | | | | Don't try to set -march as clang doesn't permit use of the O32 ABI with newer CPU microarchitectures like 'mips3'. In addition, clang doesn't permit the O32 ABI with the default N64 target, so use an explicit O32 -target for clang. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=327841
* Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain ↵Bryan Drewery2017-11-051-0/+2
| | | | | | | | | | | | | | | | | | | | | targets. This problem was caused by r325329 and r325350. For the release(7) targets, some will run mm-mtree.sh which itself runs make with a MAKEOBJDIRPREFIX. The execution of that script leaks OBJROOT, MAKEOBJDIR, and MAKELEVEL=1 in the environment. This causes the mm-mtree makes to not do some basic setup of OBJROOT and only use this special MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further nested makes, such as a tree walk. If that tree walk sets OBJROOT/OBJTOP such as r325329 is doing, then the wrong OBJDIRs end up being used due to the unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR. Pointyhat to: bdrewery Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325412
* Set OBJROOT/OBJTOP as make arguments. Missed in r325329.Bryan Drewery2017-11-051-3/+3
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325411
* Reduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.Bryan Drewery2017-11-021-2/+4
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325329
* Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.Bryan Drewery2017-11-011-5/+7
| | | | | | | | | | | | | | | | | | | | | | This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This new format is used regardless of cross or native build. It allows easier management of multiple source tree object directories. The UNIFIED_OBJDIR option will be removed and its feature made permanent for the 12.0 release. Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed) Prior work: D3711 D874 Reviewed by: gjb, sjg Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html Discussed with: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12840 Notes: svn path=/head/; revision=325288
* lib32/libsoft: Store object files in a more consistent structure.Bryan Drewery2017-10-291-2/+2
| | | | | | | | | | | | Having objects in world32 and a sysroot in lib32 was confusing and inconsistent with the normal build. Now objects are stored in obj-lib32 (or obj-libsoft) and the sysroot (analagous to WORLDTMP) is stored in obj-lib32/tmp. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325085
* Move some LIBCOMPAT tmpdir logic setup to its own build target.Bryan Drewery2017-10-291-0/+10
| | | | | | | | | | | Its own build target was already handling mtree extractions just as _worldtmp did, so the other cleaning of the tmpdir makes sense here as well. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325074
* Support armv7 builds for userlandWarner Losh2017-10-051-2/+2
| | | | | | | | | | | | | | | | | | | Make armv7 as a new MACHINE_ARCH. Copy all the places we do armv6 and add armv7 as basically an alias. clang appears to generate code for armv7 by default. armv7 hard float isn't supported by the the in-tree gcc, so it hasn't been updated to have a new default. Support armv7 as a new valid MACHINE_ARCH (and by extension TARGET_ARCH). Add armv7 to the universe build. Differential Revision: https://reviews.freebsd.org/D12010 Notes: svn path=/head/; revision=324340
* Adjust r322633 to only apply to libexec/rtld-elf, and not usr.bin/ldd,Enji Cooper2017-09-301-2/+6
| | | | | | | | | | | | when running build32/install32 This unbreaks installing usr.bin/ldd as ldd32 when NO_RTLD is defined. MFC after: 1 week MFC with: r322633 Notes: svn path=/head/; revision=324143
* Honor NO_RTLD for rtld-elf, similar to what's done in libexec/Makefile, withEnji Cooper2017-08-171-2/+2
| | | | | | | | | libexec/rtld-elf/... for MK_{LIB32,LIBSOFT}. MFC after: 1 week Notes: svn path=/head/; revision=322633
* Follow-up to r321684 (Don't use libc++ when cross-building for gccDimitry Andric2017-08-071-2/+1
| | | | | | | | | | | | | arches), and handle two more cases where libc++ includes could be incorrectly enabled, in case the host compiler is clang 5.0.0, and the target (cross) compiler is gcc 4.2.1. Noted by: bdrewery MFC after: 3 days X-MFC-With: 321684 Notes: svn path=/head/; revision=322170
* buildworld: Define SYSROOT to WORLDTMP.Bryan Drewery2017-06-191-0/+1
| | | | | | | | | | | | | | This is to allow downstream Makefiles to know for sure they are building against a sysroot rather than only depending on ${DESTDIR} or other assumptions. This also exports it into buildenv. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=320119
* Support skipping 'make obj' tree-walk.Bryan Drewery2017-05-091-2/+2
| | | | | | | | | | This is part of a larger effort for WITH_AUTO_OBJ and a WORLDFAST option. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318105
* META_MODE: Fix build-tools still sometimes rebuilding during target build.Bryan Drewery2017-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a cross-build, the build-tools are native host binaries. We do not want to rebuild them when building for the target. Bmake previously did not support checking .NOMETA on an existing target, so .NOMETA_CMP was used here. However, .NOMETA_CMP still triggers meta mode conditions if the number of commands or the command changes. In r312467 the paths to build ncurses files were modified and thus triggered meta mode to rebuild the build tools (make_keys, make_hash) in ncurses during the target build. Bmake 20160604 committed in r301462 changed .NOMETA to also skip meta mode logic for an existing .meta file as well, thus it is now the proper fix here. I explored moving the build-tools output to WORLDTMP/tools with relatively good success, but have concerns that doing so would be problematic for downstream vendors who use LOCAL_TOOL_DIRS and expect the tools to be in current OBJDIR for the target. It also adds more complexity into finding the tools during target build and handling of where they are for rescue/rescue and mkcsmapper_static/mkesdb_static which should really not be connected in build-tools anyway. MFC after: 2 weeks Reported by: many Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316586
* Use cross-NM (XNM) in compat32 buildEd Maste2017-01-271-0/+2
| | | | | | | | | | | An attempt to build mips64 using external toolchain failed as it tried to use the host amd64 nm. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=312857
* Enable /usr/lib32 for o32 binaries on mips64.John Baldwin2017-01-061-2/+16
| | | | | | | | | | | | | Build and install an o32 set of libraries on mips64 suitable for running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in MALTA64. Reviewed by: jmallett, imp Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D9032 Notes: svn path=/head/; revision=311567
* Set -m32 in MD LIB32CPUCFLAGS rather than MI LIB32CFLAGS.John Baldwin2017-01-061-1/+3
| | | | | | | | | | | Both amd64 and powerpc64 use -m32 to compile 32-bit binaries, but not all platforms follow this convention. Move the -m32 compile flag into the per-architecture flags to accomodate other architectures. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=311566
* Fix build of lib32 libraries for amd64 and powerpc64 with cross toolchainBaptiste Daroussin2016-12-251-1/+1
| | | | Notes: svn path=/head/; revision=310543
* Fix in-tree GCC builds after r304681.Bryan Drewery2016-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There were a few issues. - In-tree GCC won't have X_COMPILER_TYPE defined but will have WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can be used. Make the clang check specific to clang as well to ensure -target doesn't leak into a GCC build. - When using a cross-compiler GCC (with a default sysroot or arch) and also passing --sysroot, it basically forgets all internal paths for libraries. We've already worked around this quite a bit for the external toolchains. Now for the in-tree bootstrap cross-compiler GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt object files, but also -isystem and -L to fix the paths. This creates quite a spammy build log, but it is clear and still achieves the goals and stays consistent between internal and external build flags. Reducing the spam by using the '=' prefix feature will help and be done later. MFC after: 3 days X-MFC-With: r304681 Reported by: bz Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=304695
* Don't disable binutils/elftoolchain bootstrapping with external compiler.Bryan Drewery2016-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This was a regression from r300349. Setting MK_CROSS_COMPILER=no forces the compiler bootstraping *and* the binutils/elftoolchain bootstrapping to be disabled in share/mk/src.opts.mk. The only intent with using an external compiler is to disable bootstrapping of the compiler. The binutils/elftoolchain bootstrapping must still occur unless XAS is set. This did not affect WITH_SYSTEM_COMPILER. Now that setting an external compiler sets both MK_CLANG_BOOTSTRAP and MK_GCC_BOOTSTRAP to no, and MK_CROSS_COMPILER does the same via share/mk/src/opts.mk, remove redundant logic that checks for MK_CROSS_COMPILER. It will not always be true now that MK_CROSS_COMPILER==no when an external compiler is used and --sysroot/-target is needed. Reported by: sbruno Pointyhat to: bdrewery MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303274
* WITH_SYSTEM_COMPILER: Avoid using GCC4.8+ logic on native GCC4.2 platforms.Bryan Drewery2016-06-291-2/+2
| | | | | | | | | | | | | | As the XXX notes, these should really be checking MK_GNUCXX since there is already a version check in share/mk/src.opts.mk to disable it. Fixing that here is more complex though. This could also be using X_COMPILER_FEATURES but uses X_COMPILER_VERSION to keep in sync with the src.opts.mk logic. Tested by: andreast Sponsored by: EMC / Isilon Storage Division Approved by: re (gjb) Notes: svn path=/head/; revision=302257
* Fix native powerpc64 build of lib32 with in-tree GCC.Bryan Drewery2016-06-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | - This was broken by r300350 and r300885. - Add some comments around the external GCC logic since it is spread out and in need of some cleanup. - The problem was that X_COMPILER_TYPE is always defined from CC->XCC's default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then X_COMPILER_TYPE was getting GCC and triggering the external logic in Makefile.libcompat. It was intended to always provide -isystem with GCC since --sysroot is used into the lib32 sysroot which won't modify the header path without the -isystem. The use of the libc++/std=c++11 override was only intended to be used for external compilers though (more accurately GCC 4.8+ but that's a separate assumption to cleanup). Apply the same logic from Makefile.inc1 to Makefile.libcompat to only add the libc++ override when needed for external compilers. Pointyhat to: bdrewery Tested with: native ppc64 (swills), universe, ppc64 xtoolchain, amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2) Reported by: andreast, swills Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=301939
* Use -L to specify compat32 library paths instead of -YEd Maste2016-06-091-1/+1
| | | | | | | | | | | | | | | | -Y is an uncommon linker option that is rather similar to -L. In discussion with Peter it seems early amd64 development might have required the -Y-specific behaviour, but it is no longer necessary. Switch to -L which is more widely supported and much more commonly used, to make it easier to link the FreeBSD base system with linkers other than ld.bfd. Submitted by: Rafael Ávila de Espíndola Differential Revision: https://reviews.freebsd.org/D6681 Notes: svn path=/head/; revision=301746
* Libcompat: Swap CXX/CFLAGS.Bryan Drewery2016-05-291-1/+1
| | | | | | | | | This is the same as done for the native build in r300770 to ensure that the libc++ build reads from SYSROOT/usr/include/c++/v1 before reading from SYSROOT/usr/include. Notes: svn path=/head/; revision=300944
* GCC External: Revert r300886, r300904, r300917, r300918Bryan Drewery2016-05-291-6/+11
| | | | | | | | The fix in r300873 is mostly enough. A fix for lib32 will be committed.separately. Notes: svn path=/head/; revision=300943
* Libcompat: Set build tools in environment rather than make overrides.Bryan Drewery2016-05-291-4/+6
| | | | | | | | | | | | This allows the CXX hack in r300917 for external GCC to work for the lib32 build. It is also the same pattern as the native build uses by adding the tools into CROSSENV for external toolchain, rather than make overrides. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300926
* Move external GCC compiler hacks to bsd.sys.mk.Bryan Drewery2016-05-271-7/+0
| | | | | | | | | | | | | | | | | This allows respecting -nostdinc, -nostdinc++ and -nostdlib before making the decision to add in -isystem, etc. The -isystem flags are problematic for building lib/libc++ and lib/libcxxrt which wants to only use its own headers. More information the need of these flags can be found at https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html This also reverts r300873. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300886
* Libcompat: Only pass -isystem =/usr/include for external GCC.Bryan Drewery2016-05-271-2/+1
| | | | | | | | | | | | This is the same as the main build logic. GCC with a cross-compiler requires using -isystem to =/usr/include to get the search order correct. Reported by: dim, asomers Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300885
* Set CPP from XCPP for the libcompat build.Bryan Drewery2016-04-151-0/+1
| | | | | | | Submitted by: Mark Millard <markmi@dsl-only.net> Notes: svn path=/head/; revision=298079
* META_MODE: Don't rebuild build-tools targets during normal build.Bryan Drewery2016-04-141-0/+4
| | | | | | | | | | | | This avoids 'build command changed' due to CFLAGS/CC changes during the normal build. Without this the build-tools targets end up rebuilding for the *target* rather than keeping the native versions built in build-tools. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297997
* Remove leftover _LDSCRIPTROOT missed in r297270.Bryan Drewery2016-04-051-1/+1
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297591
* LIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.Bryan Drewery2016-03-311-1/+2
| | | | | | | | | This is the same fix as r297281 for the normal build. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297462
* Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.Bryan Drewery2016-03-301-1/+1
| | | | | | | | | | Reviewed by: emaste, hselasky (partial), brooks (brief) Discussed on: arch@ Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5742 Notes: svn path=/head/; revision=297434
* Fix libcompat not handling some external toolchain flags.Bryan Drewery2016-03-251-3/+11
| | | | | | | | | | - Use libc++ with GCC. - Use CROSS_BINUTILS_PREFIX with -B (r280980 addressed this mostly already) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297272
* Build libcompat (lib32) with a --sysroot pointing into its stage directory.Bryan Drewery2016-03-251-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This overrides the cross-compiler's default sysroot to use the WORLD32's sysroot for building the lib32 libraries. Previously the cross-compiler would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags were used to build using the lib32 files. This leads to multiple issues discussed later. Some extra headers are now needed to be staged since the 64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP is still used via PATH for build tools. Overriding the default target/arch is retained in the CC/CXX overrides. This allows reverting the LDSCRIPT rewriting in installworld from r296921 and r235122, thus allowing read-only objdirs to work for installing again. This removes the need for _LDSCRIPTROOT. This allows progressing the change to always use --sysroot for the build rather than only relying on the cross-compiler's default sysroot. The work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER not using a --sysroot [1]. PR: 196193 [1] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297270