Closed stapelberg closed 3 years ago
I feel like this should be sent as an issue upstream to debian rather than tacking on a flag that isn't meant for the language.
There are certain flags for CPP that aren't compatible with C. I believe that is the issue i was running into on conda-forge. I am happy to double check in a few hours.
Fortify source is optional and debian decided not to include it in their standard C flags. In the build system you should be At liberty to add it. I wouldn't include unrelated build flags just for it.
It sounds like you think that CPPFLAGS is for C++ (C Plus Plus, CPP).
However, C++’s flag is called CXXFLAGS. The variable CPPFLAGS is for the C Pre Processor (hence CPP) and is meant for the C programming language.
In fact, make’s default rules include CPPFLAGS: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
Thanks for taking a look at what originally broke. I’m curious what the actual issue is.
Thank you for the clear explanation
Following up. It seems that the latest commit version (which includes this patch) is compiling fine on Linux Aarch64 (and now linux 64bit x86) on conda-forge's build system.
I likely removed it in my review of the build flags (for which I opened #52 #59) and I simply misunderstood what CPPFLAGS meant.
Following up. It seems that the latest commit version (which includes this patch) is compiling fine on Linux Aarch64 (and now linux 64bit x86) on conda-forge's build system.
Thanks for checking!
I’m glad to hear that everything is working as it should now, and we can keep CPPFLAGS as it is now :)
This pull request reverts PaulStoffregen/teensy_loader_cli#50, which I have noticed just now.
Support for CPPFLAGS was originally added by me in https://github.com/PaulStoffregen/teensy_loader_cli/pull/39, and then removed by @hmaarrfk’s PaulStoffregen/teensy_loader_cli#50 with the description “no need for CPP flags on linux”.
However, that was incorrect. There is a need for CPPFLAGS on Linux, specifically for example for Debian packaging, which passes additional hardening flags, as my original https://github.com/PaulStoffregen/teensy_loader_cli/pull/39 mentioned.
I verified this just now.
With CPPFLAGS, the build output is:
Without CPPFLAGS, the build output is:
Note that
-D_FORTIFY_SOURCE=2
is missing when CPPFLAGS is not specified.