* Re: [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it possible to pass additional CFLAGS when invoking make
@ 2012-11-14 15:43 Moore, Robert
0 siblings, 0 replies; 4+ messages in thread
From: Moore, Robert @ 2012-11-14 15:43 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]
We have to think about _FORTIFY_SOURCE a bit more because we have had problems on some hosts with the -O2 flag.
Bob
> -----Original Message-----
> From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf
> Of Thomas Renninger
> Sent: Wednesday, November 14, 2012 6:52 AM
> To: devel(a)acpica.org
> Subject: [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it possible to
> pass additional CFLAGS when invoking make
>
> acpcia: Make it possible to pass additional CFLAGS when invoking make
>
> -D_FORTIFY_SOURCE=2 without -O2 can cause:
> --
> /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires
> compiling with optimization (-O) [-Werror=cpp]
> --
> Such compiler flags must be able to get passed when invoking make.
> OpenSUSE packages require to build binaries with CLFAGS="$RPM_OPT_FLAGS",
> to make sure debuginfo can be obtained, security/optimization/test flags
> of the compiler for the distribution built against are passed, etc.
>
> This patch differs between:
> 1) Optional CFLAGS (OPT_CFLAGS) which have a sane default:
> -D_FORTIFY_SOURCE=2 -O2 and warning flags
> These will get replaced if OPT_CFLAGS= are passed via
> make OPT_CFLAGS=".." invokation
> 2) Elementary CFLAGS (-I includes, -Dxy, ...) which are
> mandatory for a successful compile run
>
> Signed-off-by: Thomas Renninger <trenn(a)suse.de>
> CC: arjan(a)linux.intel.com
> ---
> generate/unix/Makefile.config | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: acpica-unix2-20120913/generate/unix/Makefile.config
> ===================================================================
> --- acpica-unix2-20120913.orig/generate/unix/Makefile.config
> +++ acpica-unix2-20120913/generate/unix/Makefile.config
> @@ -38,7 +38,7 @@ CC = gcc
> OBJDIR = obj$(BITS)
> BINDIR = bin$(BITS)
> BITSFLAG = -m$(BITS)
> -COMPILEOBJ = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
> +COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $<
> LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
> INSTALLDIR = /usr/bin
> INSTALLPROG = install -D ../$(BINDIR)/$(PROG)
> $(DESTDIR)$(INSTALLDIR)/$(PROG) @@ -103,11 +103,15 @@ ACPICA_HEADERS = \
> # Common compiler flags. The warning flags in addition to -Wall are not #
> automatically included in -Wall.
> #
> +OPT_CFLAGS ?= \
> + -D_FORTIFY_SOURCE=2 -O2 \
> + $(CWARNINGFLAGS)
> +
> CFLAGS += \
> + $(OPT_CFLAGS) \
> $(BITSFLAG) \
> -D$(HOST) \
> -D_GNU_SOURCE \
> - -D_FORTIFY_SOURCE=2 \
> -I$(ACPICA_INCLUDE)
>
> LDFLAGS += $(BITSFLAG)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it possible to pass additional CFLAGS when invoking make
@ 2012-11-14 17:47 Moore, Robert
0 siblings, 0 replies; 4+ messages in thread
From: Moore, Robert @ 2012-11-14 17:47 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]
Yes, I understand. We are thinking about what the defaults should be.
However, of course we will add the ability to pass in flags.
Thanks,
Bob
> -----Original Message-----
> From: Thomas Renninger [mailto:trenn(a)suse.de]
> Sent: Wednesday, November 14, 2012 9:46 AM
> To: Moore, Robert
> Cc: devel(a)acpica.org
> Subject: Re: [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it
> possible to pass additional CFLAGS when invoking make
>
> On Wednesday, November 14, 2012 03:43:04 PM Moore, Robert wrote:
> > We have to think about _FORTIFY_SOURCE a bit more because we have had
> > problems on some hosts with the -O2 flag.
>
> But this is the whole point.
> Currently I cannot see a possibility to pass a compiler flag dynamically
> via make at all to give someone the chance to remove _FORTIFY_SOURCE or
> add/remove other compiler flags dynamically (without the need of modifying
> the Makefile itself).
>
> I do not care much about the default CFLAGS, but we need a possibility to
> pass optional flags dynamically.
>
> Thanks,
>
> Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it possible to pass additional CFLAGS when invoking make
@ 2012-11-14 17:46 Thomas Renninger
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Renninger @ 2012-11-14 17:46 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]
On Wednesday, November 14, 2012 03:43:04 PM Moore, Robert wrote:
> We have to think about _FORTIFY_SOURCE a bit more because we have had
> problems on some hosts with the -O2 flag.
But this is the whole point.
Currently I cannot see a possibility to pass a compiler flag dynamically
via make at all to give someone the chance to remove
_FORTIFY_SOURCE or add/remove other compiler flags dynamically
(without the need of modifying the Makefile itself).
I do not care much about the default CFLAGS, but we need a
possibility to pass optional flags dynamically.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it possible to pass additional CFLAGS when invoking make
@ 2012-11-14 14:52 Thomas Renninger
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Renninger @ 2012-11-14 14:52 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 2092 bytes --]
acpcia: Make it possible to pass additional CFLAGS when invoking make
-D_FORTIFY_SOURCE=2 without -O2 can cause:
--
/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires
compiling with optimization (-O) [-Werror=cpp]
--
Such compiler flags must be able to get passed when invoking make.
OpenSUSE packages require to build binaries with CLFAGS="$RPM_OPT_FLAGS",
to make sure debuginfo can be obtained, security/optimization/test flags of
the compiler for the distribution built against are passed, etc.
This patch differs between:
1) Optional CFLAGS (OPT_CFLAGS) which have a sane default:
-D_FORTIFY_SOURCE=2 -O2 and warning flags
These will get replaced if OPT_CFLAGS= are passed via
make OPT_CFLAGS=".." invokation
2) Elementary CFLAGS (-I includes, -Dxy, ...) which are
mandatory for a successful compile run
Signed-off-by: Thomas Renninger <trenn(a)suse.de>
CC: arjan(a)linux.intel.com
---
generate/unix/Makefile.config | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: acpica-unix2-20120913/generate/unix/Makefile.config
===================================================================
--- acpica-unix2-20120913.orig/generate/unix/Makefile.config
+++ acpica-unix2-20120913/generate/unix/Makefile.config
@@ -38,7 +38,7 @@ CC = gcc
OBJDIR = obj$(BITS)
BINDIR = bin$(BITS)
BITSFLAG = -m$(BITS)
-COMPILEOBJ = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
+COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $<
LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
INSTALLDIR = /usr/bin
INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
@@ -103,11 +103,15 @@ ACPICA_HEADERS = \
# Common compiler flags. The warning flags in addition to -Wall are not
# automatically included in -Wall.
#
+OPT_CFLAGS ?= \
+ -D_FORTIFY_SOURCE=2 -O2 \
+ $(CWARNINGFLAGS)
+
CFLAGS += \
+ $(OPT_CFLAGS) \
$(BITSFLAG) \
-D$(HOST) \
-D_GNU_SOURCE \
- -D_FORTIFY_SOURCE=2 \
-I$(ACPICA_INCLUDE)
LDFLAGS += $(BITSFLAG)
[-- Attachment #2: acpica_make_CFLAGS_overridable.ksh --]
[-- Type: text/plain, Size: 2032 bytes --]
acpcia: Make it possible to pass additional CFLAGS when invoking make
-D_FORTIFY_SOURCE=2 without -O2 can cause:
--
/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires
compiling with optimization (-O) [-Werror=cpp]
--
Such compiler flags must be able to get passed when invoking make.
OpenSUSE packages require to build binaries with CLFAGS="$RPM_OPT_FLAGS",
to make sure debuginfo can be obtained, security/optimization/test flags of
the compiler for the distribution built against are passed, etc.
This patch differs between:
1) Optional CFLAGS (OPT_CFLAGS) which have a sane default:
-D_FORTIFY_SOURCE=2 -O2 and warning flags
These will get replaced if OPT_CFLAGS= are passed via
make OPT_CFLAGS=".." invokation
2) Elementary CFLAGS (-I includes, -Dxy, ...) which are
mandatory for a successful compile run
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: arjan@linux.intel.com
---
generate/unix/Makefile.config | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: acpica-unix2-20120913/generate/unix/Makefile.config
===================================================================
--- acpica-unix2-20120913.orig/generate/unix/Makefile.config
+++ acpica-unix2-20120913/generate/unix/Makefile.config
@@ -38,7 +38,7 @@ CC = gcc
OBJDIR = obj$(BITS)
BINDIR = bin$(BITS)
BITSFLAG = -m$(BITS)
-COMPILEOBJ = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
+COMPILEOBJ = $(CC) -c $(CFLAGS) -o$@ $<
LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
INSTALLDIR = /usr/bin
INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
@@ -103,11 +103,15 @@ ACPICA_HEADERS = \
# Common compiler flags. The warning flags in addition to -Wall are not
# automatically included in -Wall.
#
+OPT_CFLAGS ?= \
+ -D_FORTIFY_SOURCE=2 -O2 \
+ $(CWARNINGFLAGS)
+
CFLAGS += \
+ $(OPT_CFLAGS) \
$(BITSFLAG) \
-D$(HOST) \
-D_GNU_SOURCE \
- -D_FORTIFY_SOURCE=2 \
-I$(ACPICA_INCLUDE)
LDFLAGS += $(BITSFLAG)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-14 17:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14 15:43 [Devel] [RESEND] [PATCH 1/2] acpica Makefile: Make it possible to pass additional CFLAGS when invoking make Moore, Robert
-- strict thread matches above, loose matches on Subject: below --
2012-11-14 17:47 Moore, Robert
2012-11-14 17:46 Thomas Renninger
2012-11-14 14:52 Thomas Renninger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.