path: root/tools/build/cross-build
Commit message (Collapse)AuthorAgeFilesLines
* Revert "tools/build: Unbreak bmake bootstrap on Linux"Jessica Clarke10 days1-8/+0
| | | | | | | Now that make.py no longer has the described hack on Linux we can drop this ugly workaround. This reverts commit fba998a3d897e6297baca74068e4ec1db7adaeec.
* tools/build: Unbreak bmake bootstrap on LinuxJessica Clarke2022-08-221-0/+8
| | | | | | | | | | | | Currently make.py has a hack to add the cross-build headers to the include search path when bootstrapping bmake on Linux (but not macOS). This is a bit of an abuse of these headers, and e9ba1fd5eda2 was not prepared for this, since sys/bitcount.h won't exist in that instance (it gets copied into WORLDTMP during the legacy build). Work around this until we can wean the bmake bootstrap off using these headers by not including sys/bitcount.h when it doesn't exist. Fixes: e9ba1fd5eda2 ("tools/build: Provide FreeBSD's bitstring API when cross-building")
* tools/build: Provide fls* when cross-building on LinuxJessica Clarke2022-08-181-0/+40
| | | | | | | | | flsll is needed for makefs's new ZFS support, and the others are added for completeness. Reviewed by: emaste, arichardson Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Differential Revision: https://reviews.freebsd.org/D36134
* tools/build: Provide FreeBSD's bitstring API when cross-buildingJessica Clarke2022-08-181-0/+4
| | | | | | | | | This is needed for building makefs as a cross-tool since the ZFS code uses these APIs. Reviewed by: emaste Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Differential Revision: https://reviews.freebsd.org/D36133
* cross-build: Add comment missing from 9e5b0d9eac5bJessica Clarke2021-12-151-0/+16
| | | | | | | | | Whilst the commit message documented some of the details, I had intended to include this comment in the actual header, but failed to amend the commit properly. Fixes: 9e5b0d9eac5b ("cross-build: Fix bmake bootstrap with glibc 2.34") MFC after: 1 week
* cross-build: Fix bmake bootstrap with glibc 2.34Jessica Clarke2021-12-151-0/+31
| | | | | | | | | | | | | As of glibc 2.34, our unistd.h wrapper's inclusion of stdlib.h exposes fragility in glibc's sys/wait.h and corresponding part of stdlib.h, leading to "error: use of undeclared identifier 'WNOHANG'" and similar errors when bootstrapping bmake. Work around this by wrapping sys/wait.h to force stdlib.h's inclusion first before it's implicitly included during the problematic window in sys/wait.h. MFC after: 1 week
* cross-build: Add __weak_symbol definition for libdwarf bootstrapJessica Clarke2021-12-151-0/+3
| | | | | Fixes: 3aa0bc89c6a1 ("libdwarf: Add a weak uncompress() symbol") MFC after: 1 week
* cross-build: Provide _PASSWORD_EFMT1 for libcrypt on LinuxJessica Clarke2021-12-071-0/+4
| | | | | | | | Linux's pwd.h does not define _PASSWORD_EFMT1 (macOS's does), so we need to define it in order to be able to bootstrap libcrypt (crypt-des.c uses it) on non-FreeBSD, which will be done in a subsequent commit. MFC after: 1 week
* cross-build: Define crypt_data in unistd.h for libcryptJessica Clarke2021-12-071-0/+5
| | | | | | | | This is where it's defined in the base system, so is where libcrypt expects it to exist when being built, and will be needed when being bootstrapped in a subsequent commit. MFC after: 1 week
* cross-build: fix some redeclaration warnings during bootstrapAlex Richardson2021-10-115-13/+6
| | | | MFC after: 3 days
* cross-build: Remove redundant lines.Warner Losh2021-10-102-4/+0
| | | | | | | | | There's two identical gid_from_group lines in a row. We only need one. Ditto for uid_from_user(). Sponsored by: Netflix Reviewed by: bapt, jrtc27 Differential Revision: https://reviews.freebsd.org/D32442
* Fix cross-builds after 4e5d32a445f90d37966cd6de571978551654e3f3Jose Luis Duran2021-09-071-0/+19
| | | | | | | Add alignment macros to cross-build's sys/cdefs.h Pull Request: https://github.com/freebsd/freebsd-src/pull/531 MFC after: immediately (build fix)
* tools/build/cross-build: Fix building libllvmminimal on LinuxJessica Clarke2021-08-123-0/+133
| | | | | | | | | | There is a __used member in glibc's posix_spawn_file_actions_t in spawn.h, so we must temporarily undefine __used when including it, otherwise Support/Unix/Program.inc fails to build. This is based on similar handling for __unused in other headers. Fixes: 31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux") MFC after: 1 week
* Allow bootstrapping llvm-tblgen on macOS and LinuxAlex Richardson2021-08-021-0/+6
| | | | | | | | | | This is needed in order to build various LLVM binutils (e.g. addr2line) as well as clang/lld/lldb. Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org> Test Plan: Compiles on ubuntu 18.04 and macOS 11.4 Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D31057
* tools/build: Don't redefine open() for the linux bootstrapAlex Richardson2021-08-021-21/+4
| | | | | | | | | | | This is needed to bootstrap llvm-tblgen on Linux since LLVM calls `::open(...)` which does not work if open is a statement macro. Also stop defining O_SHLOCK/O_EXLOCK and update the only bootstrap tools user of those flags to deal with missing definitions. Reviewed By: jrtc27 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31226
* Change strmode argument type to mode_t for crossbuildAlfonso Gregory2021-06-291-1/+1
| | | | | | | To match the libc changes. Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/493
* Silence a macro-redefined warning when crossbuildingAlex Richardson2021-03-011-0/+2
| | | | | This is already defined by the ncurses headers, so just undef it before defining it again.
* Fix cross-build support for Ubuntu 16.04Jessica Clarke2021-01-231-1/+9
| | | | | | | | | Older glibc headers did some very nasty things that have since been sanitised. We could also fix this by adding a linux/getopt.h wrapper alongside the existing common/getopt.h that #undef's __need_getopt, but that seems a little more hacky and complicated. Reviewed by: arichardson
* Fix warnings during bootstrap phase on macOSAlex Richardson2021-01-071-1/+1
* Fix warnings during bootstrap on Linux systemsAlex Richardson2021-01-0710-63/+66
| | | | | Most warnings are currently off for the boostrap phase, but once D27598 lands they will be enabled again.
* Fix more -Wundef warnings during bootstrapAlex Richardson2020-10-141-5/+0
| | | | Notes: svn path=/head/; revision=366699
* Fix dtrace tools bootstrap on non-FreeBSD after OpenZFS importAlex Richardson2020-09-195-51/+17
| | | | | | | | | | | | This required surprisingly few build system changes and only two changes to the openZFS compat headers which have been upstreamed as https://github.com/openzfs/zfs/pull/10863 Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26193 Notes: svn path=/head/; revision=365901
* Add necessary Makefile.inc1 infrastructure for building on non-FreeBSDAlex Richardson2020-08-252-0/+49
| | | | | | | | | | | | | | | | | | | | The most awkward bit in this patch is the bootstrapping of m4: We can't simply use the host version of m4 since that is not compatible with the flags passed by lex (at least on macOS, possibly also on Linux). Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also depends on lex (which needs m4 to generate any files). To work around this cyclic dependency we can build a bootstrap version of m4 (with pre-generated files) then use that to build the real m4. This patch also changes the xz/unxz/dd tools to always use the host version since the version in the source tree cannot easily be bootstrapped on macOS or Linux. Reviewed By: brooks, imp (earlier version) Differential Revision: https://reviews.freebsd.org/D25992 Notes: svn path=/head/; revision=364760
* Add missing FreeBSD functions to -legacy when building on macOS/LinuxAlex Richardson2020-08-257-0/+585
| | | | | | | | | | | | | | | | In most cases this simply builds the file from lib/libc for missing functions (e.g. strlcpy on Linux etc.). In cases where this is not possible I've added an implementation to tools/build/cross-build. The fgetln.c/fgetwln.c/closefrom.c compatibility code was obtained from https://gitlab.freedesktop.org/libbsd/libbsd, but I'm not sure it makes sense to import it into to contrib just for these three bootstrap files. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25978 Notes: svn path=/head/; revision=364759
* Add Linux/macOS compatibility system headers to tools/build/cross-buildAlex Richardson2020-08-2566-0/+3849
| | | | | | | | | | | | These headers are required in order to build the bootstrap tools on macOS and Linux. A follow-up commit will add implementations of functions that don't exist on those operating systems to -legacy when bootstrapping. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D14316 Notes: svn path=/head/; revision=364757
* Allow building mkimg as cross-toolSimon J. Gerraty2017-03-032-0/+38
| | | | | | | | | | | | For linux the mmap offset must also be page aligned, and we need to disable macros like __FBSDID() Change the linux osdep_uuidgen() to use more portable gettimeofday(). Reviewed by: marcel Notes: svn path=/head/; revision=314577
* Add hacks that I use to test cross-builds (by building onRuslan Ermilov2005-03-023-0/+19
native and foreign architectures and comparing products). They eliminate most of the differences caused by different object directory paths, timestamping, and identification. (Note WORLDTMP was renamed to ${OBJTREE}${.CURDIR}/tmp.) Notes: svn path=/head/; revision=143044