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>
We need our own abort function, because the behaviour of the Windows
abort() implementation isn't sufficiently flexible for us.
Because we're replacing an operating system function, reather than
implementing a missing function, this doesn't belong in roken.
So, provide an alternative opr_abort() implementation in our portable
runtime layer, which is a synonym for abort() on Unix, and implements
the required DebugBreak() functionality on Windows.
Remove lwp_abort() which was just creating another, unnecessary, layer
of abstraction.
Change-Id: Ice226d70d2791beaba011f42e39fde60242f6cc3
Reviewed-on: http://gerrit.openafs.org/4428
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Build 64-bit binaries on solaris x86 version 10 or better
build systems running in 64-bit mode.
Builders may set the the ARCHFLAGS environment variable
to "-m32" before running configure to build 32-bit binaries
on a 64-bit build host.
Change-Id: I27558a2c7fe9872cf30889ca57e778985a3ff461
Reviewed-on: http://gerrit.openafs.org/5450
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
simply compile lwp process assembler for both arm arches.
Change-Id: Ie09ec1e3684656a492373f86e4c8be71e6abfabd
Reviewed-on: http://gerrit.openafs.org/4832
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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>
The roken gettimeofday implementation doesn't return timezone
information. Audit the whole code to make sure that we don't rely on
this, and tidy up those places where we were passing an unused
timezone structure to the gettimeofday call.
Change-Id: Ia83f86483a9c7262fc0904236c0d039a912e3731
Reviewed-on: http://gerrit.openafs.org/4430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I4952f8d115d38a3bd1dfe86478cd4a30f533e86f
Reviewed-on: http://gerrit.openafs.org/4386
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
On Linux, afs/param.h determines whether to use the ucontext()
function based on the glibc version. However, the glibc version
macros aren't available until a C library header has been included.
There have been a couple of attempts to fix this. The first included
afs_sysnames.h before the C library check, but this wasn't sufficient
to pull in a header for all builds. The second included stdio.h before
including afs/param.h in process.c.
Whilst the second approach works, it has the drawback that it breaks
our convention that afsconfig.h and afs/param.h must always be the first
includes in a file. More seriously, it means that the behaviour of
afs/param.h is different depending on where it appears in the include
order - which is especially dangerous for 3rd party user.
So, this patch tries to resolve all of this by explicitly including
features.h before doing the glibc version checks. The only danger I
can see here is that Linux platforms without glibc may lack a
features.h, but I suspect we have trouble building on such platforms
in any case.
Change-Id: Ief96d32b10372225335e2d2fbb7205da4bf5fc0a
Reviewed-on: http://gerrit.openafs.org/4389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
we were wiping out fun things like archflags. shouldn't be needed.
let's just do this instead.
Change-Id: I80b3453bb237b4995d642b947d03c17d82cda5e7
Reviewed-on: http://gerrit.openafs.org/4266
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This reverts commit fbac809a46.
The ucontext header is only included in lwp.h for platforms that use
ucontext as a means for context-switching in LWP. The preempt module
needs the ucontext header for signal handling on some platforms (at
least Solaris). So, ucontext.h may not be included by lwp.h on these
platforms, if that platform does not use ucontext for LWP
context-switching. So we need to explicitly include ucontext.h in
preempt.c.
Change-Id: Ie08f20c7375d6ff1b185f64da70c983dbe19ac47
Reviewed-on: http://gerrit.openafs.org/4095
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
some stuff that got lost from the last batch
Change-Id: Id892a8fce7c90a07c359d77282c557a0a9b41cd2
Reviewed-on: http://gerrit.openafs.org/4064
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
We should not need to prototype calloc() anymore and osi_Assert() has
been replaced with assert() apparently.
Change-Id: I3ef6178c589cabcd0637cd88c35d2276833b4590
Change-Id: I0626475f120ff9a373e0251f3c4485c052922747
Reviewed-on: http://gerrit.openafs.org/3991
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
the pthreads-wrapper LWP doesn't currently compile. it will need
to be revisited if we ever care. remove it (as well as a bit of other
unused code)
Change-Id: I61e7bc493127ec49347ca02b24db8fa79e4cbb28
Reviewed-on: http://gerrit.openafs.org/3564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In LWP_CreateProcess we take a pid. if it's null, don't crash.
Change-Id: I2a491788f5ce23a094e65192164838d5bbfc4b31
Reviewed-on: http://gerrit.openafs.org/3556
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
A minimal change set to get libroken to build on Windows. Sadly,
libroken contains definitions for a number of platform compatibility
macros which were previously scattered throughout the windows code.
These scattered macros have to be removed in order to build libroken.
The impact of this removal is that a very large number of files
throughout the tree require the addition of "roken.h" to pick up the
new compatibility code. The bulk of this change is adding these
includes.
In addition, some of the added includes add roken dependencies to the
Unix build. So, also add libroken to the build rules in affected Unix
Makefiles.
Change-Id: Ifba431bd37e67b1e273fbc6f69b805a232193456
Reviewed-on: http://gerrit.openafs.org/3205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Use the stdio_ext functions provided by solaris and glibc
instead of directly accessing private stdio FILE structure
members. This is needed for 64-bit solaris builds and is more
portable in general since the FILE structure is meant to be
opaque. Remove the duplicated code in the pthreaded butc
package.
Change-Id: Idbefa88e2563bb117322e818b1300b324fc3626d
Reviewed-on: http://gerrit.openafs.org/3257
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
because NDEBUG breaks things which happen inside an assert,
be done with that. instead, call osi_Assert wherever possible.
doesn't work for code which builds before rx; those cases we handle
by ensuring no operations happen inside the assert(). side effect:
move all pthread operations wrapped in asserts to MUTEX_mumble and
CV_mumble calls where those exist, so the assertions happen all in
one set of macroes.
Change-Id: I9fd8a0fdfdaed5ed55de3e5c0c4673d4714e7441
Reviewed-on: http://gerrit.openafs.org/3001
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
provide a private assert header which does not
pollute the normal namespace for the assert header.
further changes will modify pthread operations to not use
generic assert as a "did it work", which breaks if NDEBUG is set
Change-Id: I43a95c0aa31ad2e772bce9142356fd5c5bedac6c
Reviewed-on: http://gerrit.openafs.org/2995
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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>
Many 'install' and 'dest' targets were referring to source files
without a srcdir prefix. Fix them so we can 'make install' / 'make
dest' with objdir.
Change-Id: Id76c5e326309baf8ec3f1213ecb2e40b19aea7d4
Reviewed-on: http://gerrit.openafs.org/2522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
make things buildable on arm darwin
Change-Id: I88af2b82e9ed356fd57aa8f05dfee71d7fa6cd8a
Reviewed-on: http://gerrit.openafs.org/2153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
param.linux26.h defines USE_UCONTEXT for all Linux platforms for
glibc 2.4 and higher, but it does this by testing __GLIBC__ and
__GLIBC_MINOR__. These are defined by features.h, which is included
by any system header. At least one system header must be included
before those are defined. lwp/process.c was including <afsconfig.h>
and <afs/param.h> before any other headers, leading to those macros
being undefined. Most of the Linux architectures either have their
own implementation or were explicitly defining USE_UCONTEXT in the
per-architecture param file, but ppc_linux26 was relying on the
default.
Fix this by reordering the includes to include the various system
headers before <afs/param.h> and add a comment explaining why.
This previously worked in earlier versions because the old
param.ppc_linux26.h file included <afs/afs_sysnames.h>, which
included "stds.h", which included a system header prior to the check
for ucontext. The new generic param file reverses that order.
Change-Id: I214e54f684afdef07e6e2dec5b6e6e4d255ab4ec
Reviewed-on: http://gerrit.openafs.org/1791
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Instead of defining various symbols like _XOPEN_SOURCE, _BSD_SOURCE, and
the like, just use autoconf's AC_USE_SYSTEM_EXTENSIONS to define all of
the appropriate symbols for us. Deal with some fallout by removing some
of the existing defines.
Change-Id: I1c1968c89cc2dfda1293fd2566dac8e266325a72
Reviewed-on: http://gerrit.openafs.org/1582
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Rather than using an arbitrary array memset to ones as our signal
mask, use the POSIX sigfillset function and eliminate the static
variable. Fixes strict aliasing errors with --enable-checking and
gcc 4.4.3 on Linux x86.
Change-Id: Ic3e0499d03657d94f60808ed12e090dc62cce6fc
Reviewed-on: http://gerrit.openafs.org/1616
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The non-executable stack annotation used for Linux works by adding
an additional section to the generated object. The annotation added
in 9bfd03d723 was added to the beginning
of each assembly file. This caused build failures on Linux s390
because the remainder of the assembly code was then put in that
section, which was discarded during linking.
Add the annotation to the end of each assembly file instead, following
the instructions at:
http://www.gentoo.org/proj/en/hardened/gnu-stack.xml
Change-Id: I5bd2d8d0ac31932b59757dcec0a942c459d61cac
Reviewed-on: http://gerrit.openafs.org/1615
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Add printf format checks to the remaining va-arg printf-style
functions in the tree. There are no error fixes required from this
change.
Change-Id: If774532a3ac5d8b611ec9f47576e933a57907185
Reviewed-on: http://gerrit.openafs.org/796
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The Darwin build uses ARCHFLAGS to control the architectures it
builds binaries for. However, this causes problems for standalone
builds which just do ./configure && make. So, if ARCHFLAGS is
undefined, ask gcc which architecture it thinks that it is
building for, and use that.
Change-Id: If9e7dc3c41ded5ac0593ae20ddd741690914a699
Reviewed-on: http://gerrit.openafs.org/1181
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
memset() takes a void * as it's first argument. Don't explicitly cast
what we're passing in to (char *), as this may mask other errors.
Reviewed-on: http://gerrit.openafs.org/701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
-- The EP/ep function does not return anything; declare the function pointer
accordingly
-- Explicitly cast &stackvar to char* to avoid a warning
Reviewed-on: http://gerrit.openafs.org/598
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
due to 32/64 and a newer compiler, macos 10.6 finds more warnings.
these are fixes for some of them.
Reviewed-on: http://gerrit.openafs.org/533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Irix has no stdint.h; wrap in ifdefs so we don't include
when we don't have it.
Reviewed-on: http://gerrit.openafs.org/530
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Use intptr_t and uintptr_t casts to appease the compiler when
values are converted between 32-bit integers and pointers.
This generates many warnings (currently ~170 on linux amd64)
when pointers are 64-bit.
These types are normally defined in stdint.h, and get defined
by autoconf if that's not the case.
In a few places, NULL is simply replaced with 0 where compared
with an integer.
Reviewed-on: http://gerrit.openafs.org/474
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Microsoft Debugging Tools for Windows, Visual Studio Debugger,
and SysInternals tools can all make use of a Symbol Server.
http://msdn.microsoft.com/en-us/magazine/cc163563.aspx
The commit adds functionality to the build system to automatically
add binaries and symbols to a symbol store during the build.
This functionality is only enabled if two environment variables
are defined:
SYMSTORE_EXE - specifies the location of symstore.exe
SYMSTORE_ROOT - specifies the location of the symbol store
an optional environment variable permits an arbitrary comment
to be added to the symbol store history file.
SYMSTORE_COMMENT - arbitrary text to be added to the history
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/324
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Make things build on MacOS 10.6 again. Don't break 10.5 build.
Fix an error in the MacOS port which was left from previous head.
Reviewed-on: http://gerrit.openafs.org/96
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The fasttime functions are used regardles of whether we're using
pthreads or LWP. Previously, lwp.h only provided their prototypes
if LWP was in use. Change this so these prototypes are always provided,
by refactoring the header a little. In the process, remove some
duplicate header includes.
Reviewed-on: http://gerrit.openafs.org/56
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The move to git means that we can no longer populate the RCSID
macro in the way that it was used with CVS. This patch simply
removes the macro from every file, except where it contains
information from upstream (and it's in a comment).
Reviewed-on: http://gerrit.openafs.org/14
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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>
LICENSE MIT
Add code signing with signtool.exe to the build process.
If all three of the required CODESIGN_xxxx environment
variables are defined, signtool will be used to sign each
exe, dll, and installer as they are built.
The three environment variables are:
CODESIGN_DESC = <description of application>
CODESIGN_TIMESTAMP = <url of certificate authority timestamp server>
CODESIGN_URL = <end user help URL>
The default signing certificate is the one that will be used by
signtool. If these environment variables are not defined, code
signing will be skipped.
LICENSE BSD
Use PATH_CPP instead of CPP everywhere and always redirect the output
instead of assuming that it will write to a file. Hopefully this is the
least common denominator across all systems, although it still isn't
fully correct for systems that have no separate cpp binary.