MFC r339738, r339744, r339770, r339773, r339864-r339866, r339907-r339908, r339912-r339913, r339916, r339954, r340213, r340395, r340840, r340910-r340911, r341424, r342773, r342974, r351027, r352073:
MFC r339738, r339744, r339770, r339773, r339864-r339866, r339907-r339908, r339912-r339913, r339916, r339954, r340213, r340395, r340840, r340910-r340911, r341424, r342773, r342974, r351027, r352073:MFC the BSD crtbegin to stable/12 but keep it disabled.r339738:Implement a BSD licensed crtbegin/crtendThese are needed for .ctors/.dtors and .jcr handling. The former needsall the function pointers to be called in the correct order from the.init/.fini section. The latter just needs to call a gcj specific functionif it exists with a pointer to the start of the .jcr section.This is currently disabled until __dso_handle support is added.Reviewed by: emasteSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D17587r339744:Add a missing include for src.opts.mk. Without it MK_TESTS isn't defined.MFC with: r339738Sponsored by: DARPA, AFRLr339770:Drop the csu tests WARNS to 5 to fix the powerpc64 build.MFC with: r339738Sponsored by: DARPA, AFRLr339773:Add __dso_handle to the BSD crtbegin. This is used to identify sharedobjects.MFC with: r339738Sponsored by: DARPA, AFRLr339864:Check __dso_handle is NULL in non-DSO objects. It should only be non-NULLwhen accessed from a shared object.MFC with: r339738Sponsored by: DARPA, AFRLr339865:Include the csu test directories in BSD.tests.distMFC with: r339738Sponsored by: DARPA, AFRLr339866:Make the .ctors, .dtors, and .jcr markers as static. They shouldn't beaccessible from out of the files they are defined in.MFC with: r339738Sponsored by: DARPA, AFRLr339907:The jcr argument to _Jv_RegisterClasses is used, stop marking it otherwise.MFC with: r339738Sponsored by: DARPA, AFRLr339908:Run the csu tests on a DSO. This builds the tests into a shared library,then runs these from the base test programs. With this we can checkcrtbeginS.o and crtendS.o are working as expected.MFC with: r339738Sponsored by: DARPA, AFRLr339912:Fix the location of the static keyword.MFC with: r339738Sponsored by: DARPA, AFRLr339913:Disable the .preinit_array test in DSOs, ld.bfd fails to link objects withthe section.MFC with: r339738Sponsored by: DARPA, AFRLr339916:Build the csu tests on all architectures.The tests haven't been run them, but this is enough to build them so I canget feedback on if the various crt.h headers are correct.MFC with: r339738Sponsored by: DARPA, AFRLr339954:Add __used to __CTOR_LIST__ and __DTOR_LIST__Enabling BSD_CRTBEGIN on amd64 resulted inerror: unused variable '__CTOR_LIST__'.__CTOR_LIST__ is indeed unused in crtbegin.c; it marks the beginning ofthe .ctors array and is used in crtend.c. Annotate __DTOR_LIST__ aswell for consistency.Discussed with: andrewMFC with: r339738Sponsored by: The FreeBSD Foundationr340213:Add the (untested) mips and sparc64 .init call sequences.The BSD crtbegin/crtend code now builds on all architectures, howeverfurther work is needed to check if it works correctly.MFC with: r339738Sponsored by: DARPA, AFRLr340395:Run __cxa_finalize in shared objects in the destructor path.When we have .dtors call them before .dtor handling, otherwise call froma destructor.PR: 233056MFC with: r339738Sponsored by: DARPA, AFRLr340840:Mark the function called by the MIPS .init/.fini sequence with .local.As with r328939 we need to mark local symbols as such. Without this theassembly parser treats the symbols as global and created relocationsagainst these private symbols.MFC with: r339738Sponsored by: DARPA, AFRLr340910:Add the missing 0 at the end of the .jcr section.Without this the dynamic library test was failing as it was calling_Jv_RegisterClasses multiple times.r340911:Re-enable the dynamiclib tests. These should be fixed by r340910.r341424:Disable the BSD CRT code on powerpc and sparc64, they need extra crt*.ofiles that haven't been implemented.Reported by: sbrunoMFC with: r339738Sponsored by: DARPA, AFRLr342773:Add explicit csu test dependencylib/csu/tests/dynamiclib requires libh_csu.so be built first. I'm notsure this is the most correct/best way to address this but it solvesthe issue in my testing.PR: 233734Sponsored by: The FreeBSD Foundationr342974:Create crtsavres.o for powerpc buildsSummary:GCC expects to link in a crtsavres.o on powerpc platforms. Onpowerpc64 this is an empty file, but on powerpc and powerpcspe this does containsome save/restore functions, which may not actually be necessary for newermodern GCC and clang. This appeases the in-tree gcc, though, and is needed inorder to switch to the BSD CRTRBEGIN.PR: 233751Reviewed By: andrewDifferential Revision: https://reviews.freebsd.org/D18826r351027:Enable BSD_CRTBEGIN on powerpcIn r342974 jhibbits added support to build crtsavres.o. This was theblocker for BSD_CRTBEGIN to be enabled there. As such enable thisoption again.Reviewed by: jhibbitsSponsored by: DARPA, AFRLr352073:csu: Add the riscv .init call sequenceReviewed by: brSponsored by: AxiadoDifferential Revision: https://reviews.freebsd.org/D21537
show more ...
Process irelocs for statically linked binaries from crt1 on x86.This makes statically linked binaries with ifuncs operational.Reported and tested by: mjgReviewed by: emaste, markjSponsored by:
Process irelocs for statically linked binaries from crt1 on x86.This makes statically linked binaries with ifuncs operational.Reported and tested by: mjgReviewed by: emaste, markjSponsored by: The FreeBSD FoundationApproved by: re (rgrimes)Differential revision: https://reviews.freebsd.org/D17363
Support for v1.10 (latest) of RISC-V privilege specification.New version is not compatible on supervisor mode with v1.9.1(previous version).Highlights: o BBL (Berkeley Boot Loader) provides
Support for v1.10 (latest) of RISC-V privilege specification.New version is not compatible on supervisor mode with v1.9.1(previous version).Highlights: o BBL (Berkeley Boot Loader) provides no initial page tables anymore allowing us to choose VM, to build page tables manually and enable MMU in S-mode. o SBI interface changed. o GENERIC kernel. FDT is now chosen standard for RISC-V hardware description. DTB is now provided by Spike (golden model simulator). This allows us to introduce GENERIC kernel. However, description for console and timer devices is not provided in DTB, so move these devices temporary to nexus bus. o Supervisor can't access userspace by default. Solution is to set SUM (permit Supervisor User Memory access) bit in sstatus register. o Compressed extension is now turned on by default. o External GCC 7.1 compiler used. o _gp renamed to __global_pointer$ o Compiler -march= string is now in use allowing us to choose required extensions (compressed, FPU, atomic, etc).Sponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D11800
Rework r234502 to include a modified CFLAGS along with ACFLAGS.On most architectures crt objects are compiled in a multiple-step processso that sed can be run on the generated assembly. As the fi
Rework r234502 to include a modified CFLAGS along with ACFLAGS.On most architectures crt objects are compiled in a multiple-step processso that sed can be run on the generated assembly. As the final step,the C compiler generates an object file from the modified assembly output.Currently this last step uses $CC with only $ACFLAGS. However, for otheruses in the tree, $ACFLAGS is meant to include assembly-specific compilerflags that are in addition to $CFLAGS (see default .S.o rulesbsd.suffixes.mk). In particular, external toolchains may requireadditional flags to select a non-default target which will be presentin CFLAGS but not ACFLAGS. To support this while still mitigating theissue with CFLAGS described in r234502, include a modified CFLAGS thatexcludes "-g" when assembling the modified assembly files.Note that normally an assembler ($AS) is used to assemble .s flags toobject files (see bsd.suffixes.mk). However, llvm-based toolchains donot currently have a stand-alone assembler.Reviewed by: impSponsored by: DARPA / AFRLDifferential Revision: https://reviews.freebsd.org/D10085
Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified pathsThis implifies pathing in make/displayed outputMFC after: 3 weeksSponsored by: Dell EMC Isilon
Start support for the RISC-V 64-bit architecture developed by UC Berkeley.RISC-V is a new ISA designed to support computer research and education, andis now become a standard open architecture for
Start support for the RISC-V 64-bit architecture developed by UC Berkeley.RISC-V is a new ISA designed to support computer research and education, andis now become a standard open architecture for industry implementations.This is a minimal set of changes required to run 'make kernel-toolchain'using external (GNU) toolchain.The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv.Reviewed by: andrew, bdrewery, emaste, impSponsored by: DARPA, AFRLSponsored by: HEIF5Differential Revision: https://reviews.freebsd.org/D4445