FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 06-23-2012, 10:14 PM
Serge
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

2012/6/23 Adam Borowski wrote:

>> Correct me if I'm wrong, but IIRC the CPPFLAGS have nothing to do with C++.
>> They're for `cpp` tool which is "The C PreProcessor" (check `man cpp`).
>> So as far as I understand cmake (and every other build system) MUST ignore
>> the CPPFLAGS, right?
>
> They SHOULD include CPPFLAGS.

You mean that they should run `cpp` even if they don't need it?

Or you mean that they should run `gcc`/`g++` with CPPFLAGS?
If you do, then... How should they do that? I.e. if I specify:
CPPFLAGS="blablabla hehehe hohoho"
How should build system run gcc? Like that?
gcc blablabla hehehe hohoho -c test.o test.c
or like that?:
gcc -Wp,blablabla -Wp,hehehe -Wp,hohoho -c test.o test.c
or like that?:
gcc -Wp,blablabla,hehehe,hohoho -c test.o test.c
or like that?:
gcc -Wp,"blablabla hehehe hohoho" -c test.o test.c

It's not that obvious, after all.

>> Is there a bug somewhere causing CPPFLAGS to be used by g++? Is that
>> a typo on wiki? Or am I missing something?
>
> Both gcc and g++ preprocess the source first.

Ok, I'll put the question in other way. As _I_ understand the meaning of
CFLAGS, CXXFLAGS and CPPFLAGS it's actually very easy:
* CFLAGS go to gcc (or e.g. clang)
* CXXFLAGS go to g++ (or e.g. clang++)
* CPPFLAGS go to cpp (have no idea what would that be for clang/llvm)
That's all. And that's why I never used CPPFLAGS myself. If I'm wrong
(very probably) can you, please, correct me and point to some
documentation/standard/etc. explaining how CPPFLAGS should be used by
the build system?

Is there a standard common for all the build systems? Or some kind of
recommendation? Or it's just a coincidence that all the build systems
use same environment variable CFLAGS?

--
Serge


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAOVenErfO1WK1+md7ANhDbg+KJuwyMxu+0RZEpP=xQaW=QFeY g@mail.gmail.com
 
Old 06-23-2012, 10:27 PM
Russ Allbery
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

Serge <sergemdev@gmail.com> writes:

> Or you mean that they should run `gcc`/`g++` with CPPFLAGS?

Yes.

> If you do, then... How should they do that? I.e. if I specify:
> CPPFLAGS="blablabla hehehe hohoho"
> How should build system run gcc? Like that?
> gcc blablabla hehehe hohoho -c test.o test.c

Yes.

> Is there a standard common for all the build systems? Or some kind of
> recommendation? Or it's just a coincidence that all the build systems
> use same environment variable CFLAGS?

CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
believe was introduced by Autoconf, since Autoconf has historically wanted
to run tests that only use the preprocessor and not the compiler (for
checking header files, for example), at which point it needed some way of
distinguishing between the flags. GNU software and other software that
closely follows the Autoconf and Automake manuals uses a similar
separation, and it's important to follow that separation when passing
flags to configure to handle tests where just the preprocessor is run.
(If, for example, you put the -I flags in CFLAGS and not CPPFLAGS, you may
find that Autoconf probes won't find header files that are on non-standard
-I paths.)

Since the Autoconf/Automake variable naming is the closest we have to a de
facto standard (and is *extremely* widespread in free software), the
variable names for the dpkg build infrastructure followed the same
conventions.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87bok9vf44.fsf@windlord.stanford.edu">http://lists.debian.org/87bok9vf44.fsf@windlord.stanford.edu
 
Old 06-24-2012, 08:07 AM
Serge
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

2012/6/24 Russ Allbery wrote:

>> If you do, then... How should they do that? I.e. if I specify:
>> CPPFLAGS="blablabla hehehe hohoho"
>> How should build system run gcc? Like that?
>> gcc blablabla hehehe hohoho -c -o test.o test.c
>
> Yes.

Why? Just to have it autotools-compatible? If I was writing a custom
build system I would be thinking about using -Wp option, since that's
exactly why it's there for — to pass some options to the preprocessor
(or, being honest, I would ignore CPPFLAGS unless I use the preprocessor).

>> Is there a standard common for all the build systems? Or some kind of
>> recommendation? Or it's just a coincidence that all the build systems
>> use same environment variable CFLAGS?
>
> CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
> believe was introduced by Autoconf, since Autoconf has historically wanted
> to run tests that only use the preprocessor and not the compiler (for
> checking header files, for example), at which point it needed some way of
> distinguishing between the flags. GNU software and other software that
> closely follows the Autoconf and Automake manuals uses a similar
> separation, and it's important to follow that separation when passing
> flags to configure to handle tests where just the preprocessor is run.
> (If, for example, you put the -I flags in CFLAGS and not CPPFLAGS, you may
> find that Autoconf probes won't find header files that are on non-standard
> -I paths.)

You mean, `cpp` is (was?) used only for tests done by ./configure?
I was not thinking about that. Thank you for pointing that out. I just
checked a few random autotools-based programs, and indeed they use
$CPP variable (they actually use `gcc -E`, not `cpp` for it).

> Since the Autoconf/Automake variable naming is the closest we have to a
> de facto standard (and is *extremely* widespread in free software), the
> variable names for the dpkg build infrastructure followed the same
> conventions.

It depends on whether dpkg is trying to force standards or be compatible
with them.

It's bad there's no some common standard or RFC about that. Since CPPFLAGS
is used by ./configure only, and ./configure script is autotools-specific,
it makes CPPFLAGS autotools-specific as well, and there's no reason to
demand from other build systems to use it.

And cmake is not the only one. At least mplayer's Makefile ignores
CPPFLAGS (`make CPPFLAGS=-Isomedir` will work for autotools, but not
for mplayer). There may be others...

Another point is that the option we're talking about (-D_FORTIFY_SOURCE=2)
isn't actually a preprocessor option. Preprocessor option is some option,
that is supposed to affect preprocessor output. But both:
cpp test.c
cpp -D_FORTIFY_SOURCE=2 test.c
will produce exactly same output. While these:
gcc -c test.c
gcc -D_FORTIFY_SOURCE=2 -c test.c
will give different outputs. So despite it *looks* like a preprocessor
option (-D...), it's not used by preprocessor, it's a compiler option,
and belongs to CFLAGS/CXXFLAGS.

So the suggestion is:
if dpkg aims to be compatible with different build systems:
move -D_FORTIFY_SOURCE=2 from autotools-specific CPPFLAGS to commonly
used CFLAGS/CXXFLAGS where it belongs (since it's not a preprocessor
option). This will fix the problem with `cmake` not using preprocessor
and not checking for CPPFLAGS, make dpkg more compatible with existing
build systems, and make packaging easier with no workarounds.

Then we'll be able to remove a "cmake workaround" from the wiki page:
http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake

What do you think? Should this get filled as a bugreport?

PS: Bugs must be fixed, not documented, IMO.

PPS: crossposted to debian-dpkg

--
Serge


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAOVenEotnBYauasDUn_Uv_7441kRwhfw3nT=XM7s_gm4Bu0VC w@mail.gmail.com
 
Old 06-24-2012, 08:07 AM
Serge
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

2012/6/24 Russ Allbery wrote:

>> If you do, then... How should they do that? I.e. if I specify:
>> CPPFLAGS="blablabla hehehe hohoho"
>> How should build system run gcc? Like that?
>> gcc blablabla hehehe hohoho -c -o test.o test.c
>
> Yes.

Why? Just to have it autotools-compatible? If I was writing a custom
build system I would be thinking about using -Wp option, since that's
exactly why it's there for — to pass some options to the preprocessor
(or, being honest, I would ignore CPPFLAGS unless I use the preprocessor).

>> Is there a standard common for all the build systems? Or some kind of
>> recommendation? Or it's just a coincidence that all the build systems
>> use same environment variable CFLAGS?
>
> CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
> believe was introduced by Autoconf, since Autoconf has historically wanted
> to run tests that only use the preprocessor and not the compiler (for
> checking header files, for example), at which point it needed some way of
> distinguishing between the flags. GNU software and other software that
> closely follows the Autoconf and Automake manuals uses a similar
> separation, and it's important to follow that separation when passing
> flags to configure to handle tests where just the preprocessor is run.
> (If, for example, you put the -I flags in CFLAGS and not CPPFLAGS, you may
> find that Autoconf probes won't find header files that are on non-standard
> -I paths.)

You mean, `cpp` is (was?) used only for tests done by ./configure?
I was not thinking about that. Thank you for pointing that out. I just
checked a few random autotools-based programs, and indeed they use
$CPP variable (they actually use `gcc -E`, not `cpp` for it).

> Since the Autoconf/Automake variable naming is the closest we have to a
> de facto standard (and is *extremely* widespread in free software), the
> variable names for the dpkg build infrastructure followed the same
> conventions.

It depends on whether dpkg is trying to force standards or be compatible
with them.

It's bad there's no some common standard or RFC about that. Since CPPFLAGS
is used by ./configure only, and ./configure script is autotools-specific,
it makes CPPFLAGS autotools-specific as well, and there's no reason to
demand from other build systems to use it.

And cmake is not the only one. At least mplayer's Makefile ignores
CPPFLAGS (`make CPPFLAGS=-Isomedir` will work for autotools, but not
for mplayer). There may be others...

Another point is that the option we're talking about (-D_FORTIFY_SOURCE=2)
isn't actually a preprocessor option. Preprocessor option is some option,
that is supposed to affect preprocessor output. But both:
cpp test.c
cpp -D_FORTIFY_SOURCE=2 test.c
will produce exactly same output. While these:
gcc -c test.c
gcc -D_FORTIFY_SOURCE=2 -c test.c
will give different outputs. So despite it *looks* like a preprocessor
option (-D...), it's not used by preprocessor, it's a compiler option,
and belongs to CFLAGS/CXXFLAGS.

So the suggestion is:
if dpkg aims to be compatible with different build systems:
move -D_FORTIFY_SOURCE=2 from autotools-specific CPPFLAGS to commonly
used CFLAGS/CXXFLAGS where it belongs (since it's not a preprocessor
option). This will fix the problem with `cmake` not using preprocessor
and not checking for CPPFLAGS, make dpkg more compatible with existing
build systems, and make packaging easier with no workarounds.

Then we'll be able to remove a "cmake workaround" from the wiki page:
http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake

What do you think? Should this get filled as a bugreport?

PS: Bugs must be fixed, not documented, IMO.

PPS: crossposted to debian-dpkg

--
Serge


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAOVenEotnBYauasDUn_Uv_7441kRwhfw3nT=XM7s_gm4Bu0VC w@mail.gmail.com
 
Old 06-24-2012, 09:23 AM
Guillem Jover
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

On Sun, 2012-06-24 at 11:07:05 +0300, Serge wrote:
> 2012/6/24 Russ Allbery wrote:
> >> If you do, then... How should they do that? I.e. if I specify:
> >> CPPFLAGS="blablabla hehehe hohoho"
> >> How should build system run gcc? Like that?
> >> gcc blablabla hehehe hohoho -c -o test.o test.c
> >
> > Yes.
>
> Why? Just to have it autotools-compatible? If I was writing a custom
> build system I would be thinking about using -Wp option, since that's
> exactly why it's there for — to pass some options to the preprocessor
> (or, being honest, I would ignore CPPFLAGS unless I use the preprocessor).

That would be wrong as -Wp bypassed the compiler driver. And when
calling gcc you are implicitly using the preprocessor anyway. How you
directly call gcc (or cc for that matter) does not have anything to do
with autotools, the latter only standardizes a way to pass flags to
those calls though, and the compiler is suppoed to be called in the
way Russ pointed out.

> >> Is there a standard common for all the build systems? Or some kind of
> >> recommendation? Or it's just a coincidence that all the build systems
> >> use same environment variable CFLAGS?
> >
> > CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
> > believe was introduced by Autoconf, since Autoconf has historically wanted
> > to run tests that only use the preprocessor and not the compiler (for
> > checking header files, for example), at which point it needed some way of
> > distinguishing between the flags. GNU software and other software that
> > closely follows the Autoconf and Automake manuals uses a similar
> > separation, and it's important to follow that separation when passing
> > flags to configure to handle tests where just the preprocessor is run.
> > (If, for example, you put the -I flags in CFLAGS and not CPPFLAGS, you may
> > find that Autoconf probes won't find header files that are on non-standard
> > -I paths.)
>
> You mean, `cpp` is (was?) used only for tests done by ./configure?
> I was not thinking about that. Thank you for pointing that out. I just
> checked a few random autotools-based programs, and indeed they use
> $CPP variable (they actually use `gcc -E`, not `cpp` for it).

The fact that it's called cpp or «gcc -E» should not matter and it's an
implementation detail, both should be performing the same task. If you
need to test for some preprocessed stuff, then there's no point in
compiling anything, instead just preprocessing should be enough.

> > Since the Autoconf/Automake variable naming is the closest we have to a
> > de facto standard (and is *extremely* widespread in free software), the
> > variable names for the dpkg build infrastructure followed the same
> > conventions.

> It depends on whether dpkg is trying to force standards or be compatible
> with them.
>
> It's bad there's no some common standard or RFC about that. Since CPPFLAGS
> is used by ./configure only, and ./configure script is autotools-specific,
> it makes CPPFLAGS autotools-specific as well, and there's no reason to
> demand from other build systems to use it.

> And cmake is not the only one. At least mplayer's Makefile ignores
> CPPFLAGS (`make CPPFLAGS=-Isomedir` will work for autotools, but not
> for mplayer). There may be others...

No one forces you to pass CPPFLAGS to the build system, or for those
build systems to support it, you can always do something like:

make CFLAGS="$(CPPFLAGS) $(CFLAGS)"

for example, but having to split CPPFLAGS after the fact for build
systems that do support it would be extremely annoying.

> Another point is that the option we're talking about (-D_FORTIFY_SOURCE=2)
> isn't actually a preprocessor option. Preprocessor option is some option,
> that is supposed to affect preprocessor output. But both:
> cpp test.c
> cpp -D_FORTIFY_SOURCE=2 test.c
> will produce exactly same output. While these:
> gcc -c test.c
> gcc -D_FORTIFY_SOURCE=2 -c test.c
> will give different outputs. So despite it *looks* like a preprocessor
> option (-D...), it's not used by preprocessor, it's a compiler option,
> and belongs to CFLAGS/CXXFLAGS.

_FORTIFY_SOURCE *is* a preprocesssor macro, you just need to grep for
it in /user/include/, and just to make sure I just checked the gcc
sources and there's no relevant reference to that macro, which the
compiler driver could still be checking for as pointed out above (re
-Wp), so there's something else going on in your compiler call (maybe
implicit optimization settings, an alias, etc?). It also obviously
depends on the preprocessed input, try including <stdio.h> for
example and setting an optimization level > 0 in the preprocessor call.

> So the suggestion is:
> if dpkg aims to be compatible with different build systems:
> move -D_FORTIFY_SOURCE=2 from autotools-specific CPPFLAGS to commonly
> used CFLAGS/CXXFLAGS where it belongs (since it's not a preprocessor
> option). This will fix the problem with `cmake` not using preprocessor
> and not checking for CPPFLAGS, make dpkg more compatible with existing
> build systems, and make packaging easier with no workarounds.

No, as per above, and there's no workaround here, just different build
system conventions, and that's part of the job of the debian/rules
file, otherwise if all build systems used the same conventions we would
not need one at all.

> What do you think? Should this get filled as a bugreport?
>
> PS: Bugs must be fixed, not documented, IMO.

There's no bug here.

ragards,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120624092327.GA7030@gaara.hadrons.org">http://lists.debian.org/20120624092327.GA7030@gaara.hadrons.org
 
Old 06-24-2012, 09:23 AM
Guillem Jover
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

On Sun, 2012-06-24 at 11:07:05 +0300, Serge wrote:
> 2012/6/24 Russ Allbery wrote:
> >> If you do, then... How should they do that? I.e. if I specify:
> >> CPPFLAGS="blablabla hehehe hohoho"
> >> How should build system run gcc? Like that?
> >> gcc blablabla hehehe hohoho -c -o test.o test.c
> >
> > Yes.
>
> Why? Just to have it autotools-compatible? If I was writing a custom
> build system I would be thinking about using -Wp option, since that's
> exactly why it's there for — to pass some options to the preprocessor
> (or, being honest, I would ignore CPPFLAGS unless I use the preprocessor).

That would be wrong as -Wp bypassed the compiler driver. And when
calling gcc you are implicitly using the preprocessor anyway. How you
directly call gcc (or cc for that matter) does not have anything to do
with autotools, the latter only standardizes a way to pass flags to
those calls though, and the compiler is suppoed to be called in the
way Russ pointed out.

> >> Is there a standard common for all the build systems? Or some kind of
> >> recommendation? Or it's just a coincidence that all the build systems
> >> use same environment variable CFLAGS?
> >
> > CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
> > believe was introduced by Autoconf, since Autoconf has historically wanted
> > to run tests that only use the preprocessor and not the compiler (for
> > checking header files, for example), at which point it needed some way of
> > distinguishing between the flags. GNU software and other software that
> > closely follows the Autoconf and Automake manuals uses a similar
> > separation, and it's important to follow that separation when passing
> > flags to configure to handle tests where just the preprocessor is run.
> > (If, for example, you put the -I flags in CFLAGS and not CPPFLAGS, you may
> > find that Autoconf probes won't find header files that are on non-standard
> > -I paths.)
>
> You mean, `cpp` is (was?) used only for tests done by ./configure?
> I was not thinking about that. Thank you for pointing that out. I just
> checked a few random autotools-based programs, and indeed they use
> $CPP variable (they actually use `gcc -E`, not `cpp` for it).

The fact that it's called cpp or «gcc -E» should not matter and it's an
implementation detail, both should be performing the same task. If you
need to test for some preprocessed stuff, then there's no point in
compiling anything, instead just preprocessing should be enough.

> > Since the Autoconf/Automake variable naming is the closest we have to a
> > de facto standard (and is *extremely* widespread in free software), the
> > variable names for the dpkg build infrastructure followed the same
> > conventions.

> It depends on whether dpkg is trying to force standards or be compatible
> with them.
>
> It's bad there's no some common standard or RFC about that. Since CPPFLAGS
> is used by ./configure only, and ./configure script is autotools-specific,
> it makes CPPFLAGS autotools-specific as well, and there's no reason to
> demand from other build systems to use it.

> And cmake is not the only one. At least mplayer's Makefile ignores
> CPPFLAGS (`make CPPFLAGS=-Isomedir` will work for autotools, but not
> for mplayer). There may be others...

No one forces you to pass CPPFLAGS to the build system, or for those
build systems to support it, you can always do something like:

make CFLAGS="$(CPPFLAGS) $(CFLAGS)"

for example, but having to split CPPFLAGS after the fact for build
systems that do support it would be extremely annoying.

> Another point is that the option we're talking about (-D_FORTIFY_SOURCE=2)
> isn't actually a preprocessor option. Preprocessor option is some option,
> that is supposed to affect preprocessor output. But both:
> cpp test.c
> cpp -D_FORTIFY_SOURCE=2 test.c
> will produce exactly same output. While these:
> gcc -c test.c
> gcc -D_FORTIFY_SOURCE=2 -c test.c
> will give different outputs. So despite it *looks* like a preprocessor
> option (-D...), it's not used by preprocessor, it's a compiler option,
> and belongs to CFLAGS/CXXFLAGS.

_FORTIFY_SOURCE *is* a preprocesssor macro, you just need to grep for
it in /user/include/, and just to make sure I just checked the gcc
sources and there's no relevant reference to that macro, which the
compiler driver could still be checking for as pointed out above (re
-Wp), so there's something else going on in your compiler call (maybe
implicit optimization settings, an alias, etc?). It also obviously
depends on the preprocessed input, try including <stdio.h> for
example and setting an optimization level > 0 in the preprocessor call.

> So the suggestion is:
> if dpkg aims to be compatible with different build systems:
> move -D_FORTIFY_SOURCE=2 from autotools-specific CPPFLAGS to commonly
> used CFLAGS/CXXFLAGS where it belongs (since it's not a preprocessor
> option). This will fix the problem with `cmake` not using preprocessor
> and not checking for CPPFLAGS, make dpkg more compatible with existing
> build systems, and make packaging easier with no workarounds.

No, as per above, and there's no workaround here, just different build
system conventions, and that's part of the job of the debian/rules
file, otherwise if all build systems used the same conventions we would
not need one at all.

> What do you think? Should this get filled as a bugreport?
>
> PS: Bugs must be fixed, not documented, IMO.

There's no bug here.

ragards,
guillem


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120624092327.GA7030@gaara.hadrons.org">http://lists.debian.org/20120624092327.GA7030@gaara.hadrons.org
 
Old 06-24-2012, 10:29 AM
Lars Wirzenius
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

On Sat, Jun 23, 2012 at 03:27:07PM -0700, Russ Allbery wrote:
> CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
> believe was introduced by Autoconf

I don't know the history of CPPFLAGS. It's possible it was introduced by
Autoconf. However, it is now embedded into the implicit rules of GNU Make,
so every Makefile that doesn't override the rule for compiling a .c file
to a .o file uses CPPFLAGS.

--
I wrote a book on personal productivity: http://gtdfh.branchable.com/
 
Old 06-24-2012, 08:30 PM
"Bernhard R. Link"
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

* Lars Wirzenius <liw@liw.fi> [120624 12:30]:
> On Sat, Jun 23, 2012 at 03:27:07PM -0700, Russ Allbery wrote:
> > CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
> > believe was introduced by Autoconf
>
> I don't know the history of CPPFLAGS. It's possible it was introduced by
> Autoconf. However, it is now embedded into the implicit rules of GNU Make,
> so every Makefile that doesn't override the rule for compiling a .c file
> to a .o file uses CPPFLAGS.

Where "now" means since 1990.

Bernhard R. Link


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120624203026.GA8223@client.brlink.eu">http://lists.debian.org/20120624203026.GA8223@client.brlink.eu
 
Old 06-24-2012, 09:13 PM
Russ Allbery
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

"Bernhard R. Link" <brlink@debian.org> writes:
> * Lars Wirzenius <liw@liw.fi> [120624 12:30]:
>> On Sat, Jun 23, 2012 at 03:27:07PM -0700, Russ Allbery wrote:

>>> CFLAGS is an old, long-standing make thing. CPPFLAGS is newer and I
>>> believe was introduced by Autoconf

>> I don't know the history of CPPFLAGS. It's possible it was introduced by
>> Autoconf. However, it is now embedded into the implicit rules of GNU Make,
>> so every Makefile that doesn't override the rule for compiling a .c file
>> to a .o file uses CPPFLAGS.

> Where "now" means since 1990.

Yeah. I think CFLAGS may be another 10-15 years older, but I haven't done
the research. Anyway, this is the way that all Autoconf and Automake
software works, which gets quite a lot of free software, and while I'm not
sure whether any possible preprocessor flags we might want to add in the
future would affect cpp-only tests, I wouldn't want to rule it out.

When integrating with a build system that uses only one variable for
compilation flags, just pass the concatenation of CFLAGS and CPPFLAGS into
it. This is trivially done in debian/rules without modifying the upstream
source.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87txy0l8g5.fsf@windlord.stanford.edu">http://lists.debian.org/87txy0l8g5.fsf@windlord.stanford.edu
 
Old 06-25-2012, 08:33 AM
"Bernhard R. Link"
 
Default Lintian warning: hardening-no-fortify-functions & version numbering

* Russ Allbery <rra@debian.org> [120624 23:13]:
> When integrating with a build system that uses only one variable for
> compilation flags, just pass the concatenation of CFLAGS and CPPFLAGS into
> it. This is trivially done in debian/rules without modifying the upstream
> source.

Build systems not doing CPPFLAGS often also are incorrect in other
aspects. Like using CFLAGS where CXXFLAGS are meant. Or having a
differently named LDFLAGS. Or not having LDFLAGS at all and needing them
in a variable called CFLAGS, too. Or only passing LDFLAGS at link time so
needed CFLAGS or CXXFLAGS concatenated into LDFLAGS or or or.
It's all mostly trivially done but there are quite a number of variants.
Anything not having CPPFLAGS is usually simply so non-standard that
a human has to look at it anyway and no automatic approach will help.

Bernhard R. Link


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120625083304.GA3323@client.brlink.eu">http://lists.debian.org/20120625083304.GA3323@client.brlink.eu
 

Thread Tools




All times are GMT. The time now is 09:31 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org