Skip to contentSkip to conversation

makedumpfile: honor the CFLAGS from environment variables

PATCH In review Kairui Song 2 participants 2 messages Jan 29, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 makedumpfile: honor the CFLAGS from environment variables

This makes it possible to pass in extra cflags, for example, hardening flags could be passed in with environment variable when building a hardened package.

Also introduce a CFLAGS_BASE to hold common CFLAGS, which simplify the CFLAGS definition.

---
Update from V1:
- Use a CFLAGS_BASE to simplify CFLAGS definition
- Use immediate set rather than lazy set to avoid unexpected flag duplication

 Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Makefile +4 -5
index 612b9d0..bca9984 100644
@@ -8,11 +8,10 @@ ifeq ($(strip $CC),)
 CC	= gcc
 endif
 
-CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-	  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-	  -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
-CFLAGS_ARCH	= -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-		    -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
+                -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS      := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
+CFLAGS_ARCH := $(CFLAGS_BASE)
 # LDFLAGS = -L/usr/local/lib -I/usr/local/include
 
 HOST_ARCH := $(shell uname -m)
Signature · 7 lines
2.20.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 39 lines · Kairui Song

This makes it possible to pass in extra cflags, for example, hardening flags could be passed in with environment variable when building a hardened package.

Also introduce a CFLAGS_BASE to hold common CFLAGS, which simplify the CFLAGS definition.

---
Update from V1:
- Use a CFLAGS_BASE to simplify CFLAGS definition
- Use immediate set rather than lazy set to avoid unexpected flag duplication

 Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Makefile +4 -6
index 612b9d0..bca9984 100644
@@ -8,11 +8,10 @@ ifeq ($(strip $CC),)
 CC	= gcc
 endif
 
-CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-	  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-	  -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
-CFLAGS_ARCH	= -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-		    -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
+                -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS      := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
+CFLAGS_ARCH := $(CFLAGS_BASE)
 # LDFLAGS = -L/usr/local/lib -I/usr/local/include
 
 HOST_ARCH := $(shell uname -m)
--
Quoted 2 lines

2.20.1

Thank you Kairui, applied.

Kazu

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec