Skip to content

Commit 9954d6c

Browse files
theunifanquake
authored andcommitted
depends: hard-code necessary c(xx)flags rather than setting them per-host
The per-host flag variables hold platform-specific defaults that are ignored when flag environment variables are set, so it was wrong for them to contain -std options relied on by package definitions. Additionally, these flags (-pipe and -std=xx) will no longer be passed into the CMake build, meaning less duplication in the build summary. Pulled out of #31920.
1 parent 953c90d commit 9954d6c

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

depends/funcs.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ $(1)_ar=$$($$($(1)_type)_AR)
88
$(1)_ranlib=$$($$($(1)_type)_RANLIB)
99
$(1)_nm=$$($$($(1)_type)_NM)
1010
$(1)_cflags=$$($$($(1)_type)_CFLAGS) \
11-
$$($$($(1)_type)_$$(release_type)_CFLAGS)
11+
$$($$($(1)_type)_$$(release_type)_CFLAGS) \
12+
-pipe -std=$(C_STANDARD)
1213
$(1)_cxxflags=$$($$($(1)_type)_CXXFLAGS) \
13-
$$($$($(1)_type)_$$(release_type)_CXXFLAGS)
14+
$$($$($(1)_type)_$$(release_type)_CXXFLAGS) \
15+
-pipe -std=$(CXX_STANDARD)
1416
$(1)_ldflags=$$($$($(1)_type)_LDFLAGS) \
1517
$$($$($(1)_type)_$$(release_type)_LDFLAGS) \
1618
-L$$($($(1)_type)_prefix)/lib

depends/hosts/darwin.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ darwin_CXX=$(clangxx_prog) --target=$(host) \
6060
-iwithsysroot/usr/include/c++/v1 \
6161
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
6262

63-
darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION)
64-
darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION)
63+
darwin_CFLAGS=-mmacos-version-min=$(OSX_MIN_VERSION)
64+
darwin_CXXFLAGS=-mmacos-version-min=$(OSX_MIN_VERSION)
6565
darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION)
6666

6767
ifneq ($(build_os),darwin)

depends/hosts/freebsd.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
freebsd_CFLAGS=-pipe -std=$(C_STANDARD)
2-
freebsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
1+
freebsd_CFLAGS=
2+
freebsd_CXXFLAGS=
33

44
freebsd_release_CFLAGS=-O2
55
freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS)

depends/hosts/linux.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
linux_CFLAGS=-pipe -std=$(C_STANDARD)
2-
linux_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
1+
linux_CFLAGS=
2+
linux_CXXFLAGS=
33

44
ifneq ($(LTO),)
55
linux_AR = $(host_toolchain)gcc-ar

depends/hosts/mingw32.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),)
55
mingw32_CXX := $(host)-g++-posix
66
endif
77

8-
mingw32_CFLAGS=-pipe -std=$(C_STANDARD)
9-
mingw32_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
8+
mingw32_CFLAGS=
9+
mingw32_CXXFLAGS=
1010

1111
ifneq ($(LTO),)
1212
mingw32_AR = $(host_toolchain)gcc-ar

depends/hosts/netbsd.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
netbsd_CFLAGS=-pipe -std=$(C_STANDARD)
2-
netbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
1+
netbsd_CFLAGS=
2+
netbsd_CXXFLAGS=
33

44
ifneq ($(LTO),)
55
netbsd_AR = $(host_toolchain)gcc-ar

depends/hosts/openbsd.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
openbsd_CFLAGS=-pipe -std=$(C_STANDARD)
2-
openbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
1+
openbsd_CFLAGS=
2+
openbsd_CXXFLAGS=
33

44
openbsd_release_CFLAGS=-O2
55
openbsd_release_CXXFLAGS=$(openbsd_release_CFLAGS)

0 commit comments

Comments
 (0)