1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00
Commit Graph

31 Commits

Author SHA1 Message Date
cheloha
78887e0fb9 libc: Makefile.inc: remove "sparc" from quad support list; ok deraadt@ 2023-10-29 23:32:52 +00:00
guenther
ec0f1ad617 Add ENTRY_NB() macro for doing an ASM function entry without setting
the binding to global (NB == "no binding"), as clang 13 is now
warning about changing the binding from global to weak.

This first pass does amd64 and sparc64 and pulls DEFS.h out of the
per-arch directory to a common directory; others to follow

ok kettenis@
2022-01-01 23:47:14 +00:00
guenther
fe38b55cb0 Use a Thread Information Block in both single and multi-threaded programs.
This stores errno, the cancelation flags, and related bits for each thread
and is allocated by ld.so or libc.a.  This is an ABI break from 5.9-stable!

Make libpthread dlopen'able by moving the cancelation wrappers into libc
and doing locking and fork/errno handling via callbacks that libpthread
registers when it first initializes.  'errno' *must* be declared via
<errno.h> now!

Clean up libpthread's symbol exports like libc.

On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec.

Testing by various, particularly sthen@ and patrick@
ok kettenis@
2016-05-07 19:05:21 +00:00
deraadt
696cd27b24 We are done providing support for the vax.
lots of agreement.
2016-03-09 16:28:44 +00:00
guenther
5bda5e92ce Make using a deprecated function an error instead of just a warning
ok millert@ kettenis@
2015-11-25 05:01:44 +00:00
bluhm
a842d2067e The only thing that was translated into multiple languages in OpenBSD
are the errno messages and signal names.  Everything else is in
English.  We are not planning to translate more text.  Running a
mixed system with less than 1% of the text in native language makes
no sense.  So remove the NLS support from libc messages.  The
catopen(3) functions stay as they are.
OK stsp@ mpi@
2015-10-25 10:22:09 +00:00
guenther
e6f98e3a16 Pull in namespace.h when building all .c files using gcc's -include option,
so that we can provide asm labels for the memcpy/memset/__stack_smash_handler
calls that it generates ab initio.  Eliminate direct #includes of it.  Make
sure it's a dependency of all objects (unnecessary for asm, but close enough).

ok deraadt@
2015-09-10 18:13:46 +00:00
deraadt
a77d36b8d6 only 32-bit systems need the quad functions.
skipping a libc crank since unused in base on 64bit systems
discussed with miod, tedu; ok kettenis
2015-08-31 19:43:39 +00:00
guenther
9b9d2a55a6 Add framework for resolving (pun intended) libc namespace issues, using
wrapper .h files and asm labels to let internal calls resolve directly and
not be overridable or use the PLT.  Then, apply that framework to most of
the functions in stdio.h, string.h, err.h, and wchar.h.  Delete the
should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.

tests clean on i386, amd64, sparc64, powerpc, and mips64

naming feedback from kettenis@ and millert@
ok kettenis@
2015-08-31 02:53:56 +00:00
miod
9a210c530b Add uuid support routines to libc. From FreeBSD via NetBSD via Bitrig via
Markus Mueller.
2014-08-31 09:36:36 +00:00
tedu
25dda8feaf sprinkle in -Werror-implicit-function-declaration to disable one of the
worst C misfeatures. ok deraadt miod
2014-07-10 12:55:14 +00:00
miod
4e6fb4323c Nuke the machinery to sync libkern with libc, it's not been used in the
last 15 years and there is no point to use it in the future.

From Jean-Philippe Ouellet
2014-06-09 20:47:10 +00:00
espie
18e5a85857 ...better if I actually unplug it, Makefile doesn't do it 2014-05-12 19:25:16 +00:00
eric
8a8e895d6d switch to the new resolver implementation.
requested by many.
2013-03-28 16:43:08 +00:00
matthew
f264d37a76 Add strnlen() to libkern.
ok deraadt
2012-04-26 01:22:31 +00:00
matthew
03cd71ad9d Add timingsafe_bcmp(3) to libc, mention that it's already in the
kernel in kern(9), and remove it from OpenSSH.

ok deraadt@, djm@
2010-09-24 13:33:00 +00:00
stsp
c9b8e38857 Replace the single-byte placeholders for the multi-byte/wide-character
conversion interfaces of libc (mbrtowc(3) and friends) with new
implementations that internally call an API based on NetBSD's citrus.
This allows us to support locales with multi-byte character encodings.

Provide two implementations of the citrus-based API: one based on the old
single-byte placeholders for use with our existing single-byte character
locales (C, ISO8859-*, KOI8, CP1251, etc.), and one that provides support
for UTF-8 encoded characters (code based on FreeBSD's implementation).

Install the en_US.UTF-8 ctype locale support file, and allow the UTF-8
ctype locale to be enabled via setlocale(3) (export LC_CTYPE='en_US.UTF-8').

A lot of programs, especially from ports, will now start using UTF-8 if the
UTF-8 locale is enabled. Use at your own risk, and please report any breakage.
Note that ncurses-based programs cannot display UTF-8 right now, this is being
worked on.

To prevent install media growth, add vfprintf(3) and mbrtowc(3) to libstubs.
The mbrtowc stub was copied unchanged from its old single-byte placeholder.
vfprintf.c doesn't need to be copied, just put in .PATH (hint by fgsch@).

Testing by myself, naddy, sthen, nicm, espie, armani, Dmitrij D. Czarkoff.

ok matthieu espie millert sthen nicm deraadt
2010-07-27 16:59:03 +00:00
miod
b3ed33d2d7 Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependent
files or directories when applicable.
The inspiration and name of MACHINE_CPU come from NetBSD, although the way to
provide it to Makefiles is completely different.
ok kettenis@
2010-02-03 20:48:58 +00:00
deraadt
043fbe51c1 rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
martynas
7b36286a70 - replace dtoa w/ David's gdtoa, version 2008-03-15
- provide proper dtoa locks
- use the real strtof implementation
- add strtold, __hdtoa, __hldtoa
- add %a/%A support
- don't lose precision in printf, don't round to double anymore
- implement extended-precision versions of libc functions: fpclassify,
isnan, isinf, signbit, isnormal, isfinite, now that the ieee.h is
fixed
- separate vax versions of strtof, and __hdtoa
- add complex math support.  added functions: cacos, casin, catan,
ccos, csin, ctan, cacosh, casinh, catanh, ccosh, csinh, ctanh, cexp,
clog, cabs, cpow, csqrt, carg, cimag, conj, cproj, creal, cacosf,
casinf, catanf, ccosf, csinf, ctanf, cacoshf, casinhf, catanhf,
ccoshf, csinhf, ctanhf, cexpf, clogf, cabsf, cpowf, csqrtf, cargf,
cimagf, conjf, cprojf, crealf
- add fdim, fmax, fmin
- add log2. (adapted implementation e_log.c.  could be more acruate
& faster, but it's good enough for now)
- remove wrappers & cruft in libm, supposed to work-around mistakes
in SVID, etc.;  use ieee versions.  fixes issues in python 2.6 for
djm@
- make _digittoint static
- proper definitions for i386, and amd64 in ieee.h
- sh, powerpc don't really have extended-precision
- add missing definitions for mips64 (quad), m{6,8}k (96-bit) float.h
for LDBL_*
- merge lead to frac for m{6,8}k, for gdtoa to work properly
- add FRAC*BITS & EXT_TO_ARRAY32 definitions in ieee.h, for hdtoa&ldtoa
to use
- add EXT_IMPLICIT_NBIT definition, which indicates implicit
normalization bit
- add regression tests for libc: fpclassify and printf
- arith.h & gd_qnan.h definitions
- update ieee.h: hppa doesn't have quad-precision, hppa64 does
- add missing prototypes to gdtoaimp
- on 64-bit platforms make sure gdtoa doesn't use a long when it
really wants an int
- etc., what i may have forgotten...
- bump libm major, due to removed&changed symbols
- no libc bump, since this is riding on djm's libc major crank from
a day ago

discussed with / requested by / testing theo, sthen@, djm@, jsg@,
merdely@, jsing@, tedu@, brad@, jakemsr@, and others.
looks good to millert@
parts of the diff ok kettenis@

this commit does not include:
- man page changes
2008-09-07 20:36:06 +00:00
drahn
d752fdca1d Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless to maintain.
2005-06-17 20:35:18 +00:00
deraadt
7aaa1ce125 turn on APIWARN (prints link-time warnings for a few more functions). The
snapshots have been built with this for more than a year, but the releases
have not.  This is a fair bit more noisy in the ports tree, but it is good
advice for people about how they can improve their code.  Let us see where
the annoyance vs worthwhile balance lands
ok pvalchev
2005-03-07 02:26:41 +00:00
millert
21bdda6e53 Don't build lib/libc/md, build md[45] in lib/libc/hash instead. 2004-04-28 16:56:49 +00:00
deraadt
a177c125a8 warn about unsafe APIs at link time. Conditional on libc/Makefile defining
APIWARN; disabled by default.  In use by many developers for quite some time,
now they have a common knob to enable/disable this
2003-07-24 01:15:41 +00:00
marc
57b09d6bd3 remove libc_r mention in comment 2003-01-20 19:41:53 +00:00
drahn
dc8b416160 Extended Attribute support, from FreeBSD/TrustedBSD. ok art@ deraadt@
libc support pieces
2002-02-22 21:06:00 +00:00
pvalchev
882c9d90f2 Put dl* function definitions in libc on ELF, removing the need for libdl.
These are just stubs, the real functions are resolved by ld.so when linking
is performed.  ok art
2001-11-20 01:09:38 +00:00
espie
6a3c187b37 Add ohash_* functions to libc.
Ok'd deraadt@, millert@
2001-03-02 13:27:04 +00:00
espie
ff60459d9b Boring... Add :L modifier to all tweakable variables tests.
Closes PR 1246
2000-09-03 18:41:11 +00:00
d
14d389178a include thread/Makefile.inc 2000-01-06 08:47:07 +00:00
d
92efb73507 Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
  (more md stuff is needed for other libc/arch/*)
  (setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO
1998-11-20 11:18:22 +00:00