Commit Graph

169 Commits

Author SHA1 Message Date
christos 670c784563 Only create and install the tags file for the normal libc (not any of the
compat copies), because we don't want it to be overwritten by the compat
copies. This was detected by the evbarm mkimage complaining.
2015-06-15 14:24:01 +00:00
pooka 7578f98047 Include compat in rumprun libc
Not including non-renamed symbols in libc caused all kinds of configure
scripts to do the wrong thing when they just tested linkage without
including headers.  So, go for the "least moving parts" bandaid for now.
2015-02-09 22:44:34 +00:00
pooka a17684a24c Add hooks for RUMPRUN build of libc
If "yes", does the following (default "no"):
  * prevents ASM syscalls from being built (librump provides syscalls)
  * does not include compat (useless when application is linked with libc)
  * does not build tags (no /var/db to install them to)
  * does not include tls

==> libc for rumprun can now be built against unmodified NetBSD sources
2014-12-10 00:37:30 +00:00
matt 810b61bb1a MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU 2014-08-10 23:39:08 +00:00
joerg 9c3fd52490 Introduce GENASSYM_CPPFLAGS for options during genassym processing.
Consistently drop assembler flags.
2014-03-04 14:58:14 +00:00
joerg 720b2586bd Include compiler-rt in libc, libm and libkern. 2014-01-29 23:37:18 +00:00
apb f500068b4e If MKREPRO=yes, make the tags file refer to /usr/src
instead of referring to the actual source directory ${NETBSDSRC}.
2014-01-19 11:36:45 +00:00
joerg 527d1fa144 Use a separate variable for the use of GCC's unwind code. 2014-01-18 01:08:56 +00:00
joerg 2356df897c Use the quad support from compiler-rt for MKLIBGCC=no. 2014-01-15 20:58:09 +00:00
joerg aa6e9499ca Rename USE_LIBGCC to HAVE_LIBGCC and retry using it as flag on unwind.h. 2013-10-14 16:00:16 +00:00
joerg d06922ddf4 Include compiler-rt and libunwind in libc for Clang/x86 builds. 2013-10-14 01:30:21 +00:00
joerg 02bc918a66 Don't pass assembler flags to cpp for genassym. 2013-07-30 15:28:47 +00:00
matt 7d2c6b2414 Match against LIBC_MACHINE_ARCH for MKCOMPAT 2013-04-30 01:42:03 +00:00
matt 343c2f33c0 Just build the legacy stuff for earm (for now). 2013-04-27 08:00:40 +00:00
matt 7b96d46463 for earm, make sure to build getdirentries man page 2013-04-25 15:39:26 +00:00
matt 79367e053c Add CPPFLAGS+= -I${NETBSDSRCDIR}/sys for earm compat 2013-04-25 06:36:49 +00:00
matt b0c992be1b for EARM, just build __lwp_park50 compat for libpthread until the situation
is involved.
2013-04-19 22:24:10 +00:00
matt 4b9c2e46bb Fix inverted test. 2013-04-19 21:02:43 +00:00
matt 7d19b890df Since earm is new, don't bother building the compat libc code since there
is nothing that can use it.
2013-04-19 16:53:18 +00:00
joerg 575a4660cc Rename BUILDCOLD to BUILD_LEGACY and provide a preprocessor macro that
can be used in code files that aren't easy to split up. Add the removal
to the major bump todo list.
2013-04-12 19:58:45 +00:00
joerg 0f5f511fae Remove code for CITRUS!=yes. 2012-01-20 16:31:29 +00:00
christos 01fb81a616 fix the rest of libc mi gcc-4.5 hacks. portmasters should fix the md ones. 2011-08-17 09:53:53 +00:00
mrg 0a0dd75b65 add some XXX'd -Wno-foo if HAVE_GCC >= 45.
XXX: someone should look at these.
2011-06-21 02:32:55 +00:00
nakayama a2925d9cef __udivdi3 isn't included in sparc compat libc on sparc64, so use
ARCHSUBDIR instead of MACHINE_ARCH for checking whether to include
quad/Makefile.inc.

This fixes undefined symbol __udivdi3 in /libexec/ld.elf_so-sparc
on sparc64 which is the cause of failure of hello32 test in
toolchain/cc/t_hello.
2011-06-19 11:31:55 +00:00
drochner 53cdf0b54e make the "tags" target non-.PHONY because it reflects a real file,
and remove some nonsense in libc Makefile which caused that
a "tags" file was written in my source tree
2011-05-27 17:06:54 +00:00
joerg aad599979d Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.
2011-03-09 23:10:05 +00:00
ahoka 82e82fca50 Add libc glue for libtre.
tre will be compiled without approx and wchar/mulibyte support to
only match the minimum requirement to replace our spencer regex.

This needs a lot of testing.

Only enabled when USE_LIBTRE is set to `yes'.
2010-09-04 12:17:58 +00:00
tnozaki cd71bcf609 1. fix build problem CITRUS=no
2. make CITRUS={yes,no} knob friendly with libc/compat.
2010-05-30 08:28:53 +00:00
joerg b9cf7d31ab Add the constant database reader (cdbr(3)) and writer ((cdbw(3)).
They implement a space efficent write-once database with fast access
path. Switch the services(5) database to use cdb. The size of the
database file decreases from 2.1MB disk space to 307KB. Access
performance is about the same if setservent(0) is used and about an
order of magnitude faster otherwise. services_mkdb defaults to the new
format, but can optionally create the old db(3) format as well for
statically linked legacy applications.
2010-04-25 00:54:44 +00:00
uebayasi 37469dacdd Provide the phony "tags" target as previous. Make it depend on the real
target.  In case someone assumes the target as an interface.
2009-12-06 12:56:59 +00:00
uebayasi c1fa6bf05b Make the local "tags" target an absolute path, ${.OBJDIR}/tags, otherwise
it conflicts with the "tags" target defined in bsd.own.mk, which is .PHONY,
which causes you to re-build "tags" everytime you re-run make.
2009-12-06 06:30:52 +00:00
dsl 05e1772663 Change (slightly) the way NO_SRCS is processed, update big comment!
Now the .c file is removed from SRCS for both .S and .c in NO_SRSC.
The .c file is added to LSRCS for .S files in NO_SRCS.
(.S files in SRCS have the same treatment - but also get compiled.)
Allows vax build to be fixed.
Also the previous version failed to add to LSRCS correctly.
2009-08-11 17:29:04 +00:00
dsl 0d34d14bb9 If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
2009-07-30 20:57:15 +00:00
mrg 2f0d0e12bf define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build. 2008-10-26 07:43:07 +00:00
ad 7a21650601 Install manual pages for the atomic ops. 2008-06-23 10:22:40 +00:00
he c26a54ba24 Ensure that we pass -z initfirst to the linker. The mips gcc
was unhappy about the missing -Wl specification.
2007-12-08 18:34:51 +00:00
ad 558a5ffd0f rtld changes for PR bin/37347:
- Apply patch from J.T. Conklin to execute .init/.fini functions in order.
- Support DF_1_INITFIRST and mark libc with DF_1_INITFIRST. Shared libs
  should be recording a dependency on libc, but it's too late to do that.

Ok christos@.
2007-12-07 20:34:04 +00:00
ad ec4d182d4a - stack_protector.c doesn't really belong under sys/. Add a new directory
for misc support routines and put it there.
- Add a libc constructor. Use this to initialize threading and the
  stack protector stuff. libpthread cannot be initialized safely using
  its own constructor because libc and libpthread are deeply intertwined.
  PR bin/37347
2007-11-13 15:21:19 +00:00
tls 2368dc663d Move FORTIFY_SOURCE implementation from the somewhat ill-named "libssp"
(what other systems keep in libssp, we already have in libc) into libc
to match what other systems with FORTIFY_SOURCE do.  Goodbye, libssp
dependency in libraries and executables.  Discussed with christos and
mrg; Christos will merge the headers to get us the rest of the way to a
FORTIFY_SOURCE implementation that works as others' code expects.
2007-05-30 01:13:14 +00:00
tnozaki 037cfac899 revert to rev1.127 for iconv(3). 2007-03-19 12:27:22 +00:00
tnozaki 7ed1567506 don't use CPPPICFLAGS but CPICFLAGS.
CPPPICFLAGS obly affect *.s sources only,
but we want -D_I18N_DYNAMIC flag for *.c source
(src/lib/libc/citrus_module.c and so on).
use CPICFLAGS instead.

this fix suggested by tsutsui-san in current-users@, thanks.
2007-03-18 08:52:48 +00:00
matt e92466d560 Don't modify CSHPICFLAGS. (this causes .so file to be made when they shouldn't)
if MKPICLIB is "no", change CPPPICFLAGS otherwise add change CPPFLAGS
2007-03-15 00:59:32 +00:00
christos eb961d0e02 Add glue to build the compat library as a separate "libcold" turned off by
default. Clean up the libc Makefile and remove obsolete stuff such as copy
to libkern.
2006-03-11 21:07:18 +00:00
kleink 3cd8501c1e Drop in gdtoa as a replacement for dtoa, strtod() from stdlib/strtod.c. 2006-01-25 15:43:01 +00:00
christos e5548b402a Use reach-over sources from common/lib/libc 2005-12-20 19:31:47 +00:00
christos 03256c6e55 WARNS=4 2005-11-29 03:11:58 +00:00
christos 5b84b3983f compat core reorg. 2005-09-13 01:44:08 +00:00
thorpej d93ab54e03 Use TOOL_GENASSYM. Part of PR toolchain/30350 2005-05-30 16:02:56 +00:00
matt 57947b7b48 Make longjmp on vax not use sigreturn. Instead it rewrites the
jmp_buf into one compatible with __longjmp14 and relies on that
to change that into a ucontext_t suitable for setcontext(2).
2005-05-03 04:37:33 +00:00
lukem 9505ced464 minor whitespace consistency 2005-01-10 02:32:46 +00:00