] locktes/rpcgen: tweak how we override compiler settings
Subsystems (2)
PATCH 1/1 ] locktes/rpcgen: tweak how we override compiler settings
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>. Adding the build settings to the target-specific flags no longer works as a way to compile build-time tools.
Instead, clobber the global flags. This triggers an automake warning, but the end result actually works (unlike the existing code).
--- tools/locktest/Makefile.am | 7 +++---- tools/rpcgen/Makefile.am | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-)
tools/locktest/Makefile.am +3 -4
@@ -1,12 +1,11 @@ ## Process this file with automake to produce Makefile.in CC=$(CC_FOR_BUILD) -LIBTOOL = @LIBTOOL@ --tag=CC +CFLAGS=$(CFLAGS_FOR_BUILD) +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) +LDFLAGS=$(LDFLAGS_FOR_BUILD) noinst_PROGRAMS = testlk testlk_SOURCES = testlk.c -testlk_CFLAGS=$(CFLAGS_FOR_BUILD) -testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) -testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD) MAINTAINERCLEANFILES = Makefile.in
tools/rpcgen/Makefile.am +3 -4
@@ -1,7 +1,9 @@ ## Process this file with automake to produce Makefile.in CC=$(CC_FOR_BUILD) -LIBTOOL = @LIBTOOL@ --tag=CC +CFLAGS=$(CFLAGS_FOR_BUILD) +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) +LDFLAGS=$(LDFLAGS_FOR_BUILD) noinst_PROGRAMS = rpcgen rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
@@ -9,9 +11,6 @@ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \ rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \ rpc_scan.h rpc_util.h -rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD) -rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD) -rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD) rpcgen_LDADD=$(LIBTIRPC) MAINTAINERCLEANFILES = Makefile.in
Signature · 1 line
1.8.1.2
Hello,
Quoted 50 lines · Mike Frysinger
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>. Adding the build settings to the target-specific flags no longer works as a way to compile build-time tools.
Instead, clobber the global flags. This triggers an automake warning, but the end result actually works (unlike the existing code).
Signed-off-by Mike Frysinger <[email protected]>--- tools/locktest/Makefile.am | 7 +++---- tools/rpcgen/Makefile.am | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-)tools/locktest/Makefile.am +3
-4@@ -1,12 +1,11 @@ ## Process this file with automake to produce Makefile.in CC=$(CC_FOR_BUILD) -LIBTOOL = @LIBTOOL@ --tag=CC +CFLAGS=$(CFLAGS_FOR_BUILD) +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) +LDFLAGS=$(LDFLAGS_FOR_BUILD) noinst_PROGRAMS = testlk testlk_SOURCES = testlk.c -testlk_CFLAGS=$(CFLAGS_FOR_BUILD) -testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) -testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD) MAINTAINERCLEANFILES = Makefile.intools/rpcgen/Makefile.am +3
-1@@ -1,7 +1,9 @@ ## Process this file with automake to produce Makefile.in CC=$(CC_FOR_BUILD) -LIBTOOL = @LIBTOOL@ --tag=CC +CFLAGS=$(CFLAGS_FOR_BUILD) +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) +LDFLAGS=$(LDFLAGS_FOR_BUILD) noinst_PROGRAMS = rpcgen rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
tools/rpcgen/Makefile.am rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
Quoted 10 lines
tools/rpcgen/Makefile.am +0
-4@@ -9,9 +11,6 @@ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \ rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \ rpc_scan.h rpc_util.h -rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD) -rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD) -rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD) rpcgen_LDADD=$(LIBTIRPC) MAINTAINERCLEANFILES = Makefile.in -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
This patch is causing the following warnings:
tools/locktest/Makefile.am:4: warning: 'CFLAGS' is a user variable, you should not override it; tools/locktest/Makefile.am:4: use 'AM_CFLAGS' instead tools/locktest/Makefile.am:5: warning: 'CPPFLAGS' is a user variable, you should not override it; tools/locktest/Makefile.am:5: use 'AM_CPPFLAGS' instead tools/locktest/Makefile.am:6: warning: 'LDFLAGS' is a user variable, you should not override it; tools/locktest/Makefile.am:6: use 'AM_LDFLAGS' instead tools/rpcgen/Makefile.am:4: warning: 'CFLAGS' is a user variable, you should not override it; tools/rpcgen/Makefile.am:4: use 'AM_CFLAGS' insteadtools/rpcgen/Makefile.am:5: warning: 'CPPFLAGS' is a user variable, you should not override it; tools/rpcgen/Makefile.am:5: use 'AM_CPPFLAGS' insteadtools/rpcgen/Makefile.am:6: warning: 'LDFLAGS' is a user variable, you should not override it; tools/rpcgen/Makefile.am:6: use 'AM_LDFLAGS' instead
You didn't see these in your testing?
Also what exactly broke that this patch fixes?
steved.
Quoted 11 lines · On Monday 25 March 2013 08:42:32 Steve Dickson wrote:
Quoted 6 lines · Mike Frysinger
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>. Adding the build settings to the target-specific flags no longer works as a way to compile build-time tools.
Instead, clobber the global flags. This triggers an automake warning, but the end result actually works (unlike the existing code).
This patch is causing the following warnings:
...
You didn't see these in your testing?
in my summary:
Instead, clobber the global flags. This triggers an automake warning, but the end result actually works (unlike the existing code).
Quoted 1 line
Also what exactly broke that this patch fixes?
also in my summary:
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>.
so when you cross-compile (e.g. --build=x86_64-linux-gnu --host=arm-linux- gnu), and you set CFLAGS to include settings which are valid only for the host (e.g. -mfloat-abi=hard -mfp=neon), those flags will also get passed to the build compiler when compiling these tools and they'll error out (because the build gcc doesn't recognize these flags).
-mike
Quoted 9 lines · Mike Frysinger
Quoted 8 lines · On Monday 25 March 2013 08:42:32 Steve Dickson wrote:
Quoted 6 lines · Mike Frysinger
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>. Adding the build settings to the target-specific flags no longer works as a way to compile build-time tools.
Instead, clobber the global flags. This triggers an automake warning, but the end result actually works (unlike the existing code).
Quoted 8 lines
Quoted 3 lines
This patch is causing the following warnings:
...
You didn't see these in your testing?in my summary:
Instead, clobber the global flags. This triggers an automake warning, but the end result actually works (unlike the existing code).
Ok... I did miss that part of the summary...
Quoted 5 lines
Quoted 2 lines
Also what exactly broke that this patch fixes?
also in my summary:
Quoted 8 lines
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>.
so when you cross-compile (e.g. --build=x86_64-linux-gnu --host=arm-linux- gnu), and you set CFLAGS to include settings which are valid only for the host (e.g. -mfloat-abi=hard -mfp=neon), those flags will also get passed to the build compiler when compiling these tools and they'll error out (because the build gcc doesn't recognize these flags).
And setting AM_CFLAGS does on take care of this problem...
I'm just trying to get rid of those warnings...
steved.
Quoted 15 lines · On Monday 25 March 2013 12:51:07 Steve Dickson wrote:
Quoted 7 lines · Mike Frysinger
Quoted 1 line · On Monday 25 March 2013 08:42:32 Steve Dickson wrote:
Also what exactly broke that this patch fixes?
also in my summary:
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling the <target>.Quoted 6 lines
so when you cross-compile (e.g. --build=x86_64-linux-gnu --host=arm-linux- gnu), and you set CFLAGS to include settings which are valid only for the host (e.g. -mfloat-abi=hard -mfp=neon), those flags will also get passed to the build compiler when compiling these tools and they'll error out (because the build gcc doesn't recognize these flags).
Quoted 3 lines
And setting
AM_CFLAGSdoes on take care of this problem...I'm just trying to get rid of those warnings...
yeah, i don't know how to make it work w/out triggering the warnings :(. AM_CFLAGS is appended to CFLAGS rather than clobber it.
the concept of having build time tools is a bit foreign to automake atm, so we have to open code this stuff :/.
-mike