aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/linux64
Commit message (Collapse)AuthorAgeFilesLines
* linux(4): Deduplicate unimpl/dummy syscall handlersConrad Meyer2020-11-051-1/+7
| | | | | | | | | | No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 Notes: svn path=/head/; revision=367395
* Pass -fuse-ld=/path/to/ld if ${LD} != "ld"Alex Richardson2020-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed so that setting LD/XLD is not ignored when linking with $CC instead of directly using $LD. Currently only clang accepts an absolute path for -fuse-ld= (Clang 12+ will add a new --ld-path flag), so we now warn when building with GCC and $LD != "ld" since that might result in the wrong linker being used. We have been setting XLD=/path/to/cheri/ld.lld in CheriBSD for a long time and used a similar version of this patch to avoid linking with /usr/bin/ld. This change is also required when building FreeBSD on an Ubuntu with Clang: In that case we set XCC=/usr/lib/llvm-10/bin/clang and since /usr/lib/llvm-10/bin/ does not contain a "ld" binary the build fails with `clang: error: unable to execute command: Executable "ld" doesn't exist!` unless we pass -fuse-ld=/usr/lib/llvm-10/bin/ld.lld. This change passes -fuse-ld instead of copying ${XLD} to WOLRDTMP/bin/ld since then we would have to ensure that this file does not exist while building the bootstrap tools. The cross-linker might not be compatible with the host linker (e.g. when building on macos: host-linker= Mach-O /usr/bin/ld, cross-linker=LLVM ld.lld). Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D26055 Notes: svn path=/head/; revision=364761
* Allow overriding the tool used for stripping binariesAlex Richardson2020-08-111-1/+1
| | | | | | | | | | | | | | | | | | | Since the make variable STRIP is already used for other purposes, this uses STRIPBIN (which is also used for the same purpose by install(1). This allows using LLVM objcopy to strip binaries instead of the in-tree elftoolchain objcopy. We make use of this in CheriBSD since passing binaries generated by our toolchain to elftoolchain strip sometimes results in assertion failures. This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516 by specifying STRIPBIN=/path/to/llvm-strip Obtained from: CheriBSD Reviewed By: emaste, brooks Differential Revision: https://reviews.freebsd.org/D25988 Notes: svn path=/head/; revision=364119
* More fixes to build the kernel with a compiler that defaults to -fno-commonAlex Richardson2020-04-181-1/+1
| | | | | | | | | Using the same approach as the last commit for the files used by genassym.sh. Obtained from: CheriBSD Notes: svn path=/head/; revision=360072
* Replace -Werror with ${WERROR} in module buildsWarner Losh2019-08-251-1/+1
| | | | Notes: svn path=/head/; revision=351497
* linuxulator: rename linux_locore.s to .asmEd Maste2019-07-301-1/+1
| | | | | | | | | | | | | | | | | It is assembled using "${CC} -x assembler-with-cpp", which by convention (bsd.suffixes.mk) uses the .asm extension. This is a portion of the review referenced below (D18344). That review also renamed linux_support.s to .S, but that is a functional change (using the compiler's integrated assembler instead of as) and will be revisited separately. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18344 Notes: svn path=/head/; revision=350451
* Add warning to the Linuxulator makefiles that building it outside of aDmitry Chagin2019-05-131-0/+4
| | | | | | | | | | | kernel does not make sence. PR: 222861 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20179 Notes: svn path=/head/; revision=347540
* Linuxulator depends on a fundamental kernel settings such as SMP. ManyDmitry Chagin2019-05-131-9/+0
| | | | | | | | | | | | | | | | | | | | | | of them listed in opt_global.h which is not generated while building modules outside of a kernel and such modules never match real cofigured kernel. So, we should prevent our users from building obviously defective modules. Therefore, remove the root cause of the building of modules outside of a kernel - the possibility of building modules with DEBUG or KTR flags. And remove all of DEBUG printfs as it is incomplete and in threaded programms not informative, also a half of system call does not have DEBUG printf. For debuging Linux programms we have dtrace, ktr and ktrace ability. PR: 222861 Reviewed by: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20178 Notes: svn path=/head/; revision=347538
* The build process generates assym.inc from genassym.o, so don't forgetDmitry Chagin2019-05-061-1/+2
| | | | | | | | | to clean genassym.o MFC after: 2 weeks Notes: svn path=/head/; revision=347196
* All genassym.sh usage need offset.incBryan Drewery2018-07-031-1/+1
| | | | Notes: svn path=/head/; revision=335910
* linux64: add arm64 linuxulator build detailsEd Maste2018-06-251-2/+9
| | | | | | | | | | | | | The arm64 linuxulator needs different arguments for the objcopy invocation used to build the linux VDSO. These arguments are both arch- and OS-dependent, so I did not try to use some common setting for them. Reviewed by: imp Sponsored by: Turing Robotic Industries Differential Revision: https://reviews.freebsd.org/D16011 Notes: svn path=/head/; revision=335646
* linux64: use linux output target for linux_vdso.soEd Maste2018-06-121-1/+1
| | | | | | | | | | | | | | | | | | linux_vdso.so provides the vdso for the linuxulator's amd64 target and is mapped into a Linux binary's address space. Thus it should be a Linux-style .so, which has the ELF OS/ABI unset. It turns out that ELF Tool Chain elfcopy/objcopy also has a bug where the OS/ABI field is unset, regardless of the specified --output-target, so this change is a no-op with the default in-tree toolchain. This is a real fix when using external binutils, and the ELF Tool Chain bug will be fixed in the future. PR: 228934 Sponsored by: Turing Robotic Industries Notes: svn path=/head/; revision=334998
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* Rename assym.s to assym.incEd Maste2018-03-201-3/+3
| | | | | | | | | | | | assym is only to be included by other .s files, and should never actually be assembled by itself. Reviewed by: imp, bdrewery (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14180 Notes: svn path=/head/; revision=331254
* Move assym.s to DPSRCS in linux modulesEd Maste2018-02-051-2/+2
| | | | | | | | | | assym.s exists only to be included by other .s files, and should not actually be assembled by itself. Sponsored by: Turing Robotic Industries Inc. Notes: svn path=/head/; revision=328883
* Correct MD patch in linux64 module MakefileEd Maste2018-01-291-2/+2
| | | | | | | | | Reviewed by: imp Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14061 Notes: svn path=/head/; revision=328526
* Revert r319053 due to lack of sence. As pointed out by kib@ opt_global.hDmitry Chagin2017-06-041-1/+1
| | | | | | | | | | contains such fundamental settings as e.g. SMP option and fake opt_global.h almost never match real configured kernels. Reported by: kib@ Notes: svn path=/head/; revision=319570
* On success, getrandom() Linux system call returns the number of bytes thatDmitry Chagin2017-05-281-1/+1
| | | | | | | | | | | | | | were copied to the buffer supplied by the user. Also fix getrandom() if Linuxulator modules are built without the kernel. PR: 219464 Submitted by: Maciej Pasternacki Reported by: Maciej Pasternacki MFC after: 1 week Notes: svn path=/head/; revision=319053
* Strip _binary_linux_locore_o_size from ${VDSO}.so as it is a low absoluteDmitry Chagin2017-05-281-0/+1
| | | | | | | | | | | symbol, and this breaks symbol lookup in ddb. Requested by: bde@ MFC after: 1 week Notes: svn path=/head/; revision=319052
* sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper2017-03-041-2/+2
| | | | | | | | | | | This simplifies make output/logic Tested with: `cd sys/modules; make ALL_MODULES=` on amd64 MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314651
* Exclude -flto when building *genassym.oEd Maste2017-02-211-1/+1
| | | | | | | | | | | | | | | | | The build process generates *assym.h using nm from *genassym.o (which is in turn created from *genassym.c). When compiling with link-time optimization (LTO) using -flto, .o files are LLVM bitcode, not ELF objects. This is not usable by genassym.sh, so remove -flto from those ${CC} invocations. Submitted by: George Rimar Reviewed by: dim MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9659 Notes: svn path=/head/; revision=314054
* Implement linux version of ptrace(2). It's nowhere near complete,Edward Tomasz Napierala2017-02-161-1/+1
| | | | | | | | | | | | but it allows to use 64 bit linux strace(1) on 64 bit linux binaries. Reviewed by: dchagin (earlier version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9406 Notes: svn path=/head/; revision=313809
* opt_apic.h is only used on i386.Bryan Drewery2016-07-271-1/+4
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303415
* pass -fPIC to the assembler, not linkerEd Maste2016-02-251-2/+2
| | | | | | | | | | | | | | -fPIC has no effect on linking although it seems to be ignored by GNU ld.bfd. However, it causes ld.lld to terminate with an invalid argument error. Reviewed by: dchagin, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5444 Notes: svn path=/head/; revision=296057
* Remove unneeded includes of opt_kdtrace.h.Mark Johnston2015-11-221-1/+1
| | | | | | | | As of r258541, KDTRACE_HOOKS is defined in opt_global.h, so opt_kdtrace.h is not needed when defining SDT(9) probes. Notes: svn path=/head/; revision=291153
* For objcopy, use --input-target and --output-targetCraig Rodrigues2015-05-251-1/+1
| | | | | | | | | | | | When building with gcc 4.9 and binutils 2.25, using '--input' and '--output' returns an error message: objcopy: option `--input' is ambiguous Reported by: Jenkins Notes: svn path=/head/; revision=283506
* Implement epoll family system calls. This is a tiny wrapperDmitry Chagin2015-05-241-1/+1
| | | | | | | | | | | | | | | around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata. Initial patch developed by rdivacky@ in 2007, then extended by Yuri Victorovich @ r255672 and finished by me in collaboration with mjg@ and jillies@. Differential Revision: https://reviews.freebsd.org/D1092 Notes: svn path=/head/; revision=283441
* Add preliminary support for x86-64 Linux binaries.Dmitry Chagin2015-05-241-0/+55
Differential Revision: https://reviews.freebsd.org/D1076 Notes: svn path=/head/; revision=283424