By default, CMake assumes that the project is using both C and C++. By
explicitly passing 'C' as argument of the project() macro, we tell
CMake that only C is used, which prevents CMake from checking if a C++
compiler exists.
Patch applied to buildroot since 2014:
https://git.buildroot.net/buildroot/commit/package/ympd?id=40aa523af26963321443a2d96c64ce128577ca77
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
- removed /usr/sbin/daemon's option "-t" (first appeared in FreeBSD 11, leading to an error in previous versions; since the [t]itle defaults to the daemonized invocation anyways, this shouldn't make a difference for FreeBSD 11+)
- removed /usr/sbin/daemon's option "-u" and the respective variable in the script (ympd has to be started as root to be able to bind to port 80)
- allow for additional arguments via ympd_flags="" in rc.conf (which would again allow to drop privileges after binding to the port)
Preserve user/system-configured C_FLAGS.
This broke the rpm package build on fedora: They enable a hardened config (i.e. ASLR) by default, which adds -pie and -fPIC to linker and compiler flags. Overwriting C_FLAGS removed the compiler spec, but not the linker one, leading to an error like:
/bin/cc -std=gnu99 -Wall -ggdb -pedantic -specs=/usr/lib/rpm/redhat/redhat-hardened-ld CMakeFiles/mkdata.dir/tools/mkdata.c.o -o mkdata -rdynamic
bin/ld: CMakeFiles/mkdata.dir/tools/mkdata.c.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
CMakeFiles/mkdata.dir/tools/mkdata.c.o: error adding symbols: Bad value
With this fix, the error is gone:
/bin/cc -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -std=gnu99 -Wall -g -ggdb -pedantic -specs=/usr/lib/rpm/redhat/redhat-hardened-ld CMakeFiles/mkdata.dir/tools/mkdata.c.o -o mkdata -rdynamic