~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to Makefile.flags

  • Committer: Denys Vlasenko
  • Author(s): Christian Franke
  • Date: 2023-11-13 10:32:35 UTC
  • Revision ID: git-v1:a63b60bdd6fa26b867c80d44074118babbae7ffd
Cygwin: regenerate defconfig

Signed-off-by: Christian Franke <christian.franke@t-online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        -include include/autoconf.h \
16
16
        -D_GNU_SOURCE -DNDEBUG \
17
17
        $(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \
18
 
        -D"BB_VER=KBUILD_STR($(BB_VER))"
 
18
        $(if $(CONFIG_TIME64),-D_TIME_BITS=64) \
 
19
        -DBB_VER=$(squote)$(quote)$(BB_VER)$(quote)$(squote)
19
20
 
20
21
CFLAGS += $(call cc-option,-Wall,)
21
22
CFLAGS += $(call cc-option,-Wshadow,)
58
59
CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
59
60
CFLAGS += $(call cc-option,-funsigned-char,)
60
61
 
61
 
ifneq ($(CC),clang)
 
62
ifeq ($(CONFIG_STATIC_LIBGCC),y)
 
63
# Disable it, for example, if you get
62
64
# "clang-9: warning: argument unused during compilation: '-static-libgcc'"
63
65
CFLAGS += $(call cc-option,-static-libgcc,)
64
66
endif
77
79
CFLAGS += $(call cc-option,-fno-builtin-printf,)
78
80
 
79
81
# clang-9 does not like "str" + N and "if (CONFIG_ITEM && cond)" constructs
 
82
ifeq ($(CC),clang)
80
83
CFLAGS += $(call cc-option,-Wno-string-plus-int -Wno-constant-logical-operand)
 
84
endif
81
85
 
82
86
# FIXME: These warnings are at least partially to be concerned about and should
83
87
# be fixed..
84
88
#CFLAGS += $(call cc-option,-Wconversion,)
85
89
 
86
90
ifneq ($(CONFIG_DEBUG),y)
87
 
CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,))
 
91
CFLAGS += $(call cc-option,-Oz,$(call cc-option,-Os,$(call cc-option,-O2,)))
88
92
else
89
93
CFLAGS += $(call cc-option,-g,)
90
94
#CFLAGS += "-D_FORTIFY_SOURCE=2"
91
95
ifeq ($(CONFIG_DEBUG_PESSIMIZE),y)
92
96
CFLAGS += $(call cc-option,-O0,)
93
97
else
94
 
CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,))
 
98
CFLAGS += $(call cc-option,-Oz,$(call cc-option,-Os,$(call cc-option,-O2,)))
95
99
endif
96
100
endif
97
101
ifeq ($(CONFIG_DEBUG_SANITIZE),y)
142
146
export SYSROOT=$(CONFIG_SYSROOT)
143
147
endif
144
148
 
 
149
# libm may be needed for dc, awk, ntpd
 
150
LDLIBS += m
145
151
# Android has no separate crypt library
146
152
# gcc-4.2.1 fails if we try to feed C source on stdin:
147
153
#  echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc -
148
154
# fall back to using a temp file:
149
 
CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c)
 
155
CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >bb_libtest.c; $(CC) $(CFLAGS) $(CFLAGS_busybox) -lcrypt -o /dev/null bb_libtest.c >/dev/null 2>&1 && echo "y"; rm bb_libtest.c)
 
156
RT_AVAILABLE    := $(shell echo 'int main(void){return 0;}' >bb_libtest.c; $(CC) $(CFLAGS) $(CFLAGS_busybox) -lrt    -o /dev/null bb_libtest.c >/dev/null 2>&1 && echo "y"; rm bb_libtest.c)
150
157
ifeq ($(CRYPT_AVAILABLE),y)
151
 
LDLIBS += m rt crypt
152
 
else
153
 
LDLIBS += m rt
 
158
LDLIBS += crypt
154
159
endif
155
 
# libm may be needed for dc, awk, ntpd
156
160
# librt may be needed for clock_gettime()
 
161
ifeq ($(RT_AVAILABLE),y)
 
162
LDLIBS += rt
 
163
endif
157
164
 
158
165
# libpam may use libpthread, libdl and/or libaudit.
159
166
# On some platforms that requires an explicit -lpthread, -ldl, -laudit.
178
185
endif
179
186
 
180
187
ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y)
181
 
LDLIBS += resolv
 
188
ifneq (,$(findstring linux,$(shell $(CC) $(CFLAGS) -dumpmachine)))
 
189
LDLIBS += resolv
 
190
endif
 
191
ifneq (,$(findstring gnu,$(shell $(CC) $(CFLAGS) -dumpmachine)))
 
192
LDLIBS += resolv
 
193
endif
182
194
endif
183
195
 
184
196
ifeq ($(CONFIG_EFENCE),y)
204
216
#"))
205
217
endif
206
218
 
207
 
ifneq ($(CONFIG_EXTRA_LDLIBS),)
208
 
LDLIBS += $(strip $(subst ",,$(CONFIG_EXTRA_LDLIBS)))
209
 
#"))
210
 
endif
211
 
 
212
219
# Busybox is a stack-fatty so make sure we increase default size
213
220
# TODO: use "make stksizes" to find & fix big stack users
214
221
# (we stole scripts/checkstack.pl from the kernel... thanks guys!)