Commit Graph

159 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
10717e2e95 Add SHLIB as a shortcut for shared-only libraries.
Not objected to by: bde, ru
2004-05-07 09:58:36 +00:00
Tom Rhodes
7b1ac86dc1 Remove whitespace at EOL. 2004-03-15 17:01:31 +00:00
Tom Rhodes
5a19f6d9d4 Fix some style bugs in previous commit.
Fix 'broken' ifdefs.
icc does not support profiling yet so remove unfinished code which was
supposed to help.

Submitted by:	netchild (original version)
Reviewed by:	ru
2004-03-14 01:29:05 +00:00
Tom Rhodes
06d6e4fcfe This are the build infrastructure changes to allow to use the
Intel C/C++ compiler (lang/icc) to build the kernel.

The icc CPUTYPE CFLAGS use icc v7 syntax, icc v8 moans about them, but
doesn't abort. They also produce CPU specific code (new instructions
of the CPU, not only CPU specific scheduling), so if you get coredumps
with signal 4 (SIGILL, illegal instruction) you've used the wrong
CPUTYPE.

Incarnations of this patch survive gcc compiles and my make universe.
I use it on my desktop.

To use it update share/mk, add
	/usr/local/intel/compiler70/ia32/bin	(icc v7, works)
or
	/usr/local/intel_cc_80/bin		(icc v8, doesn't work)
to your PATH, make sure you have a new kernel compile directory
(e.g. MYKERNEL_icc) and run
	CFLAGS="-O2 -ip" CC=icc make depend
	CFLAGS="-O2 -ip" CC=icc make
in it.

Don't compile with -ipo, the build infrastructure uses ld directly to
link the kernel and the modules, but -ipo needs the link step to be
performed with Intel's linker.

Problems with icc v8:
 - panic: npx0 cannot be emulated on an SMP system
 - UP: first start of /bin/sh results in a FP exception

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by:	silence on -arch
Submitted by:	netchild
2004-03-12 21:36:12 +00:00
Ruslan Ermilov
65d2bdc62c Fixed bogus ${FOO:Mbar} tests where the actual intent is to check
if the result set is empty.  While here, replaced non-bogus empty
string comparisons with equivalent empty() checks.
2004-01-27 23:22:15 +00:00
Ruslan Ermilov
6b14fdfa52 Guess better the source for object files in case .depend file is
missing and there are multiple choices using multiple inference
(suffix transformation) rules.

This is known to fix compilation of s_log1p.o in lib/msun on i386,
as otherwise it attempted to use s_log1p.S as the source (which is
marked broken) instead of legal s_log1p.c which is in CFLAGS.  The
normal case where .depend file exists is not affected.

Reviewed by:	bde
2004-01-17 18:51:55 +00:00
Ruslan Ermilov
be01c2220b - No need to create libfoo.so -> libfoo.so.X symlinks in /lib,
as it was decided that our toolchain will revert to looking
  for libraries in /usr/lib only.

- Make /usr/lib/libfoo.so -> /lib/libfoo.so.X symlinks absolute
  so that they still work if /usr is symlinked.

- Remove stale /usr/lib/libfoo.so.X libraries during install.

Discussed with:	gordon, obrien, peter
2003-09-07 14:15:40 +00:00
Peter Wemm
eb7f25e17e Emergency backout of rev 1.152. This is a 100% guaranteed way to totally
hose your system.  You end up with just about everything statically linked
(except for libpam.so), which then causes all the pam users to fail.
eg: login, sshd, su etc all stop working because dlopen no longer works
because there is no libc.so in memory anymore.

gcc passes -L/usr/lib to ld.  The /usr/lib/libxxx.so symlink is *not* a
compatability link.  It is actually the primary link.  There should be no
symlinks in /lib at all.  Only /lib/libXX.so.Y.

peter@daintree[9:27pm]/usr/bin-104> file yppasswd
yppasswd: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.1.1, dynamically linked (uses shared libs), stripped
peter@daintree[9:27pm]/usr/bin-105> ldd yppasswd
yppasswd:
        libpam.so.2 => /usr/lib/libpam.so.2 (0x280d1000)
peter@daintree[9:28pm]/usr/bin-106>

Note no libc.so.5.  Hence libpam.so.2 has unresolved dependencies.

I believe this is also the cause of the recent buildworld failures when
pam_krb5.so references -lcrypto stuff etc and when librpcsvc.so references
des_setparity() etc.

This change could not possibly have worked, unless there are other missing
changes to the gcc configuration.  It won't work with ports versions of
gcc either.
2003-09-04 04:29:11 +00:00
Ruslan Ermilov
1c0b8fcbfe As ld(1) was taught to look into /lib, there's no longer a reason
for having compatibility .so symlinks.

Submitted by:	obrien
Reviewed by:	gordon
2003-09-03 06:31:50 +00:00
Ruslan Ermilov
41f8931571 Whitespace diff reduction between bsd.prog.mk and bsd.lib.mk outputs. 2003-08-31 15:20:17 +00:00
Gordon Tetlow
b20654d416 When creating .so symlinks, use SHLIBDIR instead of LIBDIR so symlinks
are created in the correct location. Always make them. For libraries
that live in /lib, this causes a /lib/libfoo.so and a compatibility
/usr/lib/libfoo.so to be created. We may want to drop the
/usr/lib/libfoo.so symlink at some future point.
2003-08-17 23:56:29 +00:00
Gordon Tetlow
3d7f3b48c8 Handle the case where SHLIBDIR != LIBDIR. When creating links, we
need relative pathing to work correctly. This is s necessary step
for putting libraries in /lib while the .so symlinks still live
in /usr/lib.

This should be a big NOOP in the case where SHLIBDIR == LIBDIR.
2003-08-17 07:42:50 +00:00
Ruslan Ermilov
d58e932f04 Don't trust sys.mk,v 1.61 commit log, and make .asm alias for .S. 2003-07-02 17:03:28 +00:00
Ruslan Ermilov
f79d11b7ba Revert to using as(1) to compile plain assembler source files.
All .s files that need cpp(1) processing (see gcc(1) manpage's
DESCRIPTION section) have been repo-copied to .S files.  This
is mostly to bring bsd.lib.mk in agreement with sys.mk.

Desired by:	obrien
2003-07-02 12:41:04 +00:00
Ruslan Ermilov
a51613b6da There's no reason to keep separate AINC knob anymore.
The only real use of it (lib/libc/Makefile) has been
fixed, and if necessary, the contents of AINC should
be added to CFLAGS.

Explained by:	bde
2003-07-01 15:15:45 +00:00
Ruslan Ermilov
fdcdec572a Propagate the ${AINC} knob (assembler include) to sys.mk,
and remove the .S.o transformation rule from bsd.lib.mk.
2003-06-30 20:02:46 +00:00
Ruslan Ermilov
70d9bc066f Removed suffix-transformation rules that are duplicates
(or are subsets) of the corresponding rules in sys.mk.
2003-06-30 19:48:14 +00:00
Ruslan Ermilov
ea90b1f55d The use of ld(1) to strip compiler local and non-global
symbols from object files has bitrotted over the last
thirteen years, and it now does more harm than good.

An attempt to work around the problems caused by using
ld(1) for stripping was to pass LDFLAGS to the ld(1)
command, but this was not right either as ${LDFLAGS}
should, by design, be used with cc(1) and not ld(1).

One of the proposed solutions was to use the objcopy(1)
utility to do the strip work, and the other would be to
use strip(1), but Bruce Evans suggested not stripping
any symbols at all.  This works by leaving the grunt
work to the final strip(1) command (when installing the
binary).

Submitted by:	bde
2003-06-30 19:03:56 +00:00
Gordon Tetlow
3c9b856357 Add ${CRUNCH_CFLAGS} support for adding compile options to crunch
components. This is generally considered a non-optimal solution but
it gets the job done for the /rescue case.

Submitted by:	Tim Kientzle <kientzle@acm.org>
2003-06-29 18:16:26 +00:00
Peter Wemm
ef5c58a14c Be consistent about the use of ${LDFLAGS} for the internal rules. Some
were missing.  This made it difficult to add backend ABI overrides when
building shared libs.
2003-06-26 01:01:48 +00:00
David E. O'Brien
a89bd62015 Remove NOSHLIBS, users can get by with NOPIC.
Desired by:	ru
2003-06-10 04:47:49 +00:00
David E. O'Brien
74a0458023 Add NOSHLIBS.
If one is using NOSHARED, why build the libs.
2003-04-27 21:44:52 +00:00
Mark Murray
5741a42f2f Extend the lint handling a bit.
o Make it possible to prevent parts of the tree from being linted
  (say) during a 'make world' by setting NOLINT in a leaf Makefile.

o Make "make lint" work (better) for executable programs.

o Clean up (nuke!) a syntax damaged pipeline.
2002-09-20 19:32:51 +00:00
Peter Wemm
66422f5b7a Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
Ruslan Ermilov
d2893b161b Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
Ruslan Ermilov
397304fe4f Moved `clean:' below, just before the inclusion of bsd.obj.mk,
so that CLEANFILES from bsd.man.mk and bsd.dep.mk are honored.
2002-07-21 21:22:45 +00:00
Ruslan Ermilov
5113446a35 Only define SHLIB_LINK if SHLIB_NAME matches the *.so.* pattern.
(Useful for RELENG_4's lib/libpam/modules.)
2002-07-19 18:40:13 +00:00
Ruslan Ermilov
42c0ad02c2 Correction to the previous revision: define SHLIB_LINK if SHLIB_NAME
is defined (whether or not LIB is defined).
2002-07-18 17:44:20 +00:00
Ruslan Ermilov
4d7d5e7c11 Make it possible (again) to build and install shared library only.
One needs to define SHLIB_NAME for this to work.

Prodded by:	mi
2002-07-03 16:22:43 +00:00
Ruslan Ermilov
badb7c1c6b Try really hard to fix parallel installs. Add a bunch of .ORDER
directives to ensure that all realinstall sub-tasks are executed
after beforeinstall, similarly ensure that all afterinstall sub-
tasks are executed after realinstall.  Demonstration:

all: task1 task2
.ORDER: task1 task2

task2: task2_subtask
.ORDER: task1 task2_subtask

task1 task2 task2_subtask:
	@sleep `jot -r 1 0 1.0`
	@echo ${.TARGET}

Without the second .ORDER directive, task2_subtask can be run in
parallel with task1.

Spotted by:	Andrea Campi <andrea@webcom.it>
2002-07-03 12:28:03 +00:00
Ruslan Ermilov
84f94a79a0 Handle installation of hard and symbolic links via a seperate .mk file. 2002-07-02 12:16:54 +00:00
Juli Mallett
dd247f7371 If CLEANFILES is nil or not defined, do not try to remove it. This happens
when SRCS is entirely files which produce only one compiled form, and when
NOMAN is defined.  This does not seem to happen in STABLE.

Approved by:	ru
2002-06-26 08:41:00 +00:00
Ruslan Ermilov
af2dc86820 Reimplement FILES support using bsd.files.mk with the
same set of features as in recently added bsd.incs.mk
(FILESGROUPS, accessibility from both bsd.prog.mk and
bsd.lib.mk, de-pessimized typical installation path,
etc.)  New standard targets: buildfiles, installfiles,
and files (buildfiles + installfiles).
2002-06-03 14:49:34 +00:00
Ruslan Ermilov
79273cd77c Revision 1.39 made filtering of CFLAGS unnecessary. 2002-05-22 11:03:35 +00:00
Ruslan Ermilov
5d86203733 Rename includes' to buildincludes'.
Rename `incsinstall' to `installincludes'.
Make `includes' a -j safe shortcut for `buildincludes' + `installincludes'.
`buildincludes' and `installincludes' are SUBDIR friendly, if run directly.
2002-05-15 16:19:54 +00:00
Ruslan Ermilov
12e0852a7a CLEANFILES are too long for libc. 2002-05-13 15:23:56 +00:00
Ruslan Ermilov
2a53f3fb35 Major cleanup of bsd.lib.mk.
Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now means to build static library only and don't install
anything.  Added a NOINSTALLLIB knob for libpam/modules.  To not
build any library at all, just do not set LIB.
2002-05-13 10:53:24 +00:00
Ruslan Ermilov
c7b111cba8 Added new bsd.incs.mk which handles installing of header files
via INCS.  Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files.  Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1.  Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

	kerberos5/lib/libtelnet/Makefile
	lib/libbz2/Makefile
	lib/libdevinfo/Makefile
	lib/libform/Makefile
	lib/libisc/Makefile
	lib/libmenu/Makefile
	lib/libmilter/Makefile
	lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD.  Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".
2002-05-12 16:01:00 +00:00
David E. O'Brien
5aa237561f Back out rev 1.118. 2002-05-12 13:48:53 +00:00
David E. O'Brien
e20b0b7333 [Ab]use LDFLAGS rather than CFLAGS.
BDE tells me POSIX pretends `ld' as a directly callable entity does not exist.
2002-05-10 09:32:39 +00:00
David E. O'Brien
bea805383e Pass CFLAGS to {CC} when using it as an `ld' replacement. 2002-05-10 01:30:34 +00:00
David E. O'Brien
d23aa1ef0f Pay attention to LDFLAGS when linking. 2002-05-09 16:43:07 +00:00
David E. O'Brien
8500d819cc Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now implies NOPROFILE, NOMAN, and don't install anything.
Add a NOLIB knob.
2002-05-09 00:44:13 +00:00
Ruslan Ermilov
afeaaa846c Added internal, non-recursive (SUBDIR) versions of the `all-man'
and `maninstall' targets.  This fixes the issue where each subdir
was descended into twice during "make all", and also resurrects
the standardization of `maninstall'.

Urged by:	bde
2002-05-07 15:42:56 +00:00
Ruslan Ermilov
b90dab70f1 Install the manpages before descending into SUBDIRs. 2002-05-07 15:27:56 +00:00
Ruslan Ermilov
c5234b56b6 Abuse bsd.obj.mk for defining default distribute target. 2002-04-24 13:29:34 +00:00
David E. O'Brien
01df2ec328 Change the name of the 'bin' distribution to 'base'.
This is done since it contains much more than /bin, and also gets in the
way when making a combined install+fixit CD.

OK'ed by:	jkh
2002-04-23 22:16:41 +00:00
Ruslan Ermilov
b25a566d47 Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.
Ensure all standard targets honor SUBDIR.  Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents).  Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk.  Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)
2002-04-23 09:03:56 +00:00
Ruslan Ermilov
72d5490744 Make .asm transformation rules synonyms to the .s rules. 2002-04-22 08:56:34 +00:00
Mark Murray
2738ffebcc Style. Fix long lines and a <tab> indent that should be 4 spaces. 2002-04-21 17:26:16 +00:00