]> Git Repo - uclibc-ng.git/blame - Rules.mak
move more rules out of the if HAVE_DOT_CONFIG statement which dont belong
[uclibc-ng.git] / Rules.mak
CommitLineData
2c8e931c 1# Rules.make for uClibc
af1112c8 2#
5a653498 3# Copyright (C) 2000 by Lineo, inc.
58bd16ab 4# Copyright (C) 2000-2002 Erik Andersen <[email protected]>
af1112c8
EA
5#
6# This program is free software; you can redistribute it and/or modify it under
7# the terms of the GNU Library General Public License as published by the Free
8# Software Foundation; either version 2 of the License, or (at your option) any
9# later version.
10#
11# This program is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
91102e0d 13# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
af1112c8
EA
14# details.
15#
4d45bcff
EA
16# You should have received a copy of the GNU Library General Public License
17# along with this program; if not, write to the Free Software Foundation, Inc.,
18# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
af1112c8 19
f149abb8 20
5f9dfa09
MF
21#-----------------------------------------------------------
22# This file contains rules which are shared between multiple
23# Makefiles. All normal configuration options live in the
24# file named ".config". Don't mess with this file unless
25# you know what you are doing.
f149abb8
EA
26
27
5f9dfa09
MF
28#-----------------------------------------------------------
29# If you are running a cross compiler, you will want to set
30# 'CROSS' to something more interesting ... Target
31# architecture is determined by asking the CC compiler what
32# arch it compiles things for, so unless your compiler is
33# broken, you should not need to specify TARGET_ARCH.
f149abb8
EA
34#
35# Most people will set this stuff on the command line, i.e.
f21f7c41
EA
36# make CROSS=arm-linux-
37# will build uClibc for 'arm'.
f149abb8 38
b2eb218f 39ifndef CROSS
c92bcb00 40CROSS=
b2eb218f 41endif
5f9dfa09
MF
42CC = $(CROSS)gcc
43AR = $(CROSS)ar
44LD = $(CROSS)ld
45NM = $(CROSS)nm
5f9dfa09 46STRIPTOOL = $(CROSS)strip
6737908f 47
5f9dfa09
MF
48INSTALL = install
49LN = ln
50RM = rm -f
49f0dd0f 51
6737908f 52# Select the compiler needed to build binaries for your development system
5f9dfa09
MF
53HOSTCC = gcc
54HOSTCFLAGS = -O2 -Wall
6737908f 55
af1112c8 56
5f9dfa09
MF
57#---------------------------------------------------------
58# Nothing beyond this point should ever be touched by mere
59# mortals. Unless you hang out with the gods, you should
60# probably leave all this stuff alone.
61MAJOR_VERSION := 0
62MINOR_VERSION := 9
d2d040e1 63SUBLEVEL := 28
5f9dfa09 64VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
2c84741c 65# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
5f9dfa09 66LC_ALL := C
f5636fb2 67export MAJOR_VERSION MINOR_VERSION SUBLEVEL VERSION LC_ALL
58bd16ab 68
5739992b
EA
69SHARED_MAJORNAME:=libc.so.$(MAJOR_VERSION)
70UCLIBC_LDSO:=ld-uClibc.so.$(MAJOR_VERSION)
9ddd9870 71NONSHARED_LIBNAME:=uclibc_nonshared.a
c75d8083 72
129b1d71
MF
73# Make sure DESTDIR and PREFIX can be used to install
74# PREFIX is a uClibcism while DESTDIR is a common GNUism
75ifndef PREFIX
76PREFIX = $(DESTDIR)
77endif
78
6737908f
EA
79# Pull in the user's uClibc configuration
80ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
6737908f
EA
81-include $(TOPDIR).config
82endif
83
05827f4c 84ifndef CROSS
ce23f5cd 85CROSS=$(subst ",, $(strip $(CROSS_COMPILER_PREFIX)))
05827f4c
MF
86endif
87
efe79476 88# A nifty macro to make testing gcc features easier
8c9cfb76
MF
89check_gcc=$(shell \
90 if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
efe79476 91 then echo "$(1)"; else echo "$(2)"; fi)
8c9cfb76
MF
92check_as=$(shell \
93 if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
75ca73f4 94 then echo "-Wa,$(1)"; fi)
efe79476 95
e5760ee3
MF
96# Setup some shortcuts so that silent mode is silent like it should be
97ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS))
98export MAKE_IS_SILENT=n
99SECHO=@echo
100SHELL_SET_X=set -x
101else
102export MAKE_IS_SILENT=y
103SECHO=-@false
104SHELL_SET_X=set +x
105endif
106
f8a3fa02 107# Make certain these contain a final "/", but no "//"s.
fffdc162 108TARGET_ARCH:=$(shell grep -s ^TARGET_ARCH $(TOPDIR)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g')
f8a3fa02
EA
109RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
110DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX))))))
270bd86b
MF
111KERNEL_SOURCE:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(KERNEL_SOURCE))))))
112export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_SOURCE
aa966844 113
e970fad1 114ARFLAGS:=cr
aa966844 115
efe79476 116OPTIMIZATION:=
783a979b 117PICFLAG:=-fPIC
ce5d0580 118PIEFLAG_NAME:=-fPIE
4efa075c 119
0c6405c1 120# Some nice CPU specific optimizations
06d634ea 121ifeq ($(strip $(TARGET_ARCH)),i386)
efe79476 122 OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,)
0c6405c1 123 OPTIMIZATION+=$(call check_gcc,-falign-jumps=0 -falign-loops=0,-malign-jumps=0 -malign-loops=0)
6a2d1ca4
EA
124 CPU_CFLAGS-$(CONFIG_386)+=-march=i386
125 CPU_CFLAGS-$(CONFIG_486)+=-march=i486
bbab258a 126 CPU_CFLAGS-$(CONFIG_ELAN)+=-march=i486
6a2d1ca4
EA
127 CPU_CFLAGS-$(CONFIG_586)+=-march=i586
128 CPU_CFLAGS-$(CONFIG_586MMX)+=$(call check_gcc,-march=pentium-mmx,-march=i586)
129 CPU_CFLAGS-$(CONFIG_686)+=-march=i686
bbab258a 130 CPU_CFLAGS-$(CONFIG_PENTIUMII)+=$(call check_gcc,-march=pentium2,-march=i686)
6a2d1ca4
EA
131 CPU_CFLAGS-$(CONFIG_PENTIUMIII)+=$(call check_gcc,-march=pentium3,-march=i686)
132 CPU_CFLAGS-$(CONFIG_PENTIUM4)+=$(call check_gcc,-march=pentium4,-march=i686)
133 CPU_CFLAGS-$(CONFIG_K6)+=$(call check_gcc,-march=k6,-march=i586)
e1ac781e
MF
134 CPU_CFLAGS-$(CONFIG_K7)+=$(call check_gcc,-march=athlon,-march=i686) $(call check_gcc,-falign-functions=4,-malign-functions=4)
135 CPU_CFLAGS-$(CONFIG_CRUSOE)+=-march=i686 $(call check_gcc,-falign-functions=0,-malign-functions=0)
6a2d1ca4
EA
136 CPU_CFLAGS-$(CONFIG_WINCHIPC6)+=$(call check_gcc,-march=winchip-c6,-march=i586)
137 CPU_CFLAGS-$(CONFIG_WINCHIP2)+=$(call check_gcc,-march=winchip2,-march=i586)
e1ac781e 138 CPU_CFLAGS-$(CONFIG_CYRIXIII)+=$(call check_gcc,-march=c3,-march=i486) $(call check_gcc,-falign-functions=0,-malign-functions=0)
bbab258a 139 CPU_CFLAGS-$(CONFIG_NEHEMIAH)+=$(call check_gcc,-march=c3-2,-march=i686)
06d634ea 140endif
0c6405c1 141
4147ffbc
MF
142ifeq ($(strip $(TARGET_ARCH)),sparc)
143 CPU_CFLAGS-$(CONFIG_SPARC_V7)+=-mcpu=v7
144 CPU_CFLAGS-$(CONFIG_SPARC_V8)+=-mcpu=v8
145 CPU_CFLAGS-$(CONFIG_SPARC_V9)+=-mcpu=v9
146 CPU_CFLAGS-$(CONFIG_SPARC_V9B)+=$(call check_gcc,-mcpu=v9b,-mcpu=ultrasparc)
147endif
148
0c6405c1
EA
149ifeq ($(strip $(TARGET_ARCH)),arm)
150 OPTIMIZATION+=-fstrict-aliasing
6a2d1ca4
EA
151 CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN)+=-EL
152 CPU_LDFLAGS-$(ARCH_BIG_ENDIAN)+=-EB
153 CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-mlittle-endian
154 CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mbig-endian
155 CPU_CFLAGS-$(CONFIG_GENERIC_ARM)+=
156 CPU_CFLAGS-$(CONFIG_ARM610)+=-mtune=arm610 -march=armv3
157 CPU_CFLAGS-$(CONFIG_ARM710)+=-mtune=arm710 -march=armv3
2c84741c 158 CPU_CFLAGS-$(CONFIG_ARM720T)+=-mtune=arm7tdmi -march=armv4
6a2d1ca4
EA
159 CPU_CFLAGS-$(CONFIG_ARM920T)+=-mtune=arm9tdmi -march=armv4
160 CPU_CFLAGS-$(CONFIG_ARM922T)+=-mtune=arm9tdmi -march=armv4
c78cc09f 161 CPU_CFLAGS-$(CONFIG_ARM926T)+=-mtune=arm9tdmi -march=armv5
fcb56ce4 162 CPU_CFLAGS-$(CONFIG_ARM1136JF_S)+=-mtune=arm1136jf-s -march=armv6
6a2d1ca4
EA
163 CPU_CFLAGS-$(CONFIG_ARM_SA110)+=-mtune=strongarm110 -march=armv4
164 CPU_CFLAGS-$(CONFIG_ARM_SA1100)+=-mtune=strongarm1100 -march=armv4
da19a2df
EA
165 CPU_CFLAGS-$(CONFIG_ARM_XSCALE)+=$(call check_gcc,-mtune=xscale,-mtune=strongarm110)
166 CPU_CFLAGS-$(CONFIG_ARM_XSCALE)+=-march=armv4 -Wa,-mcpu=xscale
0c6405c1
EA
167endif
168
f6552f74
MNI
169ifeq ($(strip $(TARGET_ARCH)),mips)
170 CPU_CFLAGS-$(CONFIG_MIPS_ISA_1)+=-mips1
171 CPU_CFLAGS-$(CONFIG_MIPS_ISA_2)+=-mips2 -mtune=mips2
172 CPU_CFLAGS-$(CONFIG_MIPS_ISA_3)+=-mips3 -mtune=mips3
173 CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
174 CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
175 CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
176endif
177
d1990393 178ifeq ($(strip $(TARGET_ARCH)),sh)
0c6405c1 179 OPTIMIZATION+=-fstrict-aliasing
f149abb8 180 OPTIMIZATION+= $(call check_gcc,-mprefergot,)
6a2d1ca4
EA
181 CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN)+=-EL
182 CPU_LDFLAGS-$(ARCH_BIG_ENDIAN)+=-EB
183 CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-ml
184 CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mb
185 CPU_CFLAGS-$(CONFIG_SH2)+=-m2
186 CPU_CFLAGS-$(CONFIG_SH3)+=-m3
3a7ac9c7 187ifeq ($(UCLIBC_HAS_FLOATS),y)
e8a91ad3 188 CPU_CFLAGS-$(CONFIG_SH2A)+=-m2a
6a2d1ca4 189 CPU_CFLAGS-$(CONFIG_SH4)+=-m4
e8a91ad3
PM
190else
191 CPU_CFLAGS-$(CONFIG_SH2A)+=-m2a-nofpu
192 CPU_CFLAGS-$(CONFIG_SH4)+=-m4-nofpu
193endif
533d76fb
EA
194endif
195
196ifeq ($(strip $(TARGET_ARCH)),sh64)
197 OPTIMIZATION+=-fstrict-aliasing
6a2d1ca4
EA
198 CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN):=-EL
199 CPU_LDFLAGS-$(ARCH_BIG_ENDIAN):=-EB
200 CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN):=-ml
201 CPU_CFLAGS-$(ARCH_BIG_ENDIAN):=-mb
202 CPU_CFLAGS-$(CONFIG_SH5)+=-m5-32media
5a2610fb 203endif
163df9f2 204
de2abcca 205ifeq ($(strip $(TARGET_ARCH)),h8300)
6a2d1ca4
EA
206 CPU_LDFLAGS-$(CONFIG_H8300H)+= -ms8300h
207 CPU_LDFLAGS-$(CONFIG_H8S) += -ms8300s
dd7edf2e
DM
208 CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32 -fsigned-char
209 CPU_CFLAGS-$(CONFIG_H8S) += -ms -mint32 -fsigned-char
de2abcca
EA
210endif
211
afb1cd9b 212ifeq ($(strip $(TARGET_ARCH)),cris)
6a2d1ca4
EA
213 CPU_LDFLAGS-$(CONFIG_CRIS)+=-mcrislinux
214 CPU_CFLAGS-$(CONFIG_CRIS)+=-mlinux
783a979b 215 PICFLAG:=-fpic
ce5d0580 216 PIEFLAG_NAME:=-fpie
783a979b
JT
217endif
218
219ifeq ($(strip $(TARGET_ARCH)),powerpc)
220# PowerPC can hold 8192 entries in its GOT with -fpic which is more than
221# enough. Therefore use -fpic which will reduce code size and generates
222# faster code.
223 PICFLAG:=-fpic
ce5d0580 224 PIEFLAG_NAME:=-fpie
afb1cd9b
TA
225endif
226
baa67289
EA
227ifeq ($(strip $(TARGET_ARCH)),frv)
228 CPU_LDFLAGS-$(CONFIG_FRV)+=-melf32frvfd
229 CPU_CFLAGS-$(CONFIG_FRV)+=-mfdpic
afd3f33a
MF
230 # Using -pie causes the program to have an interpreter, which is
231 # forbidden, so we must make do with -shared. Unfortunately,
232 # -shared by itself would get us global function descriptors
233 # and calls through PLTs, dynamic resolution of symbols, etc,
234 # which would break as well, but -Bsymbolic comes to the rescue.
235 export LDPIEFLAG:=-shared -Bsymbolic
baa67289
EA
236 UCLIBC_LDSO=ld.so.1
237endif
238
8c9cfb76
MF
239# Keep the check_gcc from being needlessly executed
240ifndef PIEFLAG
ce5d0580 241ifneq ($(UCLIBC_BUILD_PIE),y)
8c9cfb76 242export PIEFLAG:=
ce5d0580 243else
afd3f33a
MF
244export PIEFLAG:=$(call check_gcc,$(PIEFLAG_NAME),$(PICFLAG))
245endif
246endif
247# We need to keep track of both the CC PIE flag (above) as
248# well as the LD PIE flag (below) because we can't rely on
249# gcc passing -pie if we used -fPIE
250ifndef LDPIEFLAG
251ifneq ($(UCLIBC_BUILD_PIE),y)
252export LDPIEFLAG:=
253else
254export LDPIEFLAG:=$(shell $(LD) --help | grep -q pie && echo "-Wl,-pie")
8c9cfb76 255endif
ce5d0580
MF
256endif
257
5eef4411
PM
258# Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)
259ifndef ASNEEDED
260ifneq ($(UCLIBC_HAS_SSP),y)
261export ASNEEDED:=
262else
01c9aec7 263export ASNEEDED:=$(shell (LD_TMP=$(mktemp LD_XXXXXX) ; echo "GROUP ( AS_NEEDED ( /usr/lib/libc.so ) )" > $LD_TMP && if $(LD) -T $LD_TMP -o /dev/null > /dev/null 2>&1; then echo "AS_NEEDED ( $(UCLIBC_LDSO) )"; else echo "$(UCLIBC_LDSO)"; fi; rm -f $LD_TMP ) )
5eef4411
PM
264endif
265endif
266
1b44e1b2 267# Use '-Os' optimization if available, else use -O2, allow Config to override
956574dc 268OPTIMIZATION+=$(call check_gcc,-Os,-O2)
1b44e1b2
EA
269# Use the gcc 3.4 -funit-at-a-time optimization when available
270OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
96b6b3fc 271
aa966844 272# Add a bunch of extra pedantic annoyingly strict checks
b340985b
EA
273XWARNINGS=$(subst ",, $(strip $(WARNINGS))) -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
274XARCH_CFLAGS=$(subst ",, $(strip $(ARCH_CFLAGS)))
c52c2a24 275CPU_CFLAGS=$(subst ",, $(strip $(CPU_CFLAGS-y)))
53d8027c
MNI
276
277LDADD_LIBFLOAT=
3a7ac9c7 278ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
53d8027c
MNI
279# Add -msoft-float to the CPU_FLAGS since ldso and libdl ignore CFLAGS.
280# If -msoft-float isn't supported, we want an error anyway.
3c44c596
MNI
281# Hmm... might need to revisit this for arm since it has 2 different
282# soft float encodings.
53d8027c
MNI
283 CPU_CFLAGS += -msoft-float
284ifeq ($(strip $(TARGET_ARCH)),arm)
3c44c596
MNI
285# No longer needed with current toolchains, but leave it here for now.
286# If anyone is actually still using gcc 2.95 (say), they can uncomment it.
287# LDADD_LIBFLOAT=-lfloat
53d8027c
MNI
288endif
289endif
290
86553e66 291SSP_DISABLE_FLAGS?=$(call check_gcc,-fno-stack-protector,)
433ccbdd 292ifeq ($(UCLIBC_BUILD_SSP),y)
75ca73f4 293SSP_CFLAGS:=$(call check_gcc,-fno-stack-protector-all,)
9d7a22d3 294SSP_CFLAGS+=$(call check_gcc,-fstack-protector,)
86553e66 295SSP_ALL_CFLAGS?=$(call check_gcc,-fstack-protector-all,)
3d831a7c 296else
75ca73f4 297SSP_CFLAGS:=$(SSP_DISABLE_FLAGS)
9d7a22d3
MNI
298endif
299
e75a596e 300# Some nice CFLAGS to work with
8891cd94 301CFLAGS:=$(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
b340985b 302 -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)include -I.
75ca73f4 303LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc -z defs
aa966844 304
98fd3d6c 305ifeq ($(DODEBUG),y)
548a9b72 306 #CFLAGS += -g3
75ca73f4
JT
307 CFLAGS += -O0 -g3
308 LDFLAGS := $(LDFLAGS_NOSTRIP)
98fd3d6c 309 STRIPTOOL:= true -Since_we_are_debugging
98fd3d6c 310else
75ca73f4
JT
311 CFLAGS += $(OPTIMIZATION) $(XARCH_CFLAGS)
312 LDFLAGS := $(LDFLAGS_NOSTRIP) -s
98fd3d6c
EA
313endif
314
8789ec41 315ifeq ($(DOMULTI),y)
6e3a0044
PM
316# we try to compile all sources at once into an object (IMA), but
317# gcc-3.3.x does not support it
47d8fab8 318# gcc-3.4.x supports it, but does not need and support --combine. though fails on many sources
6e3a0044
PM
319# gcc-4.0.x supports it, supports the --combine flag, but does not need it
320# gcc-4.1(200506xx) supports it, but needs the --combine flag, else libs are useless
47d8fab8
PM
321GCC_VER?=$(shell $(CC) -dumpversion | cut -d . -f 1)
322ifeq ($(GCC_VER),3)
8789ec41 323DOMULTI:=n
6e3a0044
PM
324else
325CFLAGS+=$(call check_gcc,--combine,)
326endif
8789ec41
PM
327else
328DOMULTI:=n
329endif
6e3a0044 330
8c7ac6fc 331ifeq ($(UCLIBC_HAS_THREADS),y)
3a7ac9c7 332ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
c0b31e50
PM
333 PTNAME := nptl
334else
335 PTNAME := linuxthreads
336endif
ded43321 337PTDIR := $(TOPDIR)libpthread/$(PTNAME)
8c7ac6fc 338# set up system dependencies include dirs (NOTE: order matters!)
3a7ac9c7 339ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
86553e66
PM
340PTINC:= -I$(PTDIR)/compat \
341 -I$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH) \
342 -I$(PTDIR)/sysdeps/$(TARGET_ARCH) \
343 -I$(PTDIR)/sysdeps/unix/sysv/linux \
344 -I$(PTDIR)/sysdeps/pthread \
345 -I$(PTDIR)/sysdeps/pthread/bits \
346 -I$(PTDIR)/sysdeps/generic \
347 -include $(PTDIR)/compat/libc-symbols.h
a6487435
SH
348#
349# Test for TLS if NPTL support was selected.
350#
351GCC_HAS_TLS=$(shell \
352 echo "extern __thread int foo;" | $(CC) -o /dev/null -S -xc - 2>&1)
353ifneq ($(GCC_HAS_TLS),)
354gcc_tls_test_fail:
355 @echo "####";
356 @echo "#### Your compiler does not support TLS and you are trying to build uClibc";
357 @echo "#### with NPTL support. Upgrade your binutils and gcc to versions which";
358 @echo "#### support TLS for your architecture. Do not contact uClibc maintainers";
359 @echo "#### about this problem.";
360 @echo "####";
361 @echo "#### Exiting...";
362 @echo "####";
363 @exit 1;
364endif
365else
86553e66
PM
366PTINC:= -I$(PTDIR)/sysdeps/$(TARGET_ARCH) \
367 -I$(PTDIR)/sysdeps/pthread
a6487435 368endif
a80fc77b 369CFLAGS+=$(PTINC)
8c7ac6fc
SH
370endif
371
6ae64d25
EA
372ifeq ($(UCLIBC_BUILD_RELRO),y)
373LDFLAGS+=-z relro
374endif
375
376ifeq ($(UCLIBC_BUILD_NOW),y)
377LDFLAGS+=-z now
378endif
379
4775ec64
EA
380# Sigh, some stupid versions of gcc can't seem to cope with '-iwithprefix include'
381#CFLAGS+=-iwithprefix include
a56073a2 382CFLAGS+=-isystem $(shell $(CC) -print-file-name=include)
4775ec64 383
98fd3d6c 384ifneq ($(DOASSERTS),y)
86553e66 385CFLAGS+=-DNDEBUG
0dd72555 386endif
c5207a55 387
8c9cfb76 388# Keep the check_as from being needlessly executed
8c9cfb76 389ifndef ASFLAGS_NOEXEC
f8e6aa06 390ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y)
8c9cfb76
MF
391export ASFLAGS_NOEXEC := $(call check_as,--noexecstack)
392else
393export ASFLAGS_NOEXEC :=
394endif
f8e6aa06 395endif
8585cd4d 396ASFLAGS = $(ASFLAGS_NOEXEC)
4a56d69f 397
881e6dca 398LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y)
f149abb8
EA
399LIBGCC:=$(shell $(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name)
400LIBGCC_DIR:=$(dir $(LIBGCC))
401
b2eb218f
DM
402########################################
403#
404# uClinux shared lib support
405#
406
dd7edf2e 407ifeq ($(CONFIG_BINFMT_SHARED_FLAT),y)
b2eb218f
DM
408 # For the shared version of this, we specify no stack and its library ID
409 FLTFLAGS += -s 0
410 LIBID=1
411 export LIBID FLTFLAGS
412 SHARED_TARGET = lib/libc
413endif
414
f8a3fa02 415TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH))))
This page took 0.277493 seconds and 4 git commands to generate.