Comments (8)
Even with ab7cd2f it does not work:
$ make Q= CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-O2"
echo " CC llmnr.c" && gcc -O2 -o llmnr.o -c llmnr.c
...
-D_FORTIFY_SOURCE=2 is still not used.
from llmnrd.
The problem seems to be the equal sign in -D_FORTIFY_SOURCE=2, e.g.
$ make Q= CPPFLAGS="-D_FORTIFY_SOURCE"
echo " CC llmnr.c" && gcc -W -Wall -O2 -D_FORTIFY_SOURCE -DVERSION_STRING=\"v0.2.1\" -DGIT_VERSION=\""(git id v0.2.1-6-gab7cd2fc9043)"\" -o llmnr.o -c llmnr.c
work fine. Try escaping the passed value accordingly.
from llmnrd.
Does not work
$ make Q= CPPFLAGS="-D_FORTIFY_SOURCE" CFLAGS="-O2"
echo " CC llmnr.c" && gcc -O2 -o llmnr.o -c llmnr.c
Problems looks like that your Makefile pass CPPFLAGS into CFLAGS, so if CFLAGS are specified outside of Makefile then CPPFLAGS are not used.
Another example via passing as envs to make:
$ Q= CPPFLAGS="-D_FORTIFY_SOURCE" CFLAGS="-g" make
echo " CC llmnr.c" && gcc -g -DVERSION_STRING=\"v0.2.1\" -DGIT_VERSION=\""(git id v0.2.1-6-gab7cd2f)"\" -o llmnr.o -c llmnr.c
CC llmnr.c
from llmnrd.
This is intended behavior at the moment, since we override CFLAGS - not append to it. This way, CPPFLAGS can no longer be used.
Would you expect CFLAGS specified on the command line to be appended?
from llmnrd.
It is common behavior that build script exports CPPFLAGS, CFLAGS and LDFLAGS env variables and run make. Lot of distributions are building packages in this way.
from llmnrd.
Yes, I see that. But do they commonly assume CFLAGS/CPPFLAGS/LDFLAGS override or append behaviour?
from llmnrd.
All those variables are independent. CFLAGS are "compiler" flag (e.g. -O2 or -g or -W-some-gcc-specific-flag); CPPFLAGS contains only defines (e.g. -DSOMETHING) and LDFLAGS are linker specific flags (e.g. -lm or -Wl,-some-ld-specific-flag). So Makefile should use all variables (in append mode) and not override one by another.
from llmnrd.
Commit 6281d3c should now fix it to behave as you expect. Thanks!
from llmnrd.
Related Issues (20)
- Empty AAAA response when ipv6 is not enabled HOT 1
- Debian packaging files HOT 1
- Add manpages
- llmnrd: consider starting as non-root by default in systemd service example HOT 3
- llmnrd: consider restricting daemon privilegies via systemd service directives HOT 1
- Add support for creating pidfile
- llmnrd daemon should not use busy waiting for packets
- Race condition since e3d021b HOT 2
- IPv6 part is not working HOT 15
- llmnr-query prints garbage characters HOT 1
- llmnrd: Detect hostname changes HOT 2
- Conflict resolution required? HOT 3
- Make a release? HOT 2
- bind to specific interface option requires root privileges HOT 2
- Respond to multiple names HOT 1
- Proper IPv6 support
- Add wsdd support HOT 2
- Ignore IPv6 addresses when IPv6 is not enabled
- Feature request: specify an exact interface to listen on
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llmnrd.