[openwrt/openwrt] build: let HOST_CXXFLAGS default to HOST_CFLAGS
LEDE Commits
lede-commits at lists.infradead.org
Sun Jul 7 23:49:50 PDT 2024
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b07099a6fdf05937446c486c8ef78e4cca081724
commit b07099a6fdf05937446c486c8ef78e4cca081724
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Thu Jun 20 01:10:21 2024 -0400
build: let HOST_CXXFLAGS default to HOST_CFLAGS
Usage of g++ should mimic the usage of gcc,
otherwise, part of a binary or library may have
optimizations and part of it may not,
unbeknownst to the users or developers working on a build.
This can lead to some features like, for example, FORTIFY_SOURCE,
to have less of an effect or even cause a build error on some hosts.
Therefore, let HOST_CXXFLAGS default to HOST_CFLAGS.
Fixes: 87d489f67 ("build: add HOST_CXXFLAGS for host build")
Signed-off-by: Michael Pratt <mcpratt at pm.me>
Link: https://github.com/openwrt/openwrt/pull/15853
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
rules.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rules.mk b/rules.mk
index 91ed9b2085..ae20742bd7 100644
--- a/rules.mk
+++ b/rules.mk
@@ -245,8 +245,8 @@ export PKG_CONFIG
HOSTCC:=$(STAGING_DIR_HOST)/bin/gcc
HOSTCXX:=$(STAGING_DIR_HOST)/bin/g++
HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include)
-HOST_CXXFLAGS:=
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
+HOST_CXXFLAGS:=$(HOST_CFLAGS)
HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
BUILD_KEY=$(TOPDIR)/key-build
More information about the lede-commits
mailing list