dlm: master - Fix linking order
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=8b74fc075d10b3a...
Commit: 8b74fc075d10b3a6602c140b6a2bd62bbded9506
Parent: 7b0b7b33b052fbd3a5b0cafd8dc134ce2ce713ec
Author: Jacek Konieczny <jajcus(a)jajcus.net>
AuthorDate: Fri Nov 2 16:39:48 2012 +0100
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Nov 2 10:59:49 2012 -0500
Fix linking order
Objects should generally be listed before the libraries they require.
DLM building fails for me without these changes.
Signed-off-by: Jacek Konieczny <jajcus(a)jajcus.net>
---
dlm_controld/Makefile | 4 ++--
dlm_tool/Makefile | 2 +-
fence/Makefile | 2 +-
libdlm/Makefile | 8 ++++----
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index d279b0d..f42a913 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -62,10 +62,10 @@ LIB_LDFLAGS += -Wl,-z,relro -pie
all: $(LIB_TARGET) $(BIN_TARGET)
$(BIN_TARGET): $(BIN_SOURCE)
- $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
$(LIB_TARGET): $(LIB_SOURCE)
- $(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR) $^
+ $(CC) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR)
ln -sf $(LIB_TARGET) $(LIB_SO)
ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
diff --git a/dlm_tool/Makefile b/dlm_tool/Makefile
index fe43677..c16d8f5 100644
--- a/dlm_tool/Makefile
+++ b/dlm_tool/Makefile
@@ -39,7 +39,7 @@ BIN_LDFLAGS += -lpthread -ldlm -ldlmcontrol
all: $(BIN_TARGET)
$(BIN_TARGET): $(BIN_SOURCE)
- $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@
+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@
clean:
rm -f *.o *.so *.so.* $(BIN_TARGET)
diff --git a/fence/Makefile b/fence/Makefile
index 0f1a29c..b4c59dd 100644
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -40,7 +40,7 @@ BIN_LDFLAGS += -ldl
all: $(BIN_TARGET)
$(BIN_TARGET): $(BIN_SOURCE)
- $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
+ $(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
clean:
rm -f *.o *.so *.so.* $(BIN_TARGET)
diff --git a/libdlm/Makefile b/libdlm/Makefile
index 565a600..76d3504 100644
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -86,18 +86,18 @@ LLT_LDFLAGS += $(LDFLAGS)
all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
$(LIB_O): $(SOURCE)
- $(CC) $(LIB_CFLAGS) -c -o $@ $<
+ $(CC) $< $(LIB_CFLAGS) -c -o $@
$(LLT_O): $(SOURCE)
- $(CC) $(LLT_CFLAGS) -c -o $@ $<
+ $(CC) $< $(LLT_CFLAGS) -c -o $@
$(LIB_TARGET): $(LIB_O)
- $(CC) $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR) $^
+ $(CC) $^ $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
ln -sf $(LIB_TARGET) $(LIB_SO)
ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
$(LLT_TARGET): $(LLT_O)
- $(CC) $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR) $^
+ $(CC) $^ $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
ln -sf $(LLT_TARGET) $(LLT_SO)
ln -sf $(LLT_TARGET) $(LLT_SMAJOR)
11 years, 6 months
gfs2-utils: master - gfs2-utils: build: Avoid using the kernel versions of kernel headers
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=3d97bf21...
Commit: 3d97bf215fb429aabec3fbe7553688aa5e6a9d00
Parent: 78cbff1fab4806178f69bca3e21dc9f3a396176f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Nov 2 13:44:18 2012 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri Nov 2 13:55:37 2012 +0000
gfs2-utils: build: Avoid using the kernel versions of kernel headers
Currently the configure script checks for kernel headers at
/lib/modules/`uname -r`/source/include/linux/* which means we're using
kernel headers not meant to be used in userspace code. Thus we see a lot
of "Attempt to use kernel headers from user space" warnings when
building with a kernel-devel package installed.
Instead we should be using the userspace versions of the headers in
/usr/include/linux/. This patch removes the config options and checks
which pull in the kernel includes and lets the configure script find the
linux headers in the default include path.
Also removes an unnecessary include of kdev_t.h and updates the linux
header checks in configure.ac to only check for the ones we use.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 40 ++++------------------------------------
gfs2/libgfs2/misc.c | 1 -
2 files changed, 4 insertions(+), 37 deletions(-)
diff --git a/configure.ac b/configure.ac
index ef09569..07c6673 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,16 +82,6 @@ check_lib_no_libs() {
LIBS=$ac_check_lib_save_LIBS
}
-# check kernel headers path
-uname="$(uname -r)"
-if test -d "/lib/modules/$uname/source" -o -L "/lib/modules/$uname/source"; then
- DEFAULT_KERNEL_DIR="/lib/modules/$uname/source"
-elif test -d "/lib/modules/$uname/build" -o -L "/lib/modules/$uname -r/build"; then
- DEFAULT_KERNEL_DIR="/lib/modules/$uname/build"
-else
- DEFAULT_KERNEL_DIR="/usr/src/linux"
-fi
-
# local options
AC_ARG_ENABLE([debug],
[ --enable-debug enable debug build. ],
@@ -113,13 +103,6 @@ AC_ARG_WITH([sysloglevel],
[ SYSLOGLEVEL="$withval" ],
[ SYSLOGLEVEL="LOG_INFO" ])
-AC_ARG_WITH([kernel],
- [ --with-kernel=path path to kernel source. ],
- [ KERNEL_DIR="$withval" ],
- [ KERNEL_DIR="$DEFAULT_KERNEL_DIR" ])
-
-KERNEL_CPPFLAGS="-I$KERNEL_DIR/include"
-
# gfs_controld isn't required in the latest versions of cluster
AM_CONDITIONAL([BUILD_GFS_CONTROLD], [test "x$enable_gfs_controld" = "xyes"])
AS_IF([test "x$enable_gfs_controld" = "xyes"], [
@@ -151,27 +134,15 @@ check_lib_no_libs pthread pthread_mutex_lock
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h mntent.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h])
-BACKUP_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$KERNEL_CPPFLAGS"
-
-# check kernel headers
-# 2.6.26 adds dlm_plock.h that's our checking barrier, instead
-# of implementing some insane kernel version checks
-AC_CHECK_HEADERS([linux/dlmconstants.h linux/dlm_plock.h linux/kdev_t.h linux/limits.h linux/types.h],,
- [AC_MSG_ERROR([Unable to find required kernel headers.
-Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path
-configure option to point to the kernel source.])])
+AC_CHECK_HEADERS([linux/dlmconstants.h linux/limits.h linux/types.h linux/netlink.h linux/fs.h],,
+ [AC_MSG_ERROR([Unable to find all required kernel headers.])])
AC_CHECK_HEADERS([linux/gfs2_ondisk.h],
[AC_CHECK_MEMBERS([struct gfs2_sb.sb_uuid],,
[AC_MSG_ERROR([Unable to find gfs2 uuid support in your headers.
Please update your kernel headers to a more recent version])],
[#include <linux/gfs2_ondisk.h>])],
- [AC_MSG_ERROR([Unable to find required kernel headers.
-Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path
-configure option to point to the kernel source.])])
-
-CPPFLAGS="$BACKUP_CPPFLAGS"
+ [AC_MSG_ERROR([Unable to find required kernel headers.])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
@@ -200,7 +171,6 @@ AC_CHECK_FUNCS([ftruncate gettimeofday memset realpath rmdir select setlocale so
LOGDIR=${localstatedir}/log/cluster
CLUSTERVARRUN=${localstatedir}/run/cluster
-CLUSTERVARLIB=${localstatedir}/lib/cluster
## do subst
@@ -212,8 +182,6 @@ AC_SUBST([CLUSTERVARRUN])
AC_DEFINE_UNQUOTED([CLUSTERVARRUN], "$(eval echo ${CLUSTERVARRUN})",
[Default cluster var/run directory])
-AC_SUBST([CLUSTERVARLIB])
-
AC_DEFINE_UNQUOTED([SYSLOGFACILITY], $(eval echo ${SYSLOGFACILITY}),
[Default syslog facility])
@@ -273,7 +241,7 @@ done
CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
$EXTRA_WARNINGS $WERROR_CFLAGS"
-CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \
+CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make \
-I. $ENV_CPPFLAGS"
LDFLAGS="$ENV_LDFLAGS"
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index c2eb245..9efddcd 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -15,7 +15,6 @@
#include <linux/types.h>
#include <sys/file.h>
#include <dirent.h>
-#include <linux/kdev_t.h>
#include <sys/sysmacros.h>
#include <mntent.h>
#include <sys/time.h>
11 years, 6 months