Commit Graph

311 Commits

Author SHA1 Message Date
joerg 5c52343643 Allow HOSTLIB to use C++ by not specifying -nostdinc++. 2011-02-06 00:52:49 +00:00
joerg d9da1368fc Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly. 2010-12-08 01:57:22 +00:00
lukem 44f36b23ab Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.
2010-11-08 06:54:52 +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
lukem 0aad54fe04 Support MKDEBUG for shared libraries. 2010-04-27 14:32:14 +00:00
lukem 781e18114c fix comment (so bracket matching works as intended) 2010-04-26 03:46:00 +00:00
darran 61fb3737eb DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.
2010-03-02 20:49:18 +00:00
njoly e9915f3b1e Change shared object file extension from .so to .pico, to avoid
conflicts with shared libaries names libXX.so; as recently seen with
MKUPDATE=yes builds for libelf and libnvpair.

All now stalled regular .so files need to be manually removed from
object directories.
2010-02-22 12:33:22 +00:00
christos 8dd41afecc PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.
2010-01-25 00:43:00 +00:00
abs fb1a714458 Add brief line on SHLIB_MAJOR, SHLIB_MINOR and SHLIB_TEENY in comments
section - addresses PR bin/39693
2009-12-30 12:34:13 +00:00
mrg a6052e3b04 replace /usr/lib with ${_GCC_CRTDIR} or ${SHLIBDIR} as appropriate. 2009-12-12 21:33:50 +00:00
uebayasi cf4c152485 When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

	${LDADD.${PROG}}
	${LDFLAGS.${PROG}}
	${LDSTATIC.${PROG}}
	${LDADD.${LIB}}
	${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)
2009-12-08 15:18:42 +00:00
tsutsui b00cd20126 If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.
2009-11-27 11:44:36 +00:00
apb 91fe922f05 Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links.  They have no effect except when using a
metalog, in which case the information is added to the metalog.  In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg.  This should fix PR 24457 and PR 41155.
2009-04-10 16:16:12 +00:00
perry 6b7db9a3b4 Add a _ARRANFL for the flags for invoking ar as ranlib.
Will be used only for Makefile.rump for now.
2009-04-01 17:47:39 +00:00
perry 1fd3f53afd Add a MKARZERO flag, which invokes ar(1) with the new D flag when it
is set to "yes" -- defaults to "no" except for build.sh builds. This
results in a deterministic .a file rather than one that reflects
timestamps and permissions on the source files.

Also, clean up the ar flags we're using, and remove a redundant use of
ranlib that on a modern POSIX ar can be done with the "s" flag.

Discussed on tech-toolchain
2009-03-13 16:23:31 +00:00
he a5ec128bee If we have a SHLIB_VERSION_FILE, add is as a dependency for the
library.  This is mostly a convenience, so that you can trigger
a shared library rebuild by touching the shlib_version file, it
should not otherwise impact the build one way or the other.
2009-01-17 12:09:58 +00:00
he 79663d7eed Move _LIBLDOPTS and LDFLAGS to a spot behind LDADD when making a
shared library.  This is done so that -L options pointing into
DESTDIR will come after -L options pointing into our object tree
for shared libraries this shared library depends on.

This makes a difference when shared library major numbers are bumped
(as was recently done in our tree), and you build into an already-
populated DESTDIR, because otherwise the old major version shared
libraries will be picked up, because the new ones have not yet been
installed at this stage. This will in all probability lead to
conflicts later on when linking programs, where one would try to
mix new and old major versions for the same shared library.

I *hope* this will not have any negatively impact by moving other
order-dependent options around; local tests with rebuilds did not
uncover any problems I could see.

OK'ed by lukem@
2009-01-17 12:07:59 +00:00
pooka 53313f280c Add comment requesting modifications to __archivebuild be reflected
in the rump build.
2009-01-08 20:03:59 +00:00
pooka b14e457e9c Don't use -isystem in rump builds. This ensures that only headers
in the kernel tree are used.
2008-12-08 13:10:21 +00:00
mrg bcb1925cba add LIBISCXX. if it is != "no", use ${CXX} instead of ${CC} to link
shared libraries.  use it for the one c++ library we have.

fixes PR#39936.
2008-12-06 19:32:05 +00:00
cube b25860850d Allow the use of NOSTATICLIB along with LIBISPRIVATE to build private libs
that are suitable to be linked into a shared lib.
2008-11-24 02:01:46 +00:00
apb 96230fab84 Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
2008-10-19 22:05:19 +00:00
christos 81dd08df0d handle assembly files for MKPIE 2008-10-19 15:22:50 +00:00
christos 66d46cebd1 make .a archives PIC for MKPIE 2008-10-17 17:29:39 +00:00
joerg 5af38558ac Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.
2008-09-09 11:54:19 +00:00
christos 4b67625a5e fix debugging library build. 2008-08-13 16:36:15 +00:00
lukem 01ca4a276a Fix installed symlinks for LIBISMODULE=yes.
Further fixes to support for SHLIB_MAJOR set without SHLIB_MINOR.
2008-08-10 11:06:43 +00:00
lukem e24bdb26eb When building a .so, don't require the library to have a minor version.
Prevents a "stat: Too many levels of symlinks" build error.
2008-08-10 10:42:01 +00:00
lukem b88ccbbf16 Implement LIBISMODULE:
If not "no", install as ${LIB}.so (without the "lib" prefix),
	and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no
	MKPROFILE=no MKSTATICLIB=no".
	Default: no
2008-08-10 09:25:04 +00:00
lukem 66176dfdff Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
2008-05-03 14:48:30 +00:00
lukem b552ef70c2 Provide a "lint" target that will lint all the sources, even if MKLINT=no.
(MKLINT=no still prevents installation of the lint libraries).
Explictly disable some library variations if MKPRIVATELIB=yes.
2008-05-03 14:36:06 +00:00
lukem d77bf7654f Explicitly set MKLINT=no if MKLINKLIB==no, rather than just acting that way. 2008-05-02 11:45:19 +00:00
simonb 71a4269193 Use -nodefaultlibs instead of -nostdlib when linking libc and libgcc*
so that we still link in the crt* start/end files.
Explicitly link libc against gcc_pic, since -nodefaultlibs undoes this.

Fixes problems where shared libraries don't get init/fini sections,
most easily noticable with pthreads programs not working.

Approved by: skrll
Thanks: bjs, mrg, icb peanut gallery.
2008-04-29 07:48:31 +00:00
christos a9587bb896 now that gcc adds -lc, reverse the logic and explain. 2008-04-27 23:48:10 +00:00
christos f369b6c6cb Exempt gcc libraries from linking against libc. 2008-04-26 22:28:13 +00:00
christos fe6aa33a8e deal with modules that don't define lib. 2008-04-26 21:26:03 +00:00
christos 9d8a22cf84 make all shared libraries depend on libc. 2008-04-26 20:03:44 +00:00
simonb d8de5b102b Remove support for NetBSD/pc532. 2008-01-09 11:25:58 +00:00
christos 9ba5d03c10 Enable text relocation warnings. 2007-09-15 14:36:14 +00:00
tsutsui ca549fcb8e CPPICFLAGS -> CPPPICFLAGS (in comments) 2007-03-18 09:08:45 +00:00
martin 6a3c1d7aeb When checking wether we are debugging, look for -g in ${CFLAGS} instead
of ${COPTS}. The latter explicitly includes the former and ${DBG}, where
the -g most likely is hidden.
2006-11-23 12:05:26 +00:00
dbj 758985809b pay attention to MKUPDATE instead of UPDATE when installing libs 2006-09-18 05:15:35 +00:00
lukem 8b3ce8625c Rename MKDEBUG to MKDEBUGLIB. 2006-07-22 05:29:03 +00:00
mrg 1ed40e7c8b add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>. 2006-05-11 23:47:34 +00:00
christos 1c364e3284 Add MKDEBUG and the ability to build debugging versions of the libraries. 2006-04-09 01:52:06 +00:00
christos 45cfed2d83 make symlink types consistent. 2006-03-30 19:49:02 +00:00
jwise 8bc0f5da0f Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).
2006-03-16 18:43:34 +00:00
dsl 286b8b3f54 Use ${OBJCOPY} -[xX] ${.TARGET} instead of getting the file written to
${.TARGET}.tmp and running ${LD} -[xX] ...
I don't believe there are any architectures where objcopy can't delete local
symbols.
2006-01-28 11:10:18 +00:00
christos 7f5f767e82 Compile all profiling sources with -DPROF -DGPROF, not just assembly sources. 2006-01-08 01:23:51 +00:00