Skip to content

Fixed CFLAGS and CXXFLAGS propagation for platform.mk to use #7494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
28 changes: 28 additions & 0 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.

#Expose CFLAGS and CXXFLAGS from configure
CFG_GCCISH_CFLAGS += $(CFLAGS)
CFG_GCCISH_CXXFLAGS += $(CXXFLAGS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no need to add above 3 lines

there is no CFLAGS, CXXFLAGS flags exported from config.mk
if user environments added like this, user environment flags automatically added may affect compile result.


# Create variables HOST_<triple> containing the host part
# of each target triple. For example, the triple i686-darwin-macos
Expand Down Expand Up @@ -340,6 +343,31 @@ CFG_LDPATH_i686-pc-mingw32 :=$(CFG_LDPATH_i686-pc-mingw32):$(PATH)
CFG_RUN_i686-pc-mingw32=PATH="$(CFG_LDPATH_i686-pc-mingw32):$(1)" $(2)
CFG_RUN_TARG_i686-pc-mingw32=$(call CFG_RUN_i686-pc-mingw32,$(HLIB$(1)_H_$(CFG_BUILD_TRIPLE)),$(2))

# x86_64-w64-mingw32 configuration
CC_x86_64-w64-mingw32=$(CC)
CXX_x86_64-w64-mingw32=$(CXX)
CPP_x86_64-w64-mingw32=$(CPP)
AR_x86_64-w64-mingw32=$(AR)
CFG_LIB_NAME_x86_64-w64-mingw32=$(1).dll
CFG_LIB_GLOB_x86_64-w64-mingw32=$(1)-*.dll
CFG_LIB_DSYM_GLOB_x86_64-w64-mingw32=$(1)-*.dylib.dSYM
CFG_GCCISH_CFLAGS_x86_64-w64-mingw32 := -pipe -Wall -Werror -g -m64 -arch x86_64
CFG_GCCISH_CXXFLAGS_x86_64-w64-mingw32 := -fno-rtti
CFG_GCCISH_LINK_FLAGS_x86_64-w64-mingw32 := -shared -fPIC -g -ldl -pthread -lrt -m64
CFG_GCCISH_DEF_FLAG_x86_64-w64-mingw32 :=
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-w64-mingw32 :=
CFG_GCCISH_POST_LIB_FLAGS_x86_64-w64-mingw32 :=
CFG_DEF_SUFFIX_x86_64-w64-mingw32 := .mingw64.def
CFG_INSTALL_NAME_x86_64-w64-mingw32 =
CFG_LIBUV_LINK_FLAGS_x86_64-w64-mingw32 := -lWs2_32 -lpsapi -liphlpapi
CFG_EXE_SUFFIX_x86_64-w64-mingw32 := .exe
CFG_WINDOWSY_x86_64-w64-mingw32 := 1
CFG_UNIXY_x86_64-w64-mingw32 :=
CFG_PATH_MUNGE_x86_64-w64-mingw32 :=
CFG_LDPATH_x86_64-w64-mingw32 :=$(CFG_LDPATH_x86_64-w64-mingw32):$(PATH)
CFG_RUN_x86_64-w64-mingw32=PATH="$(CFG_LDPATH_x86_64-w64-mingw32):$(1)" $(2)
CFG_RUN_TARG_x86_64-w64-mingw32=$(call CFG_RUN_x86_64-w64-mingw32,$(HLIB$(1)_H_$(CFG_BUILD_TRIPLE)),$(2))

# i586-mingw32msvc configuration
CC_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-gcc
CXX_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-g++
Expand Down