mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 13:38:01 +00:00
libuafs: Stop clobbering CFLAGS
Currently, in the libuafs MakefileProto for every platform, CFLAGS is set to a bunch of flags, ignoring any CFLAGS set by the 'make' command-line provided by the user. Since most of the rest of the tree honors CFLAGS, it is confusing and can cause errors when src/libuafs ignore the user-set CFLAGS. One example of this breaking the build is when building RHEL RPMs for certain sub-architectures of the current machine. If you try to 'rpmbuild --target=i686' on 32-bit x86 RHEL 5, we will build with -march=i686 in the CFLAGS, which will be used to build most objects and is used in our configure tests. As a result, our configure tests will say that gcc atomic intrinsics are available. But when we go to build libuafs objects, we will not have -march=i686 in our CFLAGS, which causes (on RHEL 5) gcc to default to building for i386, which does not have gcc atomic intrinsics available. This causes build errors like this: libuafs.a(rx.o): In function `rx_atomic_test_and_clear_bit': [...]/BUILD/openafs-1.8.0/src/rx/rx_atomic.h:462: undefined reference to `__sync_fetch_and_and_4' To fix this, change the libuafs MakefileProtos to not set CFLAGS directly; instead, set them in a new variable UAFS_CFLAGS. Makefile.common then pulls those flags into MODULE_CFLAGS, which is used in our *_CCRULE build rules. While we are here, also move the common set of CFLAGS set by each platform's MakefileProto into Makefile.common. Now, each MakefileProto only needs to set CFLAGS that are specific to that platform, which ends up being very few (since most platforms were using the exact same set of CFLAGS). Relevant issue identified and analyzed by mbarbosa@sinenomine.net. Reviewed-on: https://gerrit.openafs.org/13262 Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> (cherry picked from commit ee66819a0c1a9efa98b76a1c18af6233bda1e233) Change-Id: Ia38d4701aeb4f690b12a6ffdbb42b8ec8c499486 Reviewed-on: https://gerrit.openafs.org/13544 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
63a1ee4e23
commit
e93dfb1ad9
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
# Each MakefileProto includes Makefile.config, so we should only need
|
# Each MakefileProto includes Makefile.config, so we should only need
|
||||||
# minor tweaks here.
|
# minor tweaks here.
|
||||||
MODULE_CFLAGS=-DKERNEL
|
MODULE_CFLAGS=${UAFS_CFLAGS} -DKERNEL -I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
||||||
|
|
||||||
LT_objs = \
|
LT_objs = \
|
||||||
afs_atomlist.lo \
|
afs_atomlist.lo \
|
||||||
@ -216,7 +216,7 @@ ${TOP_LIBDIR}/perl/AFS/ukernel.pm: setup_perllib PERLUAFS/ukernel.pm
|
|||||||
LIBUAFS_BUILD_PERL: ${TOP_LIBDIR}/perl/ukernel.so ${TOP_LIBDIR}/perl/AFS/ukernel.pm
|
LIBUAFS_BUILD_PERL: ${TOP_LIBDIR}/perl/ukernel.so ${TOP_LIBDIR}/perl/AFS/ukernel.pm
|
||||||
|
|
||||||
linktest: libuafs.a
|
linktest: libuafs.a
|
||||||
$(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) \
|
$(CC) $(CFLAGS) $(TEST_CFLAGS) $(TEST_LDFLAGS) \
|
||||||
$(LDFLAGS_roken) $(LDFLAGS_hcrypto) -o linktest \
|
$(LDFLAGS_roken) $(LDFLAGS_hcrypto) -o linktest \
|
||||||
${srcdir}/linktest.c $(MODULE_INCLUDE) -DUKERNEL \
|
${srcdir}/linktest.c $(MODULE_INCLUDE) -DUKERNEL \
|
||||||
libuafs.a ${TOP_LIBDIR}/libcmd.a \
|
libuafs.a ${TOP_LIBDIR}/libcmd.a \
|
||||||
|
@ -16,7 +16,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
|
|
||||||
# System specific build commands and flags
|
# System specific build commands and flags
|
||||||
DEFINES= -DKERNEL -DUKERNEL
|
DEFINES= -DKERNEL -DUKERNEL
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
AR = /usr/bin/ar
|
AR = /usr/bin/ar
|
||||||
ARFLAGS = -r
|
ARFLAGS = -r
|
||||||
RANLIB = /bin/ranlib
|
RANLIB = /bin/ranlib
|
||||||
|
@ -16,7 +16,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
# System specific build commands and flags
|
# System specific build commands and flags
|
||||||
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
||||||
KOPTS=
|
KOPTS=
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS) $(ARCHFLAGS)
|
UAFS_CFLAGS=$(ARCHFLAGS)
|
||||||
|
|
||||||
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV $(XCFLAGS) $(ARCHFLAGS)
|
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV $(XCFLAGS) $(ARCHFLAGS)
|
||||||
TEST_LDFLAGS=$(XLDFLAGS) $(ARCHFLAGS)
|
TEST_LDFLAGS=$(XLDFLAGS) $(ARCHFLAGS)
|
||||||
|
@ -16,7 +16,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
CC = @CC@
|
CC = @CC@
|
||||||
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
||||||
KOPTS=
|
KOPTS=
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_DFFBSD_ENV $(XCFLAGS)
|
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_DFFBSD_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=
|
TEST_LDFLAGS=
|
||||||
|
@ -17,7 +17,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
CC = @CC@
|
CC = @CC@
|
||||||
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
||||||
KOPTS=
|
KOPTS=
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_FBSD50_ENV $(XCFLAGS)
|
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_FBSD50_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=
|
TEST_LDFLAGS=
|
||||||
|
@ -19,9 +19,6 @@ DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
|||||||
KOPTS=-Wp,-H200000 -Wl,-a,archive +DA1.0 +z
|
KOPTS=-Wp,-H200000 -Wl,-a,archive +DA1.0 +z
|
||||||
<ia64_hpux1122 ia64_hpux1123>
|
<ia64_hpux1122 ia64_hpux1123>
|
||||||
KOPTS=-Wp,-H200000 -Wl,-a,archive_shared
|
KOPTS=-Wp,-H200000 -Wl,-a,archive_shared
|
||||||
<all>
|
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
<hp_ux102 hp_ux110 hp_ux11i>
|
<hp_ux102 hp_ux110 hp_ux11i>
|
||||||
TEST_CFLAGS= -Wp,-H200000 +DA1.0 +z -D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV -Dhpux -DAFS_HPUX_ENV $(XCFLAGS)
|
TEST_CFLAGS= -Wp,-H200000 +DA1.0 +z -D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV -Dhpux -DAFS_HPUX_ENV $(XCFLAGS)
|
||||||
<ia64_hpux1122 ia64_hpux1123>
|
<ia64_hpux1122 ia64_hpux1123>
|
||||||
|
@ -15,7 +15,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
# System specific build commands and flags
|
# System specific build commands and flags
|
||||||
CC = cc
|
CC = cc
|
||||||
DEFINES=-D_SGI_MP_SOURCE -DKERNEL -DUKERNEL
|
DEFINES=-D_SGI_MP_SOURCE -DKERNEL -DUKERNEL
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS=-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV -Dirix -DAFS_SGI_ENV $(XCFLAGS)
|
TEST_CFLAGS=-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV -Dirix -DAFS_SGI_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=-ignore_minor
|
TEST_LDFLAGS=-ignore_minor
|
||||||
|
@ -19,11 +19,8 @@ DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
|||||||
KOPTS=
|
KOPTS=
|
||||||
SYS_NAME=@AFS_SYSNAME@
|
SYS_NAME=@AFS_SYSNAME@
|
||||||
ifeq (${SYS_NAME}, ppc64_linux26)
|
ifeq (${SYS_NAME}, ppc64_linux26)
|
||||||
CFLAGS=-fPIC
|
UAFS_CFLAGS=-fPIC
|
||||||
else
|
|
||||||
CFLAGS=
|
|
||||||
endif
|
endif
|
||||||
CFLAGS+= -I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS=-pthread -D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_LINUX22_ENV $(XCFLAGS)
|
TEST_CFLAGS=-pthread -D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_LINUX22_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=
|
TEST_LDFLAGS=
|
||||||
|
@ -17,7 +17,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
DEFINES= -DKERNEL -DUKERNEL
|
DEFINES= -DKERNEL -DUKERNEL
|
||||||
KOPTS=
|
KOPTS=
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS= -DAFS_NBSD_ENV $(XCFLAGS)
|
TEST_CFLAGS= -DAFS_NBSD_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=
|
TEST_LDFLAGS=
|
||||||
|
@ -17,7 +17,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
DEFINES= -DKERNEL -DUKERNEL
|
DEFINES= -DKERNEL -DUKERNEL
|
||||||
KOPTS=
|
KOPTS=
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS= -DAFS_OBSD_ENV $(XCFLAGS)
|
TEST_CFLAGS= -DAFS_OBSD_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=
|
TEST_LDFLAGS=
|
||||||
|
@ -14,7 +14,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||||||
|
|
||||||
# System specific build commands and flags
|
# System specific build commands and flags
|
||||||
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
DEFINES= -D_REENTRANT -DKERNEL -DUKERNEL
|
||||||
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)
|
|
||||||
|
|
||||||
TEST_CFLAGS=-mt -DAFS_PTHREAD_ENV -Dsolaris -DAFS_SUN5_ENV $(XCFLAGS)
|
TEST_CFLAGS=-mt -DAFS_PTHREAD_ENV -Dsolaris -DAFS_SUN5_ENV $(XCFLAGS)
|
||||||
TEST_LDFLAGS=
|
TEST_LDFLAGS=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user