Commit Graph

148 Commits

Author SHA1 Message Date
christos
fda5f877e5 prefix compat with __ in case __dso_hidden is not available 2013-10-04 21:07:37 +00:00
christos
ca2d95d15f avoid linker warning for compat symbols that are used internally in libc,
by introducing a hidden compat_foo() function, using that internally in
libc, and exposing foo as a strong alias to compat_foo(). I am open for
better ideas.
2013-10-04 20:49:16 +00:00
joerg
bdfde3da9a Redo the locale cache to be constant. It now contains the localeconv()
data and which LC_MONETARY and LC_NUMERIC values it is derived from.
In newlocale(3) and setlocale(3), check for the existing entries and on
miss, create a new entry. This is currently not using a lock for the
list as the worst case is a small memory leak.
2013-09-13 13:13:32 +00:00
joerg
4d12bfcd15 Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
2013-09-12 15:36:14 +00:00
matt
2cf5e9962b Use _INVOKE_CERROR() and movs 2013-08-19 22:11:50 +00:00
matt
3eafa9878b CERROR is now hidden so no need to call it via the PLT 2013-08-01 05:54:24 +00:00
matt
7c78a65eeb Fix some more CERROR inversions 2013-07-25 22:08:15 +00:00
matt
88723221e0 Missed these. Convert to motorola format. 2013-07-17 21:29:01 +00:00
matt
a4ef47e089 Use a more compact instruction sequence that also works on coldfire 2013-07-17 04:56:14 +00:00
matt
2d913a7c7d Use SYSTRAP.
Don't use the PLT to call CERROR
Use LEA_LCL / GOT_SETUP
Remove non-__ELF__ code.
Make __minbrk and __curbrk hidden and avoid using the GOT for them.
Convert to motorola syntax.
2013-07-16 23:00:15 +00:00
christos
dabcbd76a6 Compat glue for lwp park, but does not use the new syscall yet. 2013-03-29 02:09:58 +00:00
yamt
2c9fdc9222 comment and assertion 2013-03-06 11:29:01 +00:00
matt
60e851836f Remove all FPA code.
Support VFP for hard float
Allow MKSOFTFLOAT=no
2013-01-11 13:55:25 +00:00
christos
97d3085eb3 Add a warning when we are using the libc version of alloca(3). 2012-10-24 22:10:52 +00:00
drochner
e61202360d fix trivial typo in warning msg 2012-10-17 16:09:03 +00:00
msaitoh
2d0deef114 -Wstrict-overflow 2012-10-15 22:22:01 +00:00
christos
a9bb3b0c76 take care of the signal safe syslog calls which are not exposed. 2012-10-11 17:09:55 +00:00
christos
fea19ff7ed Add compat functions for syslog. 2012-10-10 22:52:26 +00:00
christos
37a2b6f0c2 use setenv so that we don't leak memory. 2012-04-22 15:55:41 +00:00
christos
0bcf0d6f44 PR/46360: YAMAMOTO Takashi: Restore NetBSD-5 compatibility with putenv()
copying the passed string (which is not ToG compliant), instead of using
it directly in the environment arrat as it should. Needs to be pulled up
to NetBSd-6.
2012-04-20 17:31:29 +00:00
matt
5688dfcf9c Switch to C89 definitions.
Remove use of __P
2012-03-20 17:05:59 +00:00
christos
815317212f missed one (thanks joerg) 2012-03-15 16:47:38 +00:00
christos
98c744016d rename the macros ftsent_ since they apply to the ftsent struct not the
fts one.
2012-03-14 00:25:19 +00:00
joerg
9cc96dd169 Fix all the issues lint is too dumb to warn about and re-enable
-Wconstant-conversion.
2012-03-13 22:37:51 +00:00
joerg
3e39914d72 Add missing includes. 2012-03-13 22:24:48 +00:00
christos
c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +00:00
mbalmer
577cb3569f Add missing cast, fixes i386 build. releng ok. 2012-02-08 12:10:17 +00:00
christos
4b63973d52 Restore binary compatibility with netbsd-1.x for readdir(3). Tested with
a shark tcsh dynamic binary:

    tcsh: ELF 32-bit LSB executable, ARM, version 1, dynamically linked \
	(uses shared libs), for NetBSD, not stripped
    -rwxr-xr-x  1 root  wheel  994170 Jun 24  2004 /bin/tcsh

This would infinite loop on ls-F /dev
2012-02-08 03:24:30 +00:00
christos
1897181a72 From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@
2012-01-22 18:36:14 +00:00
joerg
e8bec33be1 Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
2012-01-20 14:08:04 +00:00
joerg
0b50389a15 Add __returns_twice for the attribute of the same name. This makes the
attribute explicit based on the functions GCC gives it too.
2011-11-05 09:27:06 +00:00
mrg
f31d8e575a rename sparc64 BLOCK_SIZE and BLOCK_ALIGN to have SPARC64_ prefixes.
for the assembler files, define the old names to the new names
since using the new names cause ugliness due to longer identifer
names, and reduces churn.

fixes build issues in dtv and vaguely makes <machine/psl.h> slightly
less name-space invasive.
2011-07-12 07:51:33 +00:00
joerg
c617617e5d Fix memcpy usage. 2011-07-01 01:08:59 +00:00
mrg
493d341048 various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.
2011-06-20 09:11:16 +00:00
christos
2d8f83e77b Fix various vis/unvis issues:
- no need for all the weak symbols
- define a new _VIS_END flag for UNVIS_END so that there are no collisions
  between and vis and unvis flags.
- add bound versions of the vis and unvis functions that take the length of
  the destination buffer. Unlike the OpenBSD ones they return -1 or NULL if
  the buffer is not large enough, instead of silently truncating.
2011-03-12 19:52:45 +00:00
bouyer
063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
christos
10e6f9749d remove duplicate weak aliases 2011-02-21 22:07:44 +00:00
christos
bcb5ce2065 Fix emulation issue of SETVAL, and make the code look the same between the
two different versions.
2011-01-31 22:51:39 +00:00
matt
0536d96d78 Fix type sigtramp_t -> sigtramp_2 2011-01-29 22:58:47 +00:00
matt
787e823fd1 Move IDs into .ident
Use END(x)
Remove a.out support
Make CERROR hidden
2011-01-25 02:38:15 +00:00
matt
36cd488617 align comments 2011-01-16 02:45:48 +00:00
matt
cf88c3890b Use END(foo) everywhere.
Make __cerror hidden.
Use non-PLT calls to __cerror.
Use assym.h when appropriate.
Use addi to adjust stack instead of loading it.
Add __RCSIDs
Force -D_NOREGNAMES for all .S files.
[this is all in preperation for secure plt support]
2011-01-15 07:31:11 +00:00
joerg
d3a052c472 Allow use of traditional CPP to be set on a per platform base in sys.mk.
Honour this for dependency processing in bsd.dep.mk.  Switch i386 and
amd64 assembly to use ISO C90 preprocessor concat and drop the
-traditional-cpp on this platform.
2011-01-12 23:12:10 +00:00
christos
5a87b22ec6 Provide a re-entrant and thread-safe set of timezone API's that
don't require locking and can operate on user-specified timezones
as opposed to having to alter the environment to change a timezone.
This work was presented to the tzcode folks and it was generally
accepted, but there seems to be a lot of inertia.
2010-12-16 18:36:47 +00:00
tron
fbf4aa1699 Improve and simplify implementation of *env(3) functions:
- Use RB tree to keep track of memory allocated via setenv(3) as
  suggested by Enami Tsugutomo in private e-mail.
  This simplifies the code a lot as we no longer need to keep the size
  of "environ" in sync with an array of allocated environment variables.
  It also makes it possible to free environment variables in unsetenv(3)
  if something has changed the order of the "environ" array.
- Fix a bug in getenv(3) and getenv_r(3) which would return bogus
  results e.g. for " getenv("A=B") " if an environment variable "A"
  with value "B=C" exists.
- Clean up the internal functions:
  - Don't expose the read/write lock for the environment to other parts
    of "libc". Provide locking functions instead.
  - Use "bool" to report success or failure.
  - Use "ssize_t" or "size_t" instead of "int" for indexes.
  - Provide internal functions with simpler interfaces e.g. don't
    combine return values and reference arguments.
  - Don't copy "environ" into an allocated block unless we really need
    to grow it.

Code reviewed by Joerg Sonnenberger and Christos Zoulas, tested by
Joerg Sonnenberger and me. These changes also fix problems in
zsh 4.3.* and pam_ssh according to Joerg.
2010-11-14 18:11:42 +00:00
christos
7db74b9a82 Use a bit array to keep track of malloced environment entries so we can
free them.
2010-09-23 17:30:49 +00:00
mrg
0b9686b0cc these were only relevant for a.out builds; time to sleep forever... 2010-07-06 06:04:58 +00:00
mrg
4c92852a80 remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format.  ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k.  this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
  down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
2010-07-06 05:59:50 +00:00
tnozaki
9efec5bce3 1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
   so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
   prepareing for next libc major crunk.
4. bump libc minor version.
2010-06-07 13:52:28 +00:00
drochner
87941501db use the local versions of ldexp/frexp/modf again rather than pulling
in libm source code. The libm functions depend on other libm functions,
this requires symbol renaming, and with the reachover method this
is going to be a mess. Also, bundling the dependencies into one .o
file has the potential to cause symbol conflicts on static linking.
2010-04-23 19:04:54 +00:00