i386 removal, part 4/x: Remove i386 specific code from libc.
Bring in FreeBSD's msun code for our libm. Our current libm is a mix of NetBSD and FreeBSD. To ease maintainability, sync with FreeBSD as requested by John Marino. Obtained-from: FreeBSD
Libc: Remove i386 gcc hack concerning popcountsi2 Ref: 0cfd7e44b3676f6a43164acab0aaea46365b5c53 Ref: 4b548429247a10382073a0c227af306272160d8d Back in Oct 2010, a "horrible hack" was added to libc in order to fix a Firefox bug concerning a late dynamic link of a libcairo.so.2 symbol. A weak reference to popcountsi2 was added to i386 libc in order to force it to be available. Up through gcc 4.6, this hack worked because the symbol is global in the libgcc.a library, but it's a hidden symbol starting with the gcc 4.7 version of libgcc.a. This causes a build failure on bin/rmail while building world with gcc 4.7. Since Oct 2010, rtld has undergone significant changes. With the hope that the issue is obsolete, the hack is being removed. This allows gcc 4.7 to compile DragonFly world and kernel source. We'll have to track firefox manually to verify the issue the hack fixed doesn't return.
Implement getcontext(), setcontext(), makecontext(), and swapcontext(). This is a preliminary libc-only implementation. sigprocmask() is used to mask signals during the context switch and to save and restore signals. FP registers are not currently saved or restored - that is, synchronous use is intended. Submitted-by: "Matt Emmerton" <matt@gsicomp.on.ca> Finished-up-by: "Matthew Dillon" <dillon@backplane.com>
FreeBSD and NetBSD both use derivates of Sun's math library. On FreeBSD, it's been put into lib/msun, on NetBSD it is under lib/libm. Since DragonFly misses a lot of the changes which went into both and I consider the NetBSD version cleaner, switch to that. Biggest difference to NetBSD is the omission of wrappers for non-IEEE757 floating point support. There's no point in supporting anything but IEEE 757 and that saves at least a function call per math entry point. Addtionally, important the fpclassify, isinf, isnan and signbit functions into libc as required for C99. Remove the support for non-POSIX operation. matherr is pointless and wasn't really supported anyway.
Cleanup the TLS implementation: - Define the TCB layout in machine/tls.h, define wether tcb_self exists or not. - Define the layout of the DTV, not used yet. - Define the TLS variant - Define common access functions (tls_get_tcb, tls_get_curthread, tls_set_tcb) and the RTLD functions.
Remove _THREAD_SAFE depenendancies. Create weakly associated stubs for posix threading calls used by libc and weak associations for procedures that a threading library would otherwise have to override. This allows a program to be linked with libc, or linked with libc + a threading library. libc_r will be deprecated over time. Traditionally libc_r had to be linked against a threading library rather then libc. Linux, FreeBSD, and other UNIXes have moved either t oa thread-safe libc or a thread-capable libc. The threading capability is accomplished by making the appropriate thread locking calls and providing weakly referenced dummy stub functions for the case where a threading library is not linked in. Certain third party software, namely XFree/XOrg, also assume threading stubs in libc. This is precursor work to a port of David Xu's 1:1 threading library and is also intended as a basis to allow DragonFly to support multiple threading libraries. Ported-by: David Rhodus <sdrhodus@gmail.com> Primarily-ported-from: FreeBSD Testing and bug fixes by David Xu and Matt Dillon
Remove register keyword usage. Add missing $DragonFly$ keyword to the following files: src/lib/libc/db/btree/bt_utils.c src/lib/libc/db/hash/hash_log2.c src/lib/libc/net/getproto.c src/lib/libc/net/getprotoent.c src/lib/libc/net/getprotoname.c src/lib/libc/net/getservbyname.c src/lib/libc/net/getservbyport.c src/lib/libc/net/iso_addr.c src/lib/libc/net/linkaddr.c src/lib/libc/net/ns_ntoa.c src/lib/libc/quad/muldi3.c src/lib/libc/quad/qdivrem.c src/lib/libc/rpc/authdes_prot.c src/lib/libc/rpc/key_prot_xdr.c src/lib/libcompat/4.3/insque.c src/lib/libcompat/4.3/lsearch.c src/lib/libcompat/4.3/remque.c src/lib/libcompat/4.4/cuserid.c src/lib/libcompat/regexp/regexp.c src/lib/libcompat/regexp/regsub.c src/lib/libcr/db/btree/bt_utils.c src/lib/libcr/db/hash/hash_log2.c src/lib/libcr/net/getproto.c src/lib/libcr/net/getprotoent.c src/lib/libcr/net/getprotoname.c src/lib/libcr/net/getservbyname.c src/lib/libcr/net/getservbyport.c src/lib/libcr/net/iso_addr.c src/lib/libcr/net/linkaddr.c src/lib/libcr/net/ns_ntoa.c src/lib/libcr/quad/muldi3.c src/lib/libcr/quad/qdivrem.c src/lib/libcr/rpc/authdes_prot.c src/lib/libcr/rpc/key_prot_xdr.c src/lib/libedit/common.c src/lib/libedit/emacs.c src/lib/libipx/ipx_ntoa.c src/lib/libm/common_source/fmod.c src/lib/libstand/ether.c src/lib/libstand/fstat.c src/lib/libstand/gets.c src/lib/libstand/ioctl.c src/lib/libstand/netif.c src/lib/libstand/rarp.c src/lib/libstand/rpc.c src/lib/libstand/strcasecmp.c src/lib/libstand/strtol.c src/lib/libstand/write.c
* Remove a few extra $FreeBSD$ tags * Fix a few mis-spellings