aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* [PowerPC64LE] Use a shared LIBC_ARCH for powerpc64le.Brandon Bergren2020-09-231-2/+2
| | | | | | | | | | | | | | | Given that we have converted to ELFv2 for BE already, endianness is the only difference between the two ARCHs. As such, there is no need to differentiate LIBC_ARCH between the two. Combining them like this lets us avoid needing to have two copies of several bits for no good reason. Sponsored by: Tag1 Consulting, Inc. Notes: svn path=/head/; revision=366039
* Revert that!Simon J. Gerraty2020-07-191-1/+1
| | | | Notes: svn path=/head/; revision=363351
* Oops missed Makefile.configSimon J. Gerraty2020-07-191-1/+1
| | | | Notes: svn path=/head/; revision=363350
* Remove sparc64 specific parts of libc.Warner Losh2020-02-261-1/+0
| | | | | | | | | | | | | | | Also update comments for which architectures use 128 bit long doubles, as appropriate. The softfloat specialization routines weren't updated since they appear to be from an upstream source which we may want to update in the future to get a more favorable license. Reviewed by: emaste@ Differential Revision: https://reviews.freebsd.org/D23658 Notes: svn path=/head/; revision=358348
* libssp_nonshared: use only on i386 and ppcEd Maste2020-02-051-2/+4
| | | | | | | | | | | libssp_nonshared.a defines one symbol, __stack_chk_fail_local. This is used only on i386 and powerpc; other archs emit calls directly to __stack_chk_fail. Simplify linking on other archs by omitting it. PR: 242941 [exp-run] Notes: svn path=/head/; revision=357592
* revert r341429 "disable BIND_NOW in libc, libthr, and rtld"Ed Maste2019-03-281-2/+0
| | | | | | | | | | | r345620 by kib@ fixed the rtld issue that caused a crash at startup during resolution of libc's ifuncs with BIND_NOW. PR: 233333 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=345625
* Unify i386 and amd64 getcontextx.c, and use ifuncs while there.Konstantin Belousov2019-02-141-0/+1
| | | | | | | | | | | In particular, use ifuncs for __getcontextx_size(), also calculate the size of the extended save area in resolver. Same for __fillcontextx2(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=344120
* disable BIND_NOW in libc, libthr, and rtldEd Maste2018-12-031-0/+2
| | | | | | | | | | | | | | | An issue remains with BIND_NOW and processes using threads. For now, restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and libthr. A patch is in review (D18400) that likely fixes this issue, but just disable BIND_NOW pending further testing after it is committed. PR: 233333 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=341429
* revert r340640 "libc: forcibly disable BIND_NOW"Ed Maste2018-11-261-2/+0
| | | | | | | | | | | When immediate bind mode is requested, as of r340675 rtld processes irelocs in PLT immediately after other PLT relocs. That addresses the libc + BIND_NOW startup crash the workaround is no longer needed. PR: 233333 Notes: svn path=/head/; revision=340969
* libc: forcibly disable BIND_NOWEd Maste2018-11-191-0/+2
| | | | | | | | | | | Building libc WITH_BIND_NOW results in segfault at process start. For now force BIND_NOW off until the root cause can be identified and fixed. PR: 233333 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=340640
* Move libc linker ifunc test to build target onlyEd Maste2018-09-241-5/+6
| | | | | | | | | | | Targets like 'cleandir' must not depend on toolchain capabilities. Reported by: delphij, Shawn Webb Approved by: re (kib) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=338903
* libc: require ifunc-capable linker for amd64/i386Ed Maste2018-09-211-0/+5
| | | | | | | | | | | We expect to introduce optimized libc routines in the near future, which requires use of a linker that supports ifuncs. Approved by: re (gjb, kib) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=338861
* Strip __RCSID() and __SCCSID() strings by default when building libc.John Baldwin2018-07-031-2/+4
| | | | | | | | | | | | | This is in preparation for changes to update the various ID strings in libc's source. CSRG ID strings will use __SCCSID() and there are some existing uses of __RCSID() for NetBSD ID strings already. These are generally under either an explicit #if 0 or an #ifdef LIBC_SCCS so are off by default and this change preserves that existing behavior. Differential Revision: https://reviews.freebsd.org/D15830 Notes: svn path=/head/; revision=335897
* Now that a special no-SSP libc is used for rtld, allowKonstantin Belousov2018-05-091-4/+0
| | | | | | | | | | | -fstack-protector-all for normal libc builds. Submitted by: Luis Pires Reviewed by: brooks Differential revision: https://reviews.freebsd.org/D15340 Notes: svn path=/head/; revision=333399
* Created static libc PIC/no-SSP library to be used by rtld.Konstantin Belousov2018-05-091-0/+1
| | | | | | | | | | | | | | | | Rtld is not compatible with SSP, and since we link libc_pic.a to rtld to have the basic support like memory and string copy functions, we have to both carefully limit libc use, and to provide the ssp support shims. This change makes the libc use in rtld more straighforward but still limited, and allows to remove the shims, to be done in the next commit. Submitted by: Luis Pires Reviewed by: bdrewery, brooks Differential revision: https://reviews.freebsd.org/D15283 Notes: svn path=/head/; revision=333397
* Support armv7 builds for userlandWarner Losh2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | | 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
* Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Replace dot-dot relative pathing with SRCTOP-relative paths where possibleEnji Cooper2017-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | This reduces build output, need for recalculating paths, and makes it clearer which paths are relative to what areas in the source tree. The change in performance over a locally mounted UFS filesystem was negligible in my testing, but this may more positively impact other filesystems like NFS. LIBC_SRCTOP was left alone so Juniper (and other users) can continue to manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as include Makefiles with custom options. Discussed with: marcel, sjg MFC after: 1 week Reviewed by: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9207 Notes: svn path=/head/; revision=312451
* Add full softfloat and hardfloat support for RISC-V.Ruslan Bukin2016-11-161-1/+2
| | | | | | | | | | | Hardfloat is now default (use riscv64sf as TARGET_ARCH for softfloat). Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8529 Notes: svn path=/head/; revision=308731
* Add full softfloat and hardfloat support for MIPS.Ruslan Bukin2016-10-311-1/+1
| | | | | | | | | | | | | | This adds new target architectures for hardfloat: mipselhf mipshf mips64elhf mips64hf. Tested in QEMU only. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8376 Notes: svn path=/head/; revision=308130
* Add different libc ldscript: the one without libssp --Ruslan Bukin2016-10-121-0/+4
| | | | | | | | | | | | | | we don't have it when MK_SSP==no. This fixes compilation on MIPS. Reviewed by: imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8212 Notes: svn path=/head/; revision=307146
* Implement userspace gettimeofday(2) with HPET timecounter.Konstantin Belousov2016-08-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. Nothing can me done against the access latency, but the syscall overhead can be removed. System already provides mappable /dev/hpetX devices, which gives straight access to the HPET registers page. Add yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed from kernel to userspace, index might be changed and libc invalidates its mapping as needed. Remove cpu_fill_vdso_timehands() KPI, instead require that timecounters which can be used from userspace, to provide tc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64 libc/<arch>/sys/__vdso_gettc.c into one source file in the new libc/x86/sys location. __vdso_gettc() internal interface is changed to move timecounter algorithm detection into the MD code. Measurements show that RDTSC even with the syscall overhead is faster than userspace HPET access. But still, userspace HPET is three-four times faster than syscall HPET on several Core2 and SandyBridge machines. Tested by: Howard Su <howard0su@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7473 Notes: svn path=/head/; revision=304285
* Make armv6 hard float abi by default. Kill armv6hf.Warner Losh2016-05-181-1/+2
| | | | | | | | | | Allow CPUTYPE=soft to build the current soft-float abi libraries. Add UPDATING entry to announce this. Approved by: re@ (gjb) Notes: svn path=/head/; revision=300119
* MFHGlen Barber2016-04-041-0/+3
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=297567
| * WITHOUT_TOOLCHAIN: Fix build of rtld.Bryan Drewery2016-03-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | MK_TOOLCHAIN==no disables building and installing of pic archives. c_pic.a is still needed for rtld though so force it to build in lib/libc and link directly to the objdir version of it for rtld. Somehow this has been broken since r148725. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297461
* | Remove libc, librtld_db, libthr packages, and further increaseGlen Barber2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the constraints on what needs to be installed in a specific to maintain consistency during upgrades. Create a new clibs package containing libraries that are needed as a bare minimum for consistency. With much help and input from: kib Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295337
* | First pass through library packaging.Glen Barber2016-02-041-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* Remove excess whitespaceBryan Drewery2016-01-271-1/+1
| | | | Notes: svn path=/head/; revision=294868
* Replace .CURDIR with SRCTOP to respect LIBC_SRCTOP feature.Bryan Drewery2016-01-251-5/+5
| | | | Notes: svn path=/head/; revision=294745
* Fix compilation on MIPS (typo introduced in r294227).Ruslan Bukin2016-01-181-1/+1
| | | | Notes: svn path=/head/; revision=294262
* Bring in initial libc and libstand support for RISC-V.Ruslan Bukin2016-01-171-1/+2
| | | | | | | | | | Reviewed by: andrew, emaste, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4943 Notes: svn path=/head/; revision=294227
* Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, asColin Percival2015-12-251-0/+1
| | | | | | | | | | | | POSIX requires for the c99 compiler. (In fact, our c99(1) already ignores -lxnet; but our make(1) doesn't set ${CC} correctly, and our cc(1) treats xnet like any other library.) Reviewed by: kib Notes: svn path=/head/; revision=292723
* Move the stack protector to a new "secure" directoryPedro F. Giffuni2015-08-141-0/+1
| | | | | | | | | | | | | As part of the code refactoring to support FORTIFY_SOURCE we want a new subdirectory "secure" to keep the files related to security. Move the stack protector functions to this new directory. No functional change. Differential Review: https://reviews.freebsd.org/D3333 Notes: svn path=/head/; revision=286760
* Revert r284417 it is not necessary anymoreBaptiste Daroussin2015-06-151-1/+1
| | | | Notes: svn path=/head/; revision=284421
* Enforce overwritting SHLIBDIRBaptiste Daroussin2015-06-151-1/+1
| | | | | | | | | | | | Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere. This makes /lib being populated again. Reported by: many Notes: svn path=/head/; revision=284417
* Merge sync of headSimon J. Gerraty2015-05-271-8/+9
|\ | | | | | | Notes: svn path=/projects/bmake/; revision=283595
| * Build/install libc, librt, libthr, and msun NetBSD test suites on allEnji Cooper2015-04-271-1/+3
| | | | | | | | | | | | | | | | | | architectures MFC after: 1 week Notes: svn path=/head/; revision=282057
| * The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andKonstantin Belousov2015-04-181-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x kernels which required padding before the off_t parameter. The fcntl(2) contains compatibility code to handle kernels before the struct flock was changed during the 8.x CURRENT development. The shims were reasonable to allow easier revert to the older kernel at that time. Now, two or three major releases later, shims do not serve any purpose. Such old kernels cannot handle current libc, so revert the compatibility code. Make padded syscalls support conditional under the COMPAT6 config option. For COMPAT32, the syscalls were under COMPAT6 already. Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to (partially) disable the removed shims. Reviewed by: jhb, imp (previous versions) Discussed with: peter Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=281714
| * Add the start of libc and libstand for arm64. Not all of the machineAndrew Turner2015-04-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | dependent functions have been implemented, but this is enough for world. Differential Revision: https://reviews.freebsd.org/D2132 Reviewed by: emaste Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281197
| * Add a ${CP} alias for copying files in the build.Will Andrews2015-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users build FreeBSD as non-root in Perforce workspaces. By default, Perforce sets files read-only unless they're explicitly being edited. As a result, the -f argument must be used to cp in order to override the read-only flag when copying source files to object directories. Bare use of 'cp' should be avoided in the future. Update all current users of 'cp' in the src tree. Reviewed by: emaste MFC after: 1 week Sponsored by: Spectra Logic Notes: svn path=/head/; revision=277273
| * Fix known issues which blow up the process after dlopen("libthr.so")Konstantin Belousov2015-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or loading a dso linked to libthr.so into process which was not linked against threading library). - Remove libthr interposers of the libc functions, including __error(). Instead, functions calls are indirected through the interposing table, similar to how pthread stubs in libc are already done. Libc by default points either to syscall trampolines or to existing libc implementations. On libthr load, libthr rewrites the pointers to the cancellable implementations already in libthr. The interposition table is separate from pthreads stubs indirection table to not pull pthreads stubs into static binaries. - Postpone the malloc(3) internal mutexes initialization until libthr is loaded. This avoids recursion between calloc(3) and static pthread_mutex_t initialization. - Reinstall signal handlers with wrapper on libthr load. The _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2) when libthr is statically referenced from the main binary. In the process, fix openat(2), swapcontext(2) and setcontext(2) interposing. The libc symbols were exported at different versions than libthr interposers. Export both libc and libthr versions from libc now, with default set to the higher version from libthr. Remove unused and disconnected swapcontext(3) userspace implementation from libc/gen. No objections from: deischen Tested by: pho, antoine (exp-run) (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=276630
| * Convert libraries to use LIBADDBaptiste Daroussin2014-11-251-4/+2
| | | | | | | | | | | | | | While here reduce a bit overlinking Notes: svn path=/head/; revision=275024
* | Merge from head@274682Simon J. Gerraty2014-11-191-2/+6
|\| | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * Add reachover Makefiles for contrib/netbsd-tests/lib/libc; this adds ↵Enji Cooper2014-11-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | approximately 500 new testcases Various TODOs have been sprinkled around the Makefiles for items that even need to be ported (missing features), testcases have issues with building/linking, or issues at runtime. A variant of this code has been tested extensively on amd64 and i386 10-STABLE/11-CURRENT for several months without issue. It builds on other architectures, but the code will remain off until I have prove it works on virtual hardware or real hardware on other architectures In collaboration with: pho, Casey Peel <casey.peel@isilon.com> Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274075
| * Fix incremental builds involving non-root users with read-only source files.Will Andrews2014-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles should not assume that source files can be overwritten. This is the common case for Perforce source trees. This is a followup commit to r211243 in the same vein. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: r1036319 on 2014/01/29, r1046711 on 2014/03/06 Notes: svn path=/head/; revision=271771
| * Fix "make checkdpadd" for lib/libc when MK_SSP != noEnji Cooper2014-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Add LIBSSP_NONSHARED to bsd.libnames.mk and append LIBSSP_NONSHARED to DPADD in lib/libc when MK_SSP != no Approved by: rpaulo (mentor) MFC after: 3 days Phabric: D675 (as part of a larger diff) PR: 192728 Notes: svn path=/head/; revision=270519
| * Bring the md5 functions into libc for internal use only.Hajimu UMEMOTO2014-08-121-0/+1
| | | | | | | | | | | | | | | | It is required to support ID randomization for our stub resolver. Notes: svn path=/head/; revision=269865
* | Merge head from 7/28Simon J. Gerraty2014-08-191-1/+0
|\| | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * Remove ia64.Marcel Moolenaar2014-07-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan Notes: svn path=/head/; revision=268351