]> git.ipfire.org Git - ipfire-3.x.git/blob - pkgs/toolchain/glibc/glibc.nm
naoki: Initial checkin.
[ipfire-3.x.git] / pkgs / toolchain / glibc / glibc.nm
1
2 PKG_TOOLCHAIN_DEPS += binutils-static gcc-static kernel-headers
3
4 include ../../core/glibc/glibc.nm
5
6 $(STAGE_BUILD): $(STAGE_PREPARE)
7 @$(PRE_BUILD)
8
9 # Glibc uses a hard coded path for /etc/ld.so.preload. To keep Glibc from
10 # preloading libraries from the host machine perform the following command:
11 cd $(DIR_APP) && sed -e "s@/etc/ld.so.preload@$(TOOLS_DIR)@" -i elf/rtld.c
12
13 cd $(DIR_SRC)/glibc-build && \
14 CFLAGS= \
15 CXXFLAGS= \
16 ../$(THISAPP)/configure \
17 $(CONFIGURE_ARCH) \
18 --prefix=$(TOOLS_DIR) \
19 --libexecdir=$(TOOLS_DIR)/lib/$(PKG_NAME) \
20 --with-headers=$(TOOLS_DIR)/include \
21 --with-binutils=$(TOOLS_DIR)/bin \
22 --disable-profile \
23 --enable-add-ons \
24 --enable-kernel=$(OPTIMIZED_KERNEL) \
25 --without-selinux \
26 --without-gd \
27 --enable-bind-now \
28 --enable-stackguard-randomization
29
30 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
31 # LDFLAGS.so is appended to so we don't build shared libraries with
32 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
33 # the libraries, not the programs:
34 echo "build-programs=no" \
35 >> $(DIR_SRC)/glibc-build/configparms
36
37 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
38 CFLAGS="-O2 -DPIC -fno-stack-protector -U_FORTIFY_SOURCE" \
39 CXXFLAGS="-O2 -DPIC -fno-stack-protector -U_FORTIFY_SOURCE"
40
41 # Then build the programs with hardening, so everything possible in
42 # $(TOOLS_DIR) is hardened:
43 echo "CFLAGS = $(CFLAGS)" > $(DIR_SRC)/glibc-build/configparms
44 echo "CXXFLAGS = $(CXXFLAGS)" >> $(DIR_SRC)/glibc-build/configparms
45 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(PARALLELISMFLAGS) \
46 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
47
48 @$(POST_BUILD)
49
50
51 $(STAGE_INSTALL): $(STAGE_BUILD)
52 @$(PRE_INSTALL)
53
54 -mkdir -v $(TOOLS_DIR)/etc
55 touch $(TOOLS_DIR)/etc/ld.so.conf
56
57 cd $(DIR_SRC)/glibc-build && make install
58
59 @$(POST_INSTALL)