Run ctfconvert/ctfmerge for all objects Commit 88cb536f (autoconf: detect ctf-tools and add ctf to libafs) introduced running ctfconvert and ctfmerge for libafs on Solaris, but didn't add any CTF data for userspace code. This commit causes the same commands to be run for every binary that we build (if the ctf tools are available). To accomplish this, also refactor how we run ctfconvert and ctfmerge. The approach in commit 88cb536f would require us to modify the makefile rule for every executable to run RUN_CTFCONVERT and RUN_CTFMERGE, which is somewhat impractical. So instead in this commit, we modify all of our *_CCRULE and *_LDRULE variables to wrap the compiler invocation with the new CC_WRAPPER script. This means our *RULE variables change from something like this: FOO_CCRULE = $(RUN_CC) $(CC) $(XXX_FLAGS) -o $@ to something like this: FOO_CCRULE = $(RUN_CC) $(CC_WRAPPER) $(CC) $(XXX_FLAGS) -o $@ CC_WRAPPER expands to the script src/config/cc-wrapper, which just runs ctfconvert or ctfmerge on the relevant files after the compiler/linker runs. If the CTF tools are not configured, CC_WRAPPER expands to nothing, to limit our impact on other platforms. This commit was developed in collaboration with mbarbosa@sinenomine.net. Change-Id: Id19ba9d739edc68f01c2db7d5caa20758ec8144a Reviewed-on: https://gerrit.openafs.org/13308 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Build system: MT_LIBS includes XLIBS The MT_LIBS library list already includes XLIBS, so there's no need to specify both on a link line. Change-Id: I8594b1b6e1a16af741b40822cbce49e846b26f49 Reviewed-on: http://gerrit.openafs.org/8904 Reviewed-by: Daria Brashear <shadow@your-file-system.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
DAFS: Remove AFS_DEMAND_ATTACH_UTIL Currently we have two DAFS-related preprocessor defines in the codebase: AFS_DEMAND_ATTACH_FS and AFS_DEMAND_ATTACH_UTIL. DAFS_FS is the symbol for enabling DAFS code, and turns on demand attachment and all of the related complicated volume handling; it requires pthreads. DAFS_UTIL is supposed to be used for utilities interacting with DAFS, but do not have pthreads and so cannot build the relevant threads for e.g. the VLRU, so they don't support demand attachment and a lot of more advanced volume handling techniques. Having both of these exist is confusing. For example, currently in partition.c we only initialize dp->volLockFile for DAFS_FS, even though the structure exists if _either_ DAFS_FS or DAFS_UTIL is defined. This means when only DAFS_UTIL is defined, volLockFile will exist in the partition structure, but will be uninitialized! Amongst other possible issues, this means right now that DAFS_UTIL users (dasalvager is the only one right now) will try to use an uninitialized volLockFile whenever they try to use a volume that needs locking. Since the partition struct is usually initialized to all zeroes, this means we'll try to issue a lock request for FD 0, whatever FD 0 is. If FD 0 is not open, we'll fail with EBADF and bail out. But if FD 0 is open to some random file, the lock will probably succeed, and we'll proceed without actually locking the volume lock file. While the fssync volume checkout mechanism still works, the on-disk locking mechanism protects against race conditions the fssync volume checkout mechanism cannot protect against, and so handling volumes in this way is not safe. This is just one example; there are other issues with the partition headerLockFile and probably may other things; most instances of DAFS_FS really should be enabled for DAFS_UTIL as well. So, instead of trying to account for and fix all of these problems individually, get rid of AFS_DEMAND_ATTACH_UTIL, and just use AFS_DEMAND_ATTACH_FS. This means that all relevant code must be pthreaded, but since the only relevant code is for the dasalvager, we can just make dasalvager pthreaded. Salvaging does not make use of any threads or LWPs, so this should not have any side-effects. Thanks to Ralf Brunckhorst for reporting the issue where we encounter EBADF when FD 0 is not open, leading to the discovery of this. Change-Id: I3848eb877f26b9d65833d5ce0e03f5cf7ba28de4 Reviewed-on: http://gerrit.openafs.org/10123 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Make the inode fileserver backend build again - Unconditionally build int64_to_flipbase64 and flipbase64_to_int64. These are only used by namei, but are referenced by the liboafs_util export list - Include rx_queue.h in listinodes.c, so the queue elements in various structures are defined. - Rename vfsck's getline, so we don't conflict with stdio's getline - Fix the includes in vfsck/dirutils.c so we get a definition for VolumeId - salvageserver needs libsys for various ihandle operations Change-Id: Ibed3439c1eca499e2ada785e1e8186f4480117a4 Reviewed-on: http://gerrit.openafs.org/9966 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
dasalvager: use pthreads salvageserver already uses this code, and it appears to do the right thing. Change-Id: I4c0f2ec503f2388a1483e89a04ff78eda270659b Reviewed-on: http://gerrit.openafs.org/9843 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Pretty make output for tsalvaged, lib[u]afs Change-Id: I852f862c029cad60dc7871ab22367fb266314244 Reviewed-on: http://gerrit.openafs.org/8108 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Stop using libafsauthent Change-Id: Ieead3704e3210a1d88500ad1efa15bd2cad93bf6 Reviewed-on: http://gerrit.openafs.org/8098 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: Derrick Brashear <shadow@your-file-system.com>
Stop using libafsrpc Instead of using libafsrpc.a in the pthreaded server directories, use the libtool library variants instead. Change-Id: I4cdbaf5a060b3e5aa82fb0d79535cb4fdc850bcf Reviewed-on: http://gerrit.openafs.org/8074 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
lwp: Build a pthreaded compat library with libtool The majority of the LWP directory isn't used by pthreaded applications. However, there are three files - fasttime.c, lock.c and waitkey.c which are used within pthreaded code. Eventually, these should live somewhere other than the LWP directory. For now, just build a small pthreaded library to hold them, so we can finish up with the libtool work before considering how to move this code elsewhere. Change-Id: I66281f7cd838c048fd982bbd0f756a16a10862d1 Reviewed-on: http://gerrit.openafs.org/8069 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
util: Convert to using libtool Create a pthreaded version of libafsutil, named liboafs_util.la, and use this library in all of the pthreaded binaries that we build, replacing both inclusion of libafsutil.a, and direct compliation of pthreaded versions of the util source files. libafsutil.a is provided for legacy LWP applications, and the convenience library libafsutil_pic.a remains until we address the way in which the user space cache manager is built and linked. Change-Id: Ibdc3d6e2fe56ca6f5b882cf03991d1a2e32c62b2 Reviewed-on: http://gerrit.openafs.org/8056 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
cmd: Convert to using libtool Convert the libcmd and libcmd_pic libaries to being built using libtool. Historically, these have been built as LWP code, but they have no LWP dependencies, and no LWP-specific code within them. So, make cmd a pthread-only library. In addition to the libtool library liboafs_cmd.la, we build the legacy libcmd.a and libcmd_pic.a as convenience libraries. libcmd64.a (a 64bit variant, used solely by kdump), remains built through "normal" means. Update pthreaded users of libcmd to use the new liboafs_cmd.la. For now, non-pthreaded users are left alone. Change-Id: Id8445949754d1942f6e8752ae182b4e6f86fe94f Reviewed-on: http://gerrit.openafs.org/8055 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
opr: Convert to using libtool Convert opr so that it uses libtool. For backwards compatibility we still build libopr.a, but we do so as a static convenience library. As libopr.a may, in the future, be converted to an LWP library, change all of the pthreaded binaries so that they link against the libtool library liboafs_opr.la Change-Id: Icee04ff4745334f06ffba16df5bb07fc9dcc0b54 Reviewed-on: http://gerrit.openafs.org/8034 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: Derrick Brashear <shadow@dementix.org>
auth: Relocate NetRestrict support functions Pull the NetRestrict and NetInfo support functions out of libutil, and into libauth. This starts to concentrate all of our configuration file parsing functions into the same place. It also gets rid of a circular dependency. NetRestrict parsing relies on functions from rx, so with this in libutil, we had the dependency chain util->rx->util Change-Id: I250d4d8264da8db61f603a06d1b7fdab44384cd3 Reviewed-on: http://gerrit.openafs.org/8027 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
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>
Move string manipulation functions out of util Some functions in libafsutil depend upon the RX libraries, which means that pulling in other functions in this library can create a dependency upon RX. This is less than ideal for low-level libraries such as cmd and comerr. So, create a new low-level library (currently named 'opr') which can contain low-level functions from util, and elsewhere. This library should have no dependencies other than on system libraries and libroken. Change-Id: I703db3da4d8faf79ee82bf572af09d07152d9b25 Reviewed-on: http://gerrit.openafs.org/5363 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: Derrick Brashear <shadow@dementix.org>
Build a separate copy of vlib for dasalvager Currently dasalvager links to vlib.a. But vlib.a is built without any DAFS defines, and so the size of a struct DiskPartition64 is different (since dasalvager is built with AFS_DEMAND_ATTACH_UTIL). Build our own copies of the volume package files instead, with AFS_DEMAND_ATTACH_UTIL defined. Change-Id: I7b9f965fc18b6e6b71275912684ad041aaef19f4 Reviewed-on: http://gerrit.openafs.org/4875 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
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>
Remove NINTERFACE define Whatever behaviour was controlled by the -DNINTERFACE define is long gone from our code base (git log -SNINTERFACE can't find any references, which suggests that its removal predates OpenAFS). Simplify our Makefiles by removing the definition Change-Id: Ic84261eb40aa7de9b7c0ec7b8372517b09e242d2 Reviewed-on: http://gerrit.openafs.org/4427 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
tsalvaged: Tidy up build rules COMMON_CFLAGS already includes XCFLAGS and ARCHFLAGS, so don't include them again in the salvager cflags rule Change-Id: Ib65e9235fa5d23473417f0d197a3610c9b17d1f0 Reviewed-on: http://gerrit.openafs.org/4416 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
add AFS_DEMAND_ATTACH_UTIL use this for non-pthreads "support code" e.g. salvager. Change-Id: I17825fa90de33a7a4d17f364713fd4602dae497b Reviewed-on: http://gerrit.openafs.org/4312 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>