aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/linux/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Fix some modules to export more used symbolsKonstantin Belousov2021-11-251-0/+2
| | | | (cherry picked from commit 5bb3134a8c21cb87b30e135ef168483f0333dabb)
* Fix i386 linux module after r367395.Tijl Coosemans2020-12-051-2/+2
| | | | | | | | | | | | | In r367395 parts of machine dependent linux_dummy.c were moved to a new machine independent file sys/compat/linux/linux_dummy.c and the existing linux_dummy.c was renamed to linux_dummy_machdep.c. Add linux_dummy_machdep.c to the linux module for i386. Rename sys/amd64/linux32/linux_dummy.c for consistency. Add the new linux_dummy.c to the linux module for i386. Notes: svn path=/head/; revision=368372
* linux(4): Deduplicate unimpl/dummy syscall handlersConrad Meyer2020-11-051-0/+6
| | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | 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
* 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
* Fix futexes on i386 after the 4/4G split.Konstantin Belousov2018-04-241-3/+7
| | | | | | | | | | | Use proper method to access userspace. For now, only the slow copyout path is implemented. Reported and tested by: tijl (previous version) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=332930
* 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-4/+4
| | | | | | | | | | | | 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
* Share a single bsd-linux errno table across MD consumersEd Maste2018-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | Three copies of the linuxulator linux_sysvec.c contained identical BSD to Linux errno translation tables, and future work to support other architectures will also use the same table. Move the table to a common file to be used by all. Make it 'const int' to place it in .rodata. (Some existing Linux architectures use MD errno values, but x86 and Arm share the generic set.) This change should introduce no functional change; a followup will add missing errno values. MFC after: 3 weeks Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14665 Notes: svn path=/head/; revision=331056
* 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
* 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/+2
| | | | | | | | | | | 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
* Fix a copy/paste bug introduced during X86_64 Linuxulator work.Dmitry Chagin2016-07-101-1/+1
| | | | | | | | | | | | | | | | FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation use READ_IMPLIES_EXEC flag, introduced in r302515. While here move common part of mmap() and mprotect() code to the files in compat/linux to reduce code dupcliation between Linuxulator's. Reported by: Johannes Jost Meixner, Shawn Webb MFC after: 1 week XMFC with: r302515, r302516 Notes: svn path=/head/; revision=302517
* 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
* For objcopy, use --input-target and --output-targetCraig Rodrigues2015-05-251-2/+2
| | | | | | | | | | | | 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
* Rework signal code to allow using it by other modules, like linprocfs:Dmitry Chagin2015-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | 1. Linux sigset always 64 bit on all platforms. In order to move Linux sigset code to the linux_common module define it as 64 bit int. Move Linux sigset manipulation routines to the MI path. 2. Move Linux signal number definitions to the MI path. In general, they are the same on all platforms except for a few signals. 3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion tables to avoid conversion errors. 4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside of allowed on Linux signal numbers. PR: 197216 Notes: svn path=/head/; revision=283474
* 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
* Refund the proc emuldata struct for future use. For now move flags fromDmitry Chagin2015-05-241-2/+3
| | | | | | | | | | | | | thread emuldata to proc emuldata as it was originally intended. As we can have both 64 & 32 bit Linuxulator running any eventhandler can be called twice for us. To prevent this move eventhandlers code from linux_emul.c to the linux_common.ko module. Differential Revision: https://reviews.freebsd.org/D1073 Notes: svn path=/head/; revision=283422
* Introduce a new module linux_common.ko which is intended for theDmitry Chagin2015-05-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c Differential Revision: https://reviews.freebsd.org/D1072 In collaboration with: Vassilis Laganakos. Reviewed by: trasz Notes: svn path=/head/; revision=283421
* Implement vdso - virtual dynamic shared object. Through vdso LinuxDmitry Chagin2015-05-241-4/+25
| | | | | | | | | | | | exposes functions from kernel with proper DWARF CFI information so that it becomes easier to unwind through them. Using vdso is a mandatory for a thread cancelation && cleanup on a modern glibc. Differential Revision: https://reviews.freebsd.org/D1060 Notes: svn path=/head/; revision=283407
* Retire the '@' symlink. It isn't really needed and causes moreWarner Losh2014-11-061-4/+1
| | | | | | | | | | | | problems than it solves. SYSDIR is already defined almost always and can be used instead. Working around the one case where it isn't is much easier than working around the fact that @ may not exist in 18 other places. Differential Revision: https://reviews.freebsd.org/D1100 Notes: svn path=/head/; revision=274184
* Add foo_genassym.c files to DPSRCS so dependencies for them are generated.John Baldwin2014-10-271-0/+1
| | | | | | | | This ensures these objects are rebuilt to generate an updated header of assembly constants if needed. Notes: svn path=/head/; revision=273744
* move linux*_locore.s and linux*_support.s to SRCS, remove the OBJSWarner Losh2014-10-171-6/+5
| | | | | | | | | | | | | entry and remove now-redunant dependencies. Add assym.s to linux*_locore.s build, as it depends on it. With this change, linux*.ko no longer builds every time through a KERNFAST run. Sponsored by: Netflix Notes: svn path=/head/; revision=273206
* Implement most of timer_{create,settime,gettime,getoverrun,delete}Bjoern A. Zeeb2014-09-181-0/+1
| | | | | | | | | | | | | | | | | for amd64/linux32. Fix the entirely bogus (untested) version from r161310 for i386/linux using the same shared code in compat/linux. It is unclear to me if we could support more clock mappings but the current set allows me to successfully run commercial 32bit linux software under linuxolator on amd64. Reviewed by: jhb Differential Revision: D784 MFC after: 3 days Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=271743
* Move most of the 15 variations on generating opt_inet.h andWarner Losh2014-08-041-2/+0
| | | | | | | | | opt_inet6.h into kmod.mk by forcing almost everybody to eat the same dogfood. While at it, consolidate the opt_bpf.h and opt_mroute.h targets here too. Notes: svn path=/head/; revision=269540
* - For kernel compiled only with KDTRACE_HOOKS and not any lock debuggingAttilio Rao2013-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | option, unbreak the lock tracing release semantic by embedding calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined version of the releasing functions for mutex, rwlock and sxlock. Failing to do so skips the lockstat_probe_func invokation for unlocking. - As part of the LOCKSTAT support is inlined in mutex operation, for kernel compiled without lock debugging options, potentially every consumer must be compiled including opt_kdtrace.h. Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES is linked there and it is only used as a compile-time stub [0]. [0] immediately shows some new bug as DTRACE-derived support for debug in sfxge is broken and it was never really tested. As it was not including correctly opt_kdtrace.h before it was never enabled so it was kept broken for a while. Fix this by using a protection stub, leaving sfxge driver authors the responsibility for fixing it appropriately [1]. Sponsored by: EMC / Isilon storage division Discussed with: rstone [0] Reported by: rstone [1] Discussed with: philip Notes: svn path=/head/; revision=258541
* Revert r255672, it has some serious flaws, leaking file references etc.Roman Divacky2013-09-181-1/+1
| | | | | | | Approved by: re (delphij) Notes: svn path=/head/; revision=255675
* Implement epoll support in Linuxulator. This is a tiny wrapper around kqueueRoman Divacky2013-09-181-1/+1
| | | | | | | | | | | | | | | | | to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data so this patch overrides kqueue fileops to maintain enough space in struct file. Initial patch developed by me in 2007 and then extended and finished by Yuri Victorovich. Approved by: re (delphij) Sponsored by: Google Summer of Code Submitted by: Yuri Victorovich <yuri at rawbw dot com> Tested by: Yuri Victorovich <yuri at rawbw dot com> Notes: svn path=/head/; revision=255672
* Assemble linux32_locore.s and ia32_sigtramp.S with clang integrated assembler.Roman Divacky2013-08-271-4/+0
| | | | | | | | | Support for .code32 and .code64 in llvm was implemented more than 2 years ago. Tested by: Dan McGregor <dan.mcgregor at usask dot ca> Notes: svn path=/head/; revision=254967
* Add missing dependency to linux${SFX}_genassym.cEitan Adler2013-06-171-1/+1
| | | | | | | | Submitted by: nox MFC After: 3 days Notes: svn path=/head/; revision=251869
* Fix make dependUlrich Spörlein2012-05-061-2/+2
| | | | Notes: svn path=/head/; revision=235078
* Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, toDimitry Andric2012-02-281-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp MFC after: 2 weeks Notes: svn path=/head/; revision=232263
* Upgrade our copy of llvm/clang to r126079, from upstream's trunk.Dimitry Andric2011-02-201-0/+5
| | | | | | | | This contains many improvements, primarily better C++ support, an integrated assembler for x86 and support for -pg. Notes: svn path=/head/; revision=218893
* Move linux_clone(), linux_fork(), linux_vfork() to a MI path.Dmitry Chagin2011-02-121-1/+1
| | | | Notes: svn path=/head/; revision=218616
* MFtbemd:Warner Losh2010-08-231-4/+4
| | | | | | | | | | | | Use MACHINE_CPUARCH in preference to MACHINE_ARCH. The former is the source code location of the machine, the latter the binary output. In general, we want to use MACHINE_CPUARCH instead of MACHINE_ARCH unless we're tesitng for a specific target. The isn't even moot for i386/amd64 where there's momemntum towards a MACHINE_CPUARCH == x86, although a specific cleanup for that likely would be needed... Notes: svn path=/head/; revision=211690
* Bring USB fixes for linux(4).Wojciech A. Koszek2010-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Intention of this commit is to let us take a full advantage of libusb(8) ported to Linux. This decreases a possibility of getting any collisions within ioctl() "command" space, especially with relation to LINUX_SNDCTL_SEQ... stuff. Basically, we provide commands, that will be mapped in the kernel to correct ones and forward those to the USB layer. Port enabling functionality brought with this patch is here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146895 Bump __FreeBSD_version to catch, since which version installing a port makes sense. This patch should bring no regressions. So far, only i386 is tested. Tested by: thompsa@ Reviewed by: thompsa@ OKed by: netchild@ Notes: svn path=/head/; revision=208486
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,Nathan Whitehorn2010-03-111-1/+1
| | | | | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb Notes: svn path=/head/; revision=205014
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onBjoern A. Zeeb2009-06-081-1/+1
| | | | | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c. Notes: svn path=/head/; revision=193744
* Remove opt_mac.h generation for various kernel modules that no longerRobert Watson2009-06-061-1/+1
| | | | | | | | | require it. Submitted by: pjd Notes: svn path=/head/; revision=193588
* Move opt_apic.h closer to the "XXX: for assym.s" comment.Dag-Erling Smørgrav2009-05-261-1/+4
| | | | | | | | Suggested by: jhb MFC after: 1 week Notes: svn path=/head/; revision=192855
* opt_apic.h is i386-only.Dag-Erling Smørgrav2009-05-261-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=192852