Commit Graph

30 Commits

Author SHA1 Message Date
Simon Wilkinson
cac7424272 Clean up assertion
The AFS code has multiple different assertion implementations in
userspace. This patchset is the start of bringing some sanity to them.

In rx, we have osi_Assert, a user/kernel assertion macro. This is only
available to libraries which have RX dependencies

In util, we redefine the standard 'assert()' macro to provide a
cross-platform assertion solution.

Because util has an RX dependency, neither of these provide an
assertion solution for libraries which should be independent of rx.
So, pull the assertion code out of util, and put it into opr, as a new
opr_Assert() macro. Implement the userspace osi_Assert in terms of this
macro, leaving the kernel variant untouched.

Update callers to the new macro and header file names.

Change-Id: I780b30ec1ea1207daa17127df4d5fbf9a94481b6
Reviewed-on: http://gerrit.openafs.org/5394
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-25 21:10:11 -07:00
Garrett Wollman
192ba0deae pthreaded servers: set thread names
In the startup function for each thread, set a thread name.  This
can safely be done unconditionally as LWP builds turn the call into
a no-op.  In general, the thread name parallels the name passed to
LWP_CreateProcess, but for Rx server threads, it additionally includes
the thread ID so that these threads can easily be distinguished.  (I'm
not sure yet whether doing so will prove to be useful or counterproductive.)

Change-Id: I30e012eebef4c7856084fa8b8eb1d88d9fcdf2c4
Reviewed-on: http://gerrit.openafs.org/5041
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:16:25 -07:00
Simon Wilkinson
ffb6864f0f Make --enable-pthreaded-ubik do what it claims
The configure help text for --enable-pthreded-ubik says
    "enable installation of pthreaded ubik applications"

This patch set makes the behaviour in the code match that. Instead
of controlling whether the pthreaded ubik code is compiled at all,
the configure option now just controls whether it is installed. This
means that we'll always build the pthread code, and so should reduce
the number of times it is inadvertently broken.

Change-Id: I8b2ffb46e01157f2043cf7daf68e69580ea285c5
Reviewed-on: http://gerrit.openafs.org/5028
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:28:26 -07:00
Simon Wilkinson
f56f273155 Fix pthreaded ubik dest and install rules
Fix the dest and install rules for pthreaded ubik, and its servers, so
that they match the current Makefile style.

Change-Id: Ifd3bd181772e278518f2a90167b6524d6045645c
Reviewed-on: http://gerrit.openafs.org/5027
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-15 12:27:27 -07:00
Simon Wilkinson
4c9134a995 Build system: Move install definitions to include
Move the definitions of the INSTALL_* variables out to
Makefile.config rather than replicating them in each file.

Change-Id: I5f74dcbf544a93716994418bee3be2c51a2a82d0
Reviewed-on: http://gerrit.openafs.org/4781
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:50:52 -07:00
Ben Kaduk
352c3e366c Rename libcom_err to libafscom_err
We no longer provide a compatible libcom_err, and in fact
we renamed the symbols in our libcom_err several years ago
to reflect this fact.
When we build on a system where KRB5_LIBS includes
-lkrb5 -lcom_err , the new Unix build system will pick up
our libcom_err (as $(AFS_LDFLAGS) is the first argument in
AFS_LDRULE and pulls in a linker search path for our libcom_err)
which does not provide all the needed symbols for libkrb5.

Fully rename our libcom_err away to avoid these conflicts.

FIXES 128640

Change-Id: Ifdd677609f432d42252b1716fc5e8755f3a44640
Reviewed-on: http://gerrit.openafs.org/3547
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 07:50:11 -07:00
Simon Wilkinson
8c1f725931 afs_snprintf is dead, long live rk_snprintf
We were shipping our own implementation of snprintf and friends, as
afs_snprintf. Now that we're using roken everywhere, we can make use
of roken's rk_snprintf, and no longer need to ship our own.

As Window's snprintf isn't C99 compliant, roken always uses its own
on this platform. The effect of this is that we can no longer use
AFS_UINT64_FMT and AFS_INT64_FMT for snprintf calls (and the Log
functions that call them). Instead, we need to always use the
Unix format specifiers when calling these functions.

Make thse changes across the whole tree.

Change-Id: I3fffef97566f239ad639f15c4decd136d5bbd765
Reviewed-on: http://gerrit.openafs.org/4316
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-27 16:43:30 -07:00
Jeffrey Altman
a0d56ceb94 ubik: build all files for pthread version
Build all files for pthreads from the ubik directory.
No longer require src/tubik/NTMakefile.
Add missing library to tbutc linkage requirements.

Change-Id: If517ce528e5dde9b600824897e1304949b2c2719
Reviewed-on: http://gerrit.openafs.org/4150
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-05 17:03:01 -08:00
Andrew Deason
8f7ae51c61 tubik: Link with libafsauthent
libubik_pthread.a requires libafsauthent.a, since we make use of
afsconf_* functions. Add libafsauthent to LIBS and make tubik depend
on it.

Remove linking to liblwp while we're here, as we should not be using
any LWP code.

Change-Id: Ie028fedfbc3e7a8a78dc69a2c38be99eb72602da
Reviewed-on: http://gerrit.openafs.org/3464
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-06 21:37:23 -08:00
Simon Wilkinson
a9b8fd81bf Remove local crypto
This change removes all of the local crypto use in userspace, in
favour of using our shiny new afshcrypto library.

Change-Id: Iac21b42e49bac424cc28c449a31f2da44121b7e5
Reviewed-on: http://gerrit.openafs.org/2577
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-19 05:07:57 -08:00
Simon Wilkinson
a17bf58c08 Replace bits of libutil with libroken
Replace all of the bits of libutil that were originally culled
from libroken with libroken originals.

Change-Id: I361d7a8d134a361caa2da16963408c74c55a1d4e
Reviewed-on: http://gerrit.openafs.org/3211
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-19 04:52:30 -08:00
Jeffrey Altman
8073ef008b Windows: build tubik
Build the pthreaded ubik library on Windows

Change-Id: Id6112ef95b60a5f786fa60473ca8ae1a9a3b5201
Reviewed-on: http://gerrit.openafs.org/3326
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-19 04:46:02 -08:00
Simon Wilkinson
f22ae5f7d8 Unix: Rework build system
Rework the unix build system so that we support taking CFLAGS and
LDFLAGS from the command line, and don't replace them with our own
settings. Also, take the opportunity to bring some sanity and
consistency into our Makefiles.

The standard Makefile.config  now defines rules for LWP, pthreaded
and shared library builds. The CFLAGS settings for these are
called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively.
Similarly named variables are provided for LDFLAGS.

A module may select to use a particular build type for its suffix
rule by including either Makefile.lwp, Makefile.pthread or
Makefile.shared from src/config. This creates an appropriate .c.o
suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and
creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to
build, and link objects. For example:

foo.o: foo.c
	$(AFS_CCRULE) foo.c

foo: foo.o
	$(AFS_LDRULE) foo.o

If a you wish to override the CFLAGS or LDFLAGS for an object build
using these rules (or through the .c.o suffix rule) you can do so,
by defining CFLAGS_<object> or LDFLAGS_<object>. For example:

CFLAGS_foo.o= -DDEBUG
LDFLAGS_foo = -ldebugging

A module may also alter the behaviour of the compile and link steps
module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS.

This functionality is now used throughout the tree:
    *) Suffix rules are used wherever possible, removing a number of
       unecessary build rules.
    *) All link steps are replaced with AFS_LDRULE
    *) All standard compile steps are replaced with AFS_CCRULE
    *) Unusal compile steps are defined, as far as possible, int
       terms of the LWP_ PTH_ and SHD_ variables.
    *) The use of $? has been removed entirely, as it makes it
       impossible to provide build rules with dependency information

Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2
Reviewed-on: http://gerrit.openafs.org/2896
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-10-11 08:00:29 -07:00
Marc Dionne
e6c9cf2466 tubik: minor Makefile cleanups
Rework the install targets for udebug to avoid warnings in the case
where afssrvbindir = bindir

Remove commented out compile line for udebug

Change-Id: I500ba2575e7d71114dbdec704d6b3d22585cfdd3
Reviewed-on: http://gerrit.openafs.org/2851
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-09-27 08:21:08 -07:00
Andrew Deason
4c89b6417f Remove stale warning suppressions
butc/dump.c and ubik/beacon.c have had their warnings fixed and their
suppressions removed. Remove the warning suppression for tbutc/dump.c
and tubik/beacon.c, as well.

Change-Id: Ie3cae93932797ef5a55403f3548518af6da267f0
Reviewed-on: http://gerrit.openafs.org/2242
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-24 09:56:56 -07:00
Marc Dionne
62bb20951e Remove duplicate make targets in tubik, cleanup dependencies
Eliminate a few duplicate targets in the tubik Makefile, and
clean up some dependencies that could cause the same source file
to be compiled by different threads simultaneously when building
in parallel.  At least on my current gcc this would consistently
result in a gcc internal error.
The duplicate targets generate make warnings.

Change-Id: I807debae67c04b00a88ec798b966628e10c5f316
Reviewed-on: http://gerrit.openafs.org/1506
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-03-02 16:09:02 -08:00
Andrew Deason
289d06650d Squash pthreaded ubik warnings
Fix/ignore some warnings with --enable-pthreaded-ubik:

 - ubik/ubik.c: move rx_stackSize decl to non-pthread code, since it's
   only used there

 - budb/db_dump.c: move 'code' decl to non-pthread code, since it's only
   used there

 - ubik/recovery.c: move return to outside the ifdef, so we still have a
   return statement in the pthreaded case

 - Add -Wno-error to beacon.c in tubik, to match the ubik case

Change-Id: I614f2425c36e77bb1a08838b45166d8edb080c73
Reviewed-on: http://gerrit.openafs.org/1211
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-02 09:31:56 -08:00
Andrew Deason
6beb32f0e0 Use -A and -u in pthreaded ubik rxgen
Use -A for rxgen in tvlserver and tptserver to generate ANSI code, so we
don't generate warnings. Also use -u in tubik rxgen, so we generate the
ubik_* functions that new code uses.

Change-Id: Id13168e65e36aeebf48610c28e7b3df2164fc073
Reviewed-on: http://gerrit.openafs.org/1210
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-02 09:31:30 -08:00
Andrew Deason
61afb03fdd Build utst_client for pthreaded ubik
Build utst_client in src/tubik, as it is in src/ubik.

Change-Id: I655445905efbaaa9e578a9e2061091679813a768
Reviewed-on: http://gerrit.openafs.org/1209
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-02 09:30:34 -08:00
Simon Wilkinson
d5081f264d Remove CVS ignore files
Now we're in git we don't need any cvsignore files any more...

Reviewed-on: http://gerrit.openafs.org/1
Verified-by: Derrick Brashear <shadow@gmail.com>
Reviewed-by: Derrick Brashear <shadow@gmail.com>
2009-07-06 11:03:16 -06:00
Simon Wilkinson
c41a467741 gitignore-20090615
LICENSE IPL10

make gitignore files
2009-06-15 23:29:29 +00:00
Russ Allbery
db9f59e9be threaded-ubik-cvsignore-20080713
LICENSE BSD

Add .cvsignore patterns for threaded ubik builds.
2008-07-14 05:12:46 +00:00
Matt Benjamin
9d1863dae7 tubik-build-fix-20080624
LICENSE IPL10

add missing build dependencies
2008-06-24 13:58:10 +00:00
Matt Benjamin
98b87a2ac1 tubik-build-fix-20080623
LICENSE IPL10

add missing build dependencies
2008-06-23 18:50:06 +00:00
Marc Dionne
bb617c649c cvsignore-updates-20080612
LICENSE IPL10
FIXES 102819

add missing things to cvsignore files
2008-06-12 21:00:12 +00:00
Derrick Brashear
e62727e328 tubik-more-makefile-fun-20080404
LICENSE IPL10

kill off library name reuse
2008-04-04 16:39:53 +00:00
Derrick Brashear
ece59f688a tubik-head-makefile-compat-20080403
LICENSE IPL10

match new style install stuff
2008-04-03 17:58:11 +00:00
Derrick Brashear
3316136038 tubik-makefiles-fun-20080402
LICENSE IPL10

these fixes brought to you by delicious beer.
2008-04-03 02:20:25 +00:00
Derrick Brashear
ec02ff4342 tubik-makefile-fixes-20080402
LICENSE IPL10

don't use gmake macros. ick
2008-04-02 22:45:05 +00:00
Steven Jenkins
9fbbc3f50c pthreaded-ubik-20080402
LICENSE IPL10

add pthreaded ubik and various binaries
2008-04-02 20:47:27 +00:00